weapp-tailwindcss 5.0.0-next.2 → 5.0.0-next.20
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.md +6 -7
- package/bin/weapp-tailwindcss.js +1 -21
- package/dist/bundle-state-BlXvU4jl.js +530 -0
- package/dist/bundle-state-PO6MysTJ.mjs +414 -0
- package/dist/bundlers/shared/cache.d.ts +6 -6
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +2 -0
- package/dist/bundlers/shared/css-cleanup/color-gamut.d.ts +3 -0
- package/dist/bundlers/shared/css-cleanup/root-cleanups.d.ts +5 -0
- package/dist/bundlers/shared/css-cleanup/selectors.d.ts +8 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +7 -3
- package/dist/bundlers/shared/css-imports.d.ts +3 -3
- package/dist/bundlers/shared/generated-css-marker.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +20 -0
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/markers.d.ts +28 -0
- package/dist/bundlers/shared/generator-css/source-files.d.ts +14 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +24 -0
- package/dist/bundlers/shared/generator-css.d.ts +16 -22
- package/dist/bundlers/shared/hmr-timing.d.ts +22 -0
- package/dist/bundlers/shared/style-requests.d.ts +2 -0
- package/dist/bundlers/vite/bundle-state.d.ts +1 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +7 -1
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +24 -0
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/dirty-state.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/metrics.d.ts +17 -0
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +14 -2
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +5 -1
- package/dist/bundlers/vite/index.d.ts +1 -1
- package/dist/bundlers/vite/official-tailwind-plugins.d.ts +5 -0
- package/dist/bundlers/vite/postcss-config.d.ts +6 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +32 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +8 -3
- package/dist/bundlers/vite/runtime-class-set.d.ts +25 -0
- package/dist/bundlers/vite/source-candidates.d.ts +16 -1
- package/dist/bundlers/vite/source-scan.d.ts +26 -0
- package/dist/bundlers/vite/static-config-content.d.ts +5 -0
- package/dist/bundlers/vite/tailwind-basedir.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +6 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +6 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +9 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +31 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +2 -6
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +3 -7
- package/dist/cache/index.d.ts +6 -6
- package/dist/cli/context.d.ts +1 -14
- package/dist/cli/doctor/types.d.ts +11 -11
- package/dist/cli/helpers.d.ts +1 -2
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli/types.d.ts +0 -2
- package/dist/cli/vscode-entry.d.ts +3 -3
- package/dist/cli.js +605 -611
- package/dist/cli.mjs +614 -620
- package/dist/constants.d.ts +1 -2
- package/dist/core.js +13 -20
- package/dist/core.mjs +8 -14
- package/dist/css-macro/postcss.js +3 -2
- package/dist/css-macro/postcss.mjs +3 -2
- package/dist/css-macro.d.ts +1 -0
- package/dist/css-macro.js +2 -2
- package/dist/css-macro.mjs +2 -2
- package/dist/defaults-B1igPF_e.mjs +150 -0
- package/dist/defaults-IHhYxNeU.js +193 -0
- package/dist/defaults.d.ts +15 -1
- package/dist/defaults.js +6 -131
- package/dist/defaults.mjs +2 -129
- package/dist/escape.js +10 -2
- package/dist/escape.mjs +10 -2
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/options.d.ts +9 -8
- package/dist/generator/types.d.ts +3 -3
- package/dist/generator-DIuglJub.mjs +32 -0
- package/dist/generator-N4jy1HCk.js +55 -0
- package/dist/generator.js +12 -11
- package/dist/generator.mjs +2 -1
- package/dist/gulp.js +185 -47
- package/dist/gulp.mjs +179 -41
- package/dist/incremental-runtime-class-set-CJ0Pnsw2.js +2348 -0
- package/dist/incremental-runtime-class-set-hF-uiw6W.mjs +2285 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/js/babel/cache-options.d.ts +3 -0
- package/dist/js/babel/parse.d.ts +7 -4
- package/dist/js/index.d.ts +1 -0
- package/dist/js/literal-transform.d.ts +2 -0
- package/dist/js/precheck.d.ts +2 -2
- package/dist/lightningcss/style-handler/selector-transform.d.ts +1 -1
- package/dist/lightningcss/style-handler.d.ts +3 -3
- package/dist/logger-CZUxvJJD.mjs +2 -0
- package/dist/logger-EVNB9z7i.js +1 -0
- package/dist/postcss/config-directive.d.ts +1 -0
- package/dist/postcss/context.d.ts +9 -0
- package/dist/postcss/source-files.d.ts +8 -0
- package/dist/postcss/tailwind-version.d.ts +3 -0
- package/dist/postcss-D4UdbBQ6.mjs +228 -0
- package/dist/postcss-DlY-YRvA.js +237 -0
- package/dist/postcss.d.ts +2 -2
- package/dist/postcss.js +3 -276
- package/dist/postcss.mjs +1 -269
- package/dist/{recorder-gYSNLfOP.js → precheck-BjEbVEpX.js} +218 -314
- package/dist/{recorder-zsgatmkB.mjs → precheck-tbk626YL.mjs} +186 -281
- package/dist/presets.js +13 -11
- package/dist/presets.mjs +11 -9
- package/dist/reset.d.ts +1 -0
- package/dist/runtime-registry-D5qnaSpo.js +5516 -0
- package/dist/shared/mpx.d.ts +1 -0
- package/dist/source-candidates-BrvneDDd.mjs +209 -0
- package/dist/source-candidates-gxijpPI3.js +222 -0
- package/dist/tailwindcss/miniprogram.d.ts +5 -1
- package/dist/tailwindcss/patcher-options.d.ts +3 -51
- package/dist/tailwindcss/patcher.d.ts +1 -2
- package/dist/tailwindcss/runtime/cache.d.ts +4 -3
- package/dist/tailwindcss/runtime-patch.d.ts +5 -0
- package/dist/tailwindcss/runtime.d.ts +11 -12
- package/dist/tailwindcss/source-scan.d.ts +35 -0
- package/dist/tailwindcss/targets.d.ts +1 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +17 -14
- package/dist/tailwindcss/v4/css-entries.d.ts +2 -2
- package/dist/tailwindcss/v4/css-sources.d.ts +5 -0
- package/dist/tailwindcss/v4/patcher-options.d.ts +1 -23
- package/dist/tailwindcss/v4/patcher.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -5
- package/dist/tailwindcss/version.d.ts +4 -0
- package/dist/tailwindcss-BhG7BtB-.js +651 -0
- package/dist/tailwindcss-c6ROlNNW.mjs +600 -0
- package/dist/typedoc.export.d.ts +0 -2
- package/dist/types/index.d.ts +51 -48
- package/dist/types/shared.d.ts +3 -0
- package/dist/types/user-defined-options/general.d.ts +23 -23
- package/dist/types/user-defined-options/important.d.ts +31 -28
- package/dist/types/user-defined-options/lifecycle.d.ts +4 -4
- package/dist/types/user-defined-options/matcher.d.ts +6 -6
- package/dist/uni-app-x/vite.d.ts +1 -1
- package/dist/utils/disabled.d.ts +2 -3
- package/dist/utils/object.d.ts +9 -0
- package/dist/{utils-DmC9_In3.js → utils-4ODFyoqD.js} +1 -1
- package/dist/{utils-7DUGTFED.mjs → utils-CGBVVNm6.mjs} +1 -1
- package/dist/v3-engine-5LoZUH-4.js +3695 -0
- package/dist/v3-engine-DIXDEDmL.mjs +3406 -0
- package/dist/{vite-CrlzCNqz.mjs → vite-B5faZcbE.mjs} +1256 -1088
- package/dist/vite-MyXBNux0.js +2368 -0
- package/dist/vite.d.ts +1 -2
- package/dist/vite.js +3 -4
- package/dist/vite.mjs +2 -2
- package/dist/weapp-tw-css-import-rewrite-loader.js +5157 -16
- package/dist/weapp-tw-runtime-classset-loader.js +32 -7
- package/dist/webpack-BnVyDmsD.mjs +836 -0
- package/dist/webpack-Mz1V0A9p.js +846 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +27 -37
- package/dist/bundlers/shared/generator-candidates.d.ts +0 -5
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +0 -14
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +0 -15
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +0 -9
- package/dist/bundlers/webpack/shared/css-imports.d.ts +0 -6
- package/dist/cli/config.d.ts +0 -5
- package/dist/cli/helpers/patch-cwd.d.ts +0 -1
- package/dist/cli/mount-options/patch-status.d.ts +0 -2
- package/dist/cli/patch-options.d.ts +0 -6
- package/dist/cli/tokens.d.ts +0 -4
- package/dist/cli/workspace/package-dirs.d.ts +0 -3
- package/dist/cli/workspace/patch-package.d.ts +0 -3
- package/dist/cli/workspace/patch-utils.d.ts +0 -3
- package/dist/cli/workspace/types.d.ts +0 -11
- package/dist/cli/workspace/workspace-globs.d.ts +0 -2
- package/dist/cli/workspace/workspace-io.d.ts +0 -1
- package/dist/cli/workspace/workspace-lock.d.ts +0 -1
- package/dist/cli/workspace.d.ts +0 -2
- package/dist/css-imports-BbrbluP9.js +0 -177
- package/dist/css-imports-CSdPq_Sc.mjs +0 -128
- package/dist/experimental/index.d.ts +0 -2
- package/dist/experimental/oxc/ast-utils.d.ts +0 -30
- package/dist/experimental/oxc/index.d.ts +0 -2
- package/dist/experimental/oxc/module-specifiers.d.ts +0 -2
- package/dist/experimental/shared/cache.d.ts +0 -3
- package/dist/experimental/shared/transform.d.ts +0 -3
- package/dist/experimental/shared.d.ts +0 -8
- package/dist/experimental/swc/ast-utils.d.ts +0 -30
- package/dist/experimental/swc/index.d.ts +0 -2
- package/dist/experimental/swc/module-specifiers.d.ts +0 -2
- package/dist/generator-Y-Ikv4Fu.mjs +0 -1177
- package/dist/generator-css-B5ejWUMv.mjs +0 -1098
- package/dist/generator-css-D3OdPRiS.js +0 -1125
- package/dist/generator-mmhXzZnv.js +0 -1276
- package/dist/js/syntax.d.ts +0 -10
- package/dist/loader-anchors-CNkWT8hx.js +0 -273
- package/dist/loader-anchors-TrU7EUr7.mjs +0 -205
- package/dist/logger-BZ45DZJT.js +0 -1003
- package/dist/logger-BoVx1Dbt.mjs +0 -935
- package/dist/patcher-options-6gJN2EXy.js +0 -115
- package/dist/patcher-options-DQfR5xxT.mjs +0 -92
- package/dist/tailwindcss/recorder.d.ts +0 -13
- package/dist/tailwindcss/targets/paths.d.ts +0 -13
- package/dist/tailwindcss/targets/record-io.d.ts +0 -5
- package/dist/tailwindcss/targets/recorder.d.ts +0 -3
- package/dist/tailwindcss/targets/types.d.ts +0 -35
- package/dist/types/disabled-options.d.ts +0 -4
- package/dist/vite-BC9U7ahn.js +0 -2199
- package/dist/webpack-Bu6M-Hbw.mjs +0 -441
- package/dist/webpack-DD7A6V0u.js +0 -456
- package/dist/webpack4.d.ts +0 -4
- package/dist/webpack4.js +0 -387
- package/dist/webpack4.mjs +0 -379
- package/scripts/postinstall.mjs +0 -59
- /package/dist/{constants-B-_T5UnW.mjs → constants-BG12WAKw.mjs} +0 -0
- /package/dist/{constants-p1dyh1x1.js → constants-BeeyfJ9k.js} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -5,13 +5,16 @@ import type { Document, Result as PostcssResult, Root } from 'postcss';
|
|
|
5
5
|
import type { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
6
6
|
import type { ICreateCacheReturnType } from '../cache';
|
|
7
7
|
import type { ItemOrItemArray } from './base';
|
|
8
|
-
import type { DisabledOptions } from './disabled-options';
|
|
9
8
|
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared';
|
|
10
9
|
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options';
|
|
11
10
|
type AsyncableMethod<T> = T extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> | Awaited<R> : never;
|
|
12
|
-
export type {
|
|
11
|
+
export type { UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
13
12
|
export type { CssPreflightOptions, IStyleHandlerOptions, ItemOrItemArray };
|
|
14
13
|
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities } from './shared';
|
|
14
|
+
export type RequiredDefined<T> = {
|
|
15
|
+
[K in keyof T]-?: Exclude<T[K], undefined>;
|
|
16
|
+
};
|
|
17
|
+
type InternalUserDefinedOptionsBase = RequiredDefined<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary' | 'cache' | 'twPatcher' | 'refreshTailwindcssPatcher' | 'templateHandler' | 'styleHandler' | 'jsHandler'>>;
|
|
15
18
|
export interface LinkedJsModuleResult {
|
|
16
19
|
code: string;
|
|
17
20
|
}
|
|
@@ -23,57 +26,62 @@ export interface JsHandlerResult {
|
|
|
23
26
|
}
|
|
24
27
|
export interface TailwindcssPatcherLike {
|
|
25
28
|
packageInfo: TailwindcssPatcher['packageInfo'];
|
|
26
|
-
majorVersion?: TailwindcssPatcher['majorVersion'];
|
|
27
|
-
patch
|
|
29
|
+
majorVersion?: TailwindcssPatcher['majorVersion'] | undefined;
|
|
30
|
+
patch?: TailwindcssPatcher['patch'] | undefined;
|
|
28
31
|
getClassSet: AsyncableMethod<TailwindcssPatcher['getClassSet']>;
|
|
29
|
-
getClassSetSync?: TailwindcssPatcher['getClassSetSync'];
|
|
32
|
+
getClassSetSync?: TailwindcssPatcher['getClassSetSync'] | undefined;
|
|
30
33
|
extract: TailwindcssPatcher['extract'];
|
|
31
|
-
collectContentTokens?: TailwindcssPatcher['collectContentTokens'];
|
|
32
|
-
options?: TailwindcssPatcher['options'];
|
|
34
|
+
collectContentTokens?: TailwindcssPatcher['collectContentTokens'] | undefined;
|
|
35
|
+
options?: TailwindcssPatcher['options'] | undefined;
|
|
33
36
|
}
|
|
37
|
+
export type BabelParserOptions = ParserOptions & {
|
|
38
|
+
cache?: boolean | undefined;
|
|
39
|
+
cacheKey?: string | undefined;
|
|
40
|
+
cacheMaxEntries?: number | undefined;
|
|
41
|
+
cacheMaxSourceLength?: number | undefined;
|
|
42
|
+
};
|
|
34
43
|
export interface RefreshTailwindcssPatcherOptions {
|
|
35
|
-
clearCache?: boolean;
|
|
44
|
+
clearCache?: boolean | undefined;
|
|
36
45
|
}
|
|
37
46
|
export interface IJsHandlerOptions {
|
|
38
|
-
escapeMap?: Record<string, string
|
|
39
|
-
classNameSet?: Set<string
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
moduleGraph?: JsModuleGraphOptions;
|
|
47
|
+
escapeMap?: Record<string, string> | undefined;
|
|
48
|
+
classNameSet?: Set<string> | undefined;
|
|
49
|
+
jsArbitraryValueFallback?: boolean | 'auto' | undefined;
|
|
50
|
+
tailwindcssMajorVersion?: number | undefined;
|
|
51
|
+
arbitraryValues?: IArbitraryValues | undefined;
|
|
52
|
+
jsPreserveClass?: ((keyword: string) => boolean | undefined) | undefined;
|
|
53
|
+
needEscaped?: boolean | undefined;
|
|
54
|
+
generateMap?: boolean | undefined;
|
|
55
|
+
alwaysEscape?: boolean | undefined;
|
|
56
|
+
unescapeUnicode?: boolean | undefined;
|
|
57
|
+
babelParserOptions?: BabelParserOptions | undefined;
|
|
58
|
+
ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
59
|
+
ignoreCallExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
60
|
+
uniAppX?: boolean | undefined;
|
|
61
|
+
moduleSpecifierReplacements?: Record<string, string> | undefined;
|
|
62
|
+
wrapExpression?: boolean | undefined;
|
|
63
|
+
filename?: string | undefined;
|
|
64
|
+
moduleGraph?: JsModuleGraphOptions | undefined;
|
|
57
65
|
}
|
|
58
66
|
export interface JsHandler {
|
|
59
67
|
(rawSource: string, set?: Set<string>, options?: CreateJsHandlerOptions): JsHandlerResult;
|
|
60
68
|
}
|
|
61
69
|
export interface ICommonReplaceOptions {
|
|
62
|
-
keepEOL?: boolean;
|
|
63
|
-
escapeMap?: Record<string, string
|
|
70
|
+
keepEOL?: boolean | undefined;
|
|
71
|
+
escapeMap?: Record<string, string> | undefined;
|
|
64
72
|
}
|
|
65
73
|
export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
66
|
-
customAttributesEntities?: ICustomAttributesEntities;
|
|
67
|
-
escapeMap?: Record<string, string
|
|
68
|
-
inlineWxs?: boolean;
|
|
69
|
-
jsHandler?: JsHandler;
|
|
70
|
-
runtimeSet?: Set<string
|
|
71
|
-
disabledDefaultTemplateHandler?: boolean;
|
|
72
|
-
quote?: string | null;
|
|
73
|
-
ignoreHead?: boolean;
|
|
74
|
-
wrapExpression?: boolean;
|
|
74
|
+
customAttributesEntities?: ICustomAttributesEntities | undefined;
|
|
75
|
+
escapeMap?: Record<string, string> | undefined;
|
|
76
|
+
inlineWxs?: boolean | undefined;
|
|
77
|
+
jsHandler?: JsHandler | undefined;
|
|
78
|
+
runtimeSet?: Set<string> | undefined;
|
|
79
|
+
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
80
|
+
quote?: string | null | undefined;
|
|
81
|
+
ignoreHead?: boolean | undefined;
|
|
82
|
+
wrapExpression?: boolean | undefined;
|
|
75
83
|
}
|
|
76
|
-
export
|
|
84
|
+
export interface InternalUserDefinedOptions extends InternalUserDefinedOptionsBase {
|
|
77
85
|
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | boolean;
|
|
78
86
|
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
79
87
|
styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise<PostcssResult<Root | Document>>;
|
|
@@ -83,22 +91,17 @@ export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supp
|
|
|
83
91
|
cache: ICreateCacheReturnType;
|
|
84
92
|
twPatcher: TailwindcssPatcherLike;
|
|
85
93
|
refreshTailwindcssPatcher: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
|
|
86
|
-
}
|
|
94
|
+
}
|
|
87
95
|
export type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
|
|
88
96
|
export interface IBaseWebpackPlugin {
|
|
89
97
|
options: InternalUserDefinedOptions;
|
|
90
|
-
appType?: AppType;
|
|
98
|
+
appType?: AppType | undefined;
|
|
91
99
|
apply: (compiler: any) => void;
|
|
92
100
|
}
|
|
93
|
-
export interface InternalPatchResult {
|
|
94
|
-
dataTypes?: string;
|
|
95
|
-
processTailwindFeatures?: string;
|
|
96
|
-
plugin?: string;
|
|
97
|
-
}
|
|
98
101
|
export type CreateJsHandlerOptions = Omit<IJsHandlerOptions, 'classNameSet'>;
|
|
99
102
|
export interface JsModuleGraphOptions {
|
|
100
103
|
resolve: (specifier: string, importer: string) => string | undefined;
|
|
101
104
|
load: (id: string) => string | undefined;
|
|
102
|
-
filter?: (id: string, specifier: string, importer: string) => boolean;
|
|
103
|
-
maxDepth?: number;
|
|
105
|
+
filter?: ((id: string, specifier: string, importer: string) => boolean) | undefined;
|
|
106
|
+
maxDepth?: number | undefined;
|
|
104
107
|
}
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ export type ICustomAttributes = Record<string, ItemOrItemArray<string | RegExp>>
|
|
|
4
4
|
export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string | RegExp>][];
|
|
5
5
|
export interface IArbitraryValues {
|
|
6
6
|
allowDoubleQuotes?: boolean;
|
|
7
|
+
bareArbitraryValues?: boolean | {
|
|
8
|
+
units?: string[];
|
|
9
|
+
};
|
|
7
10
|
}
|
|
@@ -5,27 +5,27 @@ import type { ICreateCacheReturnType } from '../../cache';
|
|
|
5
5
|
import type { WeappTailwindcssGeneratorUserOptions } from '../../generator';
|
|
6
6
|
import type { AppType, IArbitraryValues } from '../shared';
|
|
7
7
|
export interface UserDefinedOptionsGeneralPart {
|
|
8
|
-
supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions | boolean;
|
|
9
|
-
appType?: AppType;
|
|
10
|
-
arbitraryValues?: IArbitraryValues;
|
|
11
|
-
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
cssChildCombinatorReplaceValue?: string | string[];
|
|
26
|
-
postcssOptions?: LoadedPostcssOptions;
|
|
27
|
-
cssRemoveHoverPseudoClass?: boolean;
|
|
28
|
-
cssRemoveProperty?: boolean;
|
|
29
|
-
tailwindcssPatcherOptions?: TailwindCssPatchOptions;
|
|
30
|
-
logLevel?: 'info' | 'warn' | 'error' | 'silent';
|
|
8
|
+
supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions | boolean | undefined;
|
|
9
|
+
appType?: AppType | undefined;
|
|
10
|
+
arbitraryValues?: IArbitraryValues | undefined;
|
|
11
|
+
jsPreserveClass?: ((keyword: string) => boolean | undefined) | undefined;
|
|
12
|
+
jsArbitraryValueFallback?: boolean | 'auto' | undefined;
|
|
13
|
+
replaceRuntimePackages?: boolean | Record<string, string> | undefined;
|
|
14
|
+
generator?: WeappTailwindcssGeneratorUserOptions | undefined;
|
|
15
|
+
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
16
|
+
runtimeLoaderPath?: string | undefined;
|
|
17
|
+
tailwindcssBasedir?: string | undefined;
|
|
18
|
+
cache?: boolean | ICreateCacheReturnType | undefined;
|
|
19
|
+
babelParserOptions?: (ParserOptions & {
|
|
20
|
+
cache?: boolean | undefined;
|
|
21
|
+
cacheKey?: string | undefined;
|
|
22
|
+
cacheMaxEntries?: number | undefined;
|
|
23
|
+
cacheMaxSourceLength?: number | undefined;
|
|
24
|
+
}) | undefined;
|
|
25
|
+
cssChildCombinatorReplaceValue?: string | string[] | undefined;
|
|
26
|
+
postcssOptions?: LoadedPostcssOptions | undefined;
|
|
27
|
+
cssRemoveHoverPseudoClass?: boolean | undefined;
|
|
28
|
+
cssRemoveProperty?: boolean | undefined;
|
|
29
|
+
tailwindcssPatcherOptions?: TailwindCssPatchOptions | undefined;
|
|
30
|
+
logLevel?: 'info' | 'warn' | 'error' | 'silent' | undefined;
|
|
31
31
|
}
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
import type { CssCalcOptions, CssPreflightOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, UniAppXUnsupportedMode, UnitsToPxOptions, WeappAutoprefixerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
1
|
+
import type { CssCalcOptions, CssPreflightOptions, IStyleHandlerOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, UniAppXUnsupportedMode, UnitsToPxOptions, WeappAutoprefixerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
3
|
-
import type { DisabledOptions } from '../disabled-options';
|
|
4
3
|
import type { ICustomAttributes } from '../shared';
|
|
5
4
|
export interface UniAppXComponentLocalStylesOptions {
|
|
6
|
-
enabled?: boolean;
|
|
7
|
-
onlyWhenStyleIsolationVersion2?: boolean;
|
|
5
|
+
enabled?: boolean | undefined;
|
|
6
|
+
onlyWhenStyleIsolationVersion2?: boolean | undefined;
|
|
8
7
|
}
|
|
9
8
|
export interface UniAppXOptions {
|
|
10
|
-
enabled?: boolean;
|
|
11
|
-
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions;
|
|
12
|
-
uvueUnsupported?: UniAppXUnsupportedMode;
|
|
9
|
+
enabled?: boolean | undefined;
|
|
10
|
+
componentLocalStyles?: boolean | UniAppXComponentLocalStylesOptions | undefined;
|
|
11
|
+
uvueUnsupported?: UniAppXUnsupportedMode | undefined;
|
|
13
12
|
}
|
|
14
13
|
export interface UserDefinedOptionsImportantPart {
|
|
15
|
-
disabled?: boolean |
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
disabled?: boolean | {
|
|
15
|
+
plugin?: boolean | undefined;
|
|
16
|
+
} | undefined;
|
|
17
|
+
customAttributes?: ICustomAttributes | undefined;
|
|
18
|
+
customReplaceDictionary?: Record<string, string> | undefined;
|
|
19
|
+
ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
20
|
+
ignoreCallExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
21
|
+
cssPreflight?: CssPreflightOptions | undefined;
|
|
22
|
+
cssPreflightRange?: 'all' | undefined;
|
|
23
|
+
cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
|
|
24
|
+
injectAdditionalCssVarScope?: boolean | undefined;
|
|
25
25
|
cssSelectorReplacement?: {
|
|
26
|
-
root?: string | string[] | false;
|
|
27
|
-
universal?: string | string[] | false;
|
|
28
|
-
};
|
|
29
|
-
rem2rpx?: boolean | Rem2rpxOptions;
|
|
30
|
-
px2rpx?: boolean | Px2rpxOptions;
|
|
31
|
-
unitsToPx?: boolean | UnitsToPxOptions;
|
|
32
|
-
cssPresetEnv?: PresetEnvOptions;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
root?: string | string[] | false | undefined;
|
|
27
|
+
universal?: string | string[] | false | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
rem2rpx?: boolean | Rem2rpxOptions | undefined;
|
|
30
|
+
px2rpx?: boolean | Px2rpxOptions | undefined;
|
|
31
|
+
unitsToPx?: boolean | UnitsToPxOptions | undefined;
|
|
32
|
+
cssPresetEnv?: PresetEnvOptions | undefined;
|
|
33
|
+
atRules?: IStyleHandlerOptions['atRules'] | undefined;
|
|
34
|
+
autoprefixer?: WeappAutoprefixerOptions | undefined;
|
|
35
|
+
tailwindcss?: TailwindCssPatchOptions['tailwindcss'] | undefined;
|
|
36
|
+
cssEntries?: string[] | undefined;
|
|
37
|
+
uniAppX?: boolean | UniAppXOptions | undefined;
|
|
38
|
+
uniAppXCssTarget?: IStyleHandlerOptions['uniAppXCssTarget'] | undefined;
|
|
39
|
+
uniAppXUnsupported?: IStyleHandlerOptions['uniAppXUnsupported'] | undefined;
|
|
37
40
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface UserDefinedOptionsLifecyclePart {
|
|
2
|
-
onLoad?: () => void;
|
|
3
|
-
onStart?: () => void;
|
|
4
|
-
onUpdate?: (filename: string, oldVal: string, newVal: string) => void;
|
|
5
|
-
onEnd?: () => void;
|
|
2
|
+
onLoad?: (() => void) | undefined;
|
|
3
|
+
onStart?: (() => void) | undefined;
|
|
4
|
+
onUpdate?: ((filename: string, oldVal: string, newVal: string) => void) | undefined;
|
|
5
|
+
onEnd?: (() => void) | undefined;
|
|
6
6
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AppType } from '../shared';
|
|
2
2
|
export interface UserDefinedOptionsMatcherPart {
|
|
3
|
-
htmlMatcher?: (name: string) => boolean;
|
|
4
|
-
cssMatcher?: (name: string) => boolean;
|
|
5
|
-
jsMatcher?: (name: string) => boolean;
|
|
6
|
-
mainCssChunkMatcher?: (name: string, appType?: AppType) => boolean;
|
|
7
|
-
wxsMatcher?: (name: string) => boolean;
|
|
8
|
-
inlineWxs?: boolean;
|
|
3
|
+
htmlMatcher?: ((name: string) => boolean) | undefined;
|
|
4
|
+
cssMatcher?: ((name: string) => boolean) | undefined;
|
|
5
|
+
jsMatcher?: ((name: string) => boolean) | undefined;
|
|
6
|
+
mainCssChunkMatcher?: ((name: string, appType?: AppType) => boolean) | undefined;
|
|
7
|
+
wxsMatcher?: ((name: string) => boolean) | undefined;
|
|
8
|
+
inlineWxs?: boolean | undefined;
|
|
9
9
|
}
|
package/dist/uni-app-x/vite.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Plugin, ResolvedConfig } from 'vite';
|
|
|
3
3
|
import type { ICreateCacheReturnType } from '../cache';
|
|
4
4
|
import type { AppType, CreateJsHandlerOptions, ICustomAttributesEntities, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../types';
|
|
5
5
|
interface UniAppXRuntimeState {
|
|
6
|
-
|
|
6
|
+
readyPromise: Promise<unknown>;
|
|
7
7
|
}
|
|
8
8
|
interface CreateUniAppXPluginsOptions {
|
|
9
9
|
appType: AppType;
|
package/dist/utils/disabled.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { UserDefinedOptions } from '../types';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ResolvedPluginDisabledState {
|
|
3
3
|
plugin: boolean;
|
|
4
|
-
rewriteCssImports: boolean;
|
|
5
4
|
}
|
|
6
|
-
export declare function
|
|
5
|
+
export declare function resolvePluginDisabledState(disabled: UserDefinedOptions['disabled']): ResolvedPluginDisabledState;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type DefinedEntry<T extends object> = {
|
|
2
|
+
[K in keyof T]: undefined extends T[K] ? [K, Exclude<T[K], undefined>] : [K, T[K]];
|
|
3
|
+
}[keyof T];
|
|
4
|
+
export type UndefinedOptional<T extends object> = {
|
|
5
|
+
[K in keyof T]?: T[K] | undefined;
|
|
6
|
+
};
|
|
7
|
+
export declare function definedEntries<T extends object>(value: UndefinedOptional<T>): DefinedEntry<T>[];
|
|
8
|
+
export declare function omitUndefined<T extends object>(value: UndefinedOptional<T>): Partial<T>;
|
|
9
|
+
export {};
|
|
@@ -6,7 +6,7 @@ require("@weapp-tailwindcss/shared");
|
|
|
6
6
|
function normalizePlatform(value) {
|
|
7
7
|
return value?.trim().toLowerCase() || void 0;
|
|
8
8
|
}
|
|
9
|
-
function resolveUniUtsPlatform(value = node_process.default.env
|
|
9
|
+
function resolveUniUtsPlatform(value = node_process.default.env["UNI_UTS_PLATFORM"]) {
|
|
10
10
|
const normalized = normalizePlatform(value);
|
|
11
11
|
const isAppAndroid = normalized === "app-android";
|
|
12
12
|
const isAppIos = normalized === "app-ios";
|
|
@@ -4,7 +4,7 @@ import { defu, defuOverrideArray as defuOverrideArray$1, isMap, noop } from "@we
|
|
|
4
4
|
function normalizePlatform(value) {
|
|
5
5
|
return value?.trim().toLowerCase() || void 0;
|
|
6
6
|
}
|
|
7
|
-
function resolveUniUtsPlatform(value = process.env
|
|
7
|
+
function resolveUniUtsPlatform(value = process.env["UNI_UTS_PLATFORM"]) {
|
|
8
8
|
const normalized = normalizePlatform(value);
|
|
9
9
|
const isAppAndroid = normalized === "app-android";
|
|
10
10
|
const isAppIos = normalized === "app-ios";
|