weapp-tailwindcss 4.12.0 → 5.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.d.ts +3 -0
- package/dist/bundlers/gulp/index.d.ts +7 -0
- package/dist/bundlers/shared/cache.d.ts +16 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/css-imports.d.ts +8 -0
- package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
- package/dist/bundlers/shared/generator-css.d.ts +41 -0
- package/dist/bundlers/shared/module-graph.d.ts +5 -0
- package/dist/bundlers/shared/run-tasks.d.ts +2 -0
- package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
- package/dist/bundlers/vite/bundle-state.d.ts +43 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
- package/dist/bundlers/vite/index.d.ts +3 -0
- package/dist/bundlers/vite/js-precheck.d.ts +1 -0
- package/dist/bundlers/vite/query.d.ts +15 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
- package/dist/bundlers/vite/utils.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
- package/dist/bundlers/webpack/index.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
- package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
- package/dist/cache/index.d.ts +38 -0
- package/dist/cache/md5.d.ts +1 -0
- package/dist/chunk-8l464Juk.js +28 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/context.d.ts +16 -0
- package/dist/cli/doctor/constants.d.ts +7 -0
- package/dist/cli/doctor/types.d.ts +31 -0
- package/dist/cli/doctor.d.ts +4 -0
- package/dist/cli/helpers/options/format.d.ts +2 -0
- package/dist/cli/helpers/options/parse.d.ts +3 -0
- package/dist/cli/helpers/options/resolve.d.ts +1 -0
- package/dist/cli/helpers/options.d.ts +3 -0
- package/dist/cli/helpers/patch-cwd.d.ts +1 -0
- package/dist/cli/helpers.d.ts +5 -0
- package/dist/cli/mount-options/patch-status.d.ts +2 -0
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli/patch-options.d.ts +6 -0
- package/dist/cli/tokens.d.ts +4 -0
- package/dist/cli/types.d.ts +17 -0
- package/dist/cli/vscode-entry.d.ts +14 -0
- package/dist/cli/workspace/package-dirs.d.ts +3 -0
- package/dist/cli/workspace/patch-package.d.ts +3 -0
- package/dist/cli/workspace/patch-utils.d.ts +3 -0
- package/dist/cli/workspace/types.d.ts +11 -0
- package/dist/cli/workspace/workspace-globs.d.ts +2 -0
- package/dist/cli/workspace/workspace-io.d.ts +1 -0
- package/dist/cli/workspace/workspace-lock.d.ts +1 -0
- package/dist/cli/workspace.d.ts +2 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +2425 -3524
- package/dist/cli.mjs +2402 -3505
- package/dist/constants-B-_T5UnW.mjs +44 -0
- package/dist/constants-p1dyh1x1.js +73 -0
- package/dist/constants.d.ts +13 -0
- package/dist/context/compiler-context-cache.d.ts +3 -0
- package/dist/context/custom-attributes.d.ts +2 -0
- package/dist/context/handlers.d.ts +6 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/logger.d.ts +4 -0
- package/dist/context/tailwindcss/basedir.d.ts +1 -0
- package/dist/context/tailwindcss/rax.d.ts +2 -0
- package/dist/context/tailwindcss.d.ts +4 -0
- package/dist/context/workspace.d.ts +3 -0
- package/dist/core.d.ts +5 -21
- package/dist/core.js +138 -180
- package/dist/core.mjs +135 -180
- package/dist/css-imports-BbrbluP9.js +177 -0
- package/dist/css-imports-CSdPq_Sc.mjs +128 -0
- package/dist/css-macro/constants.d.ts +14 -0
- package/dist/css-macro/index.d.ts +15 -0
- package/dist/css-macro/postcss.d.ts +3 -7
- package/dist/css-macro/postcss.js +44 -58
- package/dist/css-macro/postcss.mjs +44 -56
- package/dist/css-macro.d.ts +1 -20
- package/dist/css-macro.js +37 -50
- package/dist/css-macro.mjs +33 -47
- package/dist/debug/index.d.ts +5 -0
- package/dist/defaults.d.ts +2 -11
- package/dist/defaults.js +132 -8
- package/dist/defaults.mjs +128 -7
- package/dist/escape.js +31 -54
- package/dist/escape.mjs +18 -25
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/oxc/ast-utils.d.ts +30 -0
- package/dist/experimental/oxc/index.d.ts +2 -0
- package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
- package/dist/experimental/shared/cache.d.ts +3 -0
- package/dist/experimental/shared/transform.d.ts +3 -0
- package/dist/experimental/shared.d.ts +8 -0
- package/dist/experimental/swc/ast-utils.d.ts +30 -0
- package/dist/experimental/swc/index.d.ts +2 -0
- package/dist/experimental/swc/module-specifiers.d.ts +2 -0
- package/dist/generator/index.d.ts +11 -0
- package/dist/generator/options.d.ts +15 -0
- package/dist/generator/types.d.ts +19 -0
- package/dist/generator-CZ-JXw6T.js +492 -0
- package/dist/generator-Dwxgra97.mjs +399 -0
- package/dist/generator-css-CnYjiMrD.js +1084 -0
- package/dist/generator-css-DhPFjSzK.mjs +1057 -0
- package/dist/generator.d.ts +1 -0
- package/dist/generator.js +19 -0
- package/dist/generator.mjs +2 -0
- package/dist/gulp.d.ts +4 -24
- package/dist/gulp.js +271 -13
- package/dist/gulp.mjs +263 -13
- package/dist/index.d.ts +8 -15
- package/dist/index.js +12 -24
- package/dist/index.mjs +6 -24
- package/dist/js/JsTokenUpdater.d.ts +14 -0
- package/dist/js/ModuleGraph.d.ts +18 -0
- package/dist/js/NodePathWalker.d.ts +33 -0
- package/dist/js/babel/parse.d.ts +9 -0
- package/dist/js/babel/process.d.ts +4 -0
- package/dist/js/babel.d.ts +13 -0
- package/dist/js/class-context.d.ts +3 -0
- package/dist/js/evalTransforms.d.ts +7 -0
- package/dist/js/handlers.d.ts +5 -0
- package/dist/js/index.d.ts +4 -0
- package/dist/js/module-graph/ignored-exports.d.ts +18 -0
- package/dist/js/module-graph/types.d.ts +17 -0
- package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
- package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
- package/dist/js/precheck.d.ts +2 -0
- package/dist/js/sourceAnalysis.d.ts +17 -0
- package/dist/js/syntax.d.ts +10 -0
- package/dist/js/taggedTemplateIgnore.d.ts +13 -0
- package/dist/js/types.d.ts +11 -0
- package/dist/lightningcss/index.d.ts +8 -0
- package/dist/lightningcss/style-handler/options.d.ts +3 -0
- package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
- package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
- package/dist/lightningcss/style-handler.d.ts +17 -0
- package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
- package/dist/loader-anchors-cprm4Klq.js +273 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger-BZ45DZJT.js +1003 -0
- package/dist/logger-BoVx1Dbt.mjs +935 -0
- package/dist/patcher-options-6gJN2EXy.js +115 -0
- package/dist/patcher-options-DQfR5xxT.mjs +92 -0
- package/dist/postcss-html-transform.d.ts +3 -3
- package/dist/postcss-html-transform.js +7 -10
- package/dist/postcss-html-transform.mjs +3 -6
- package/dist/postcss.d.ts +15 -0
- package/dist/postcss.js +278 -0
- package/dist/postcss.mjs +268 -0
- package/dist/presets/hbuilderx.d.ts +4 -0
- package/dist/presets/index.d.ts +3 -0
- package/dist/presets/shared.d.ts +10 -0
- package/dist/presets/taro.d.ts +4 -0
- package/dist/presets/uni-app-x.d.ts +16 -0
- package/dist/presets/uni-app.d.ts +4 -0
- package/dist/presets.d.ts +1 -76
- package/dist/presets.js +115 -163
- package/dist/presets.mjs +107 -163
- package/dist/recorder-B_XyZ576.mjs +2763 -0
- package/dist/recorder-rn_2v_nd.js +2878 -0
- package/dist/reset/index.d.ts +2 -0
- package/dist/reset.d.ts +1 -4
- package/dist/reset.js +19 -8
- package/dist/reset.mjs +2 -8
- package/dist/shared/classname-transform.d.ts +14 -0
- package/dist/shared/mpx.d.ts +7 -0
- package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
- package/dist/tailwindcss/index.d.ts +11 -0
- package/dist/tailwindcss/miniprogram.d.ts +1 -0
- package/dist/tailwindcss/patcher-options.d.ts +56 -0
- package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
- package/dist/tailwindcss/patcher.d.ts +13 -0
- package/dist/tailwindcss/recorder.d.ts +13 -0
- package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
- package/dist/tailwindcss/runtime/cache.d.ts +11 -0
- package/dist/tailwindcss/runtime-logs.d.ts +3 -0
- package/dist/tailwindcss/runtime.d.ts +29 -0
- package/dist/tailwindcss/targets/paths.d.ts +13 -0
- package/dist/tailwindcss/targets/record-io.d.ts +5 -0
- package/dist/tailwindcss/targets/recorder.d.ts +3 -0
- package/dist/tailwindcss/targets/types.d.ts +35 -0
- package/dist/tailwindcss/targets.d.ts +6 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
- package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
- package/dist/tailwindcss/v4/config.d.ts +5 -0
- package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
- package/dist/tailwindcss/v4/index.d.ts +2 -0
- package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
- package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
- package/dist/tailwindcss/v4/patcher.d.ts +14 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
- package/dist/typedoc.export.d.ts +5 -0
- package/dist/types/base.d.ts +1 -0
- package/dist/types/disabled-options.d.ts +4 -0
- package/dist/types/index.d.ts +104 -0
- package/dist/types/shared.d.ts +7 -0
- package/dist/types/user-defined-options/general.d.ts +31 -0
- package/dist/types/user-defined-options/important.d.ts +37 -0
- package/dist/types/user-defined-options/index.d.ts +11 -0
- package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
- package/dist/types/user-defined-options/matcher.d.ts +9 -0
- package/dist/types.d.ts +1 -150
- package/dist/types.js +0 -1
- package/dist/types.mjs +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +19 -0
- package/dist/uni-app-x/index.d.ts +2 -0
- package/dist/uni-app-x/options.d.ts +12 -0
- package/dist/uni-app-x/style-isolation.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +9 -0
- package/dist/uni-app-x/vite.d.ts +36 -0
- package/dist/utils/decode.d.ts +2 -0
- package/dist/utils/disabled.d.ts +6 -0
- package/dist/utils/hbuilderx.d.ts +5 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/nameMatcher.d.ts +4 -0
- package/dist/utils/resolve-package.d.ts +1 -0
- package/dist/utils/uni-platform.d.ts +11 -0
- package/dist/utils-7DUGTFED.mjs +48 -0
- package/dist/utils-DmC9_In3.js +61 -0
- package/dist/vite-BHpAqldo.js +1952 -0
- package/dist/vite-C8JlHiyR.mjs +1940 -0
- package/dist/vite.d.ts +4 -17
- package/dist/vite.js +5 -14
- package/dist/vite.mjs +2 -14
- package/dist/weapp-tw-css-import-rewrite-loader.js +59 -92
- package/dist/weapp-tw-runtime-classset-loader.js +31 -50
- package/dist/webpack-CABjKGGQ.mjs +441 -0
- package/dist/webpack-DNIJ0ysE.js +456 -0
- package/dist/webpack.d.ts +4 -25
- package/dist/webpack.js +6 -17
- package/dist/webpack.mjs +2 -17
- package/dist/webpack4.d.ts +4 -26
- package/dist/webpack4.js +375 -481
- package/dist/webpack4.mjs +366 -482
- package/dist/wxml/Tokenizer.d.ts +15 -0
- package/dist/wxml/custom-attributes.d.ts +4 -0
- package/dist/wxml/index.d.ts +2 -0
- package/dist/wxml/shared.d.ts +2 -0
- package/dist/wxml/tokenizer/types.d.ts +18 -0
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
- package/dist/wxml/utils/codegen.d.ts +2 -0
- package/dist/wxml/utils/custom-template.d.ts +3 -0
- package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
- package/dist/wxml/utils/fragment-updater.d.ts +4 -0
- package/dist/wxml/utils/template-fragments.d.ts +3 -0
- package/dist/wxml/utils.d.ts +8 -0
- package/dist/wxml/whitespace.d.ts +2 -0
- package/generator-placeholder.css +1 -0
- package/package.json +19 -5
- package/dist/chunk-24AGZQVR.js +0 -183
- package/dist/chunk-3VQKDHGP.mjs +0 -179
- package/dist/chunk-4AFQP74Z.js +0 -24
- package/dist/chunk-57SOQCAU.mjs +0 -582
- package/dist/chunk-5ZYHNDEK.mjs +0 -2439
- package/dist/chunk-76S2EME4.mjs +0 -34
- package/dist/chunk-A5PB4KZT.js +0 -138
- package/dist/chunk-DUHYLR2R.js +0 -276
- package/dist/chunk-DYLQ6UOI.js +0 -71
- package/dist/chunk-E7I5TW5K.js +0 -52
- package/dist/chunk-FS2NOOEB.js +0 -292
- package/dist/chunk-HVNGIKLS.js +0 -3930
- package/dist/chunk-JZQBZHN5.js +0 -579
- package/dist/chunk-KGTVD4EP.mjs +0 -3930
- package/dist/chunk-NNOQDMUP.mjs +0 -10
- package/dist/chunk-OF6MFURR.js +0 -34
- package/dist/chunk-OFB2KBRP.js +0 -2442
- package/dist/chunk-OOHJLO5M.mjs +0 -71
- package/dist/chunk-PCDYXXSK.mjs +0 -1515
- package/dist/chunk-RKISS72P.js +0 -7
- package/dist/chunk-RRQZL7FQ.mjs +0 -292
- package/dist/chunk-XAKAD2CR.mjs +0 -138
- package/dist/chunk-XZP3MREK.mjs +0 -276
- package/dist/chunk-ZAA5ZG3D.js +0 -1518
- package/dist/chunk-ZCH4YINE.mjs +0 -52
- package/dist/cli.d.mts +0 -2
- package/dist/core.d.mts +0 -26
- package/dist/css-macro/postcss.d.mts +0 -7
- package/dist/css-macro.d.mts +0 -18
- package/dist/defaults.d.mts +0 -11
- package/dist/gulp.d.mts +0 -24
- package/dist/index-BXrmQelt.d.mts +0 -672
- package/dist/index-BXrmQelt.d.ts +0 -672
- package/dist/index.d.mts +0 -15
- package/dist/postcss-html-transform.d.mts +0 -2
- package/dist/presets.d.mts +0 -76
- package/dist/reset.d.mts +0 -1
- package/dist/types.d.mts +0 -150
- package/dist/vite.d.mts +0 -17
- package/dist/webpack.d.mts +0 -25
- package/dist/webpack4.d.mts +0 -26
package/dist/reset.d.ts
CHANGED
package/dist/reset.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_chunk = require("./chunk-8l464Juk.js");
|
|
6
|
+
let _weapp_tailwindcss_reset = require("@weapp-tailwindcss/reset");
|
|
7
|
+
_weapp_tailwindcss_reset = require_chunk.__toESM(_weapp_tailwindcss_reset);
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return _weapp_tailwindcss_reset.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "reset", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return _weapp_tailwindcss_reset.reset;
|
|
18
|
+
}
|
|
19
|
+
});
|
package/dist/reset.mjs
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
// src/reset/index.ts
|
|
4
|
-
import { default as default2, reset } from "@weapp-tailwindcss/reset";
|
|
5
|
-
export {
|
|
6
|
-
default2 as default,
|
|
7
|
-
reset
|
|
8
|
-
};
|
|
1
|
+
import reset_default, { reset } from "@weapp-tailwindcss/reset";
|
|
2
|
+
export { reset_default as default, reset };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IJsHandlerOptions } from '../types';
|
|
2
|
+
export type ClassNameTransformDecision = 'direct' | 'escaped' | 'fallback' | 'skip';
|
|
3
|
+
export interface ClassNameTransformResult {
|
|
4
|
+
decision: ClassNameTransformDecision;
|
|
5
|
+
escapedValue?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ResolveClassNameTransformOptions extends Pick<IJsHandlerOptions, 'alwaysEscape' | 'classNameSet' | 'escapeMap' | 'jsArbitraryValueFallback' | 'jsPreserveClass' | 'tailwindcssMajorVersion'> {
|
|
8
|
+
classContext?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function shouldEnableArbitraryValueFallback({ classNameSet, jsArbitraryValueFallback, tailwindcssMajorVersion, }: Pick<ResolveClassNameTransformOptions, 'classNameSet' | 'jsArbitraryValueFallback' | 'tailwindcssMajorVersion'>): boolean;
|
|
11
|
+
export declare function resolveClassNameTransformWithResult(candidate: string, { alwaysEscape, classNameSet, escapeMap, jsArbitraryValueFallback, jsPreserveClass, tailwindcssMajorVersion, classContext, }: ResolveClassNameTransformOptions): ClassNameTransformResult;
|
|
12
|
+
export declare function resolveClassNameTransformDecision(candidate: string, options: ResolveClassNameTransformOptions): ClassNameTransformDecision;
|
|
13
|
+
export declare function shouldTransformClassNameCandidate(candidate: string, options: ResolveClassNameTransformOptions): boolean;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AppType } from '../types';
|
|
2
|
+
export declare function isMpx(appType?: AppType): appType is "mpx";
|
|
3
|
+
export declare function getTailwindcssCssEntry(pkgDir: string): string;
|
|
4
|
+
export declare function ensureMpxTailwindcssAliases(compiler: any, pkgDir: string): string;
|
|
5
|
+
export declare function patchMpxLoaderResolve(loaderContext: any, pkgDir: string, enabled: boolean): void;
|
|
6
|
+
export declare function setupMpxTailwindcssRedirect(pkgDir: string, enabled: boolean): void;
|
|
7
|
+
export declare function injectMpxCssRewritePreRules(compiler: any, loader: string | undefined, loaderOptions: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installTailwindcssCssRedirect(pkgDir: string): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
+
import type { PackageJson } from 'pkg-types';
|
|
3
|
+
import { createTailwindcssPatcher } from './patcher';
|
|
4
|
+
declare function getTailwindcssPackageInfo(options?: PackageResolvingOptions): {
|
|
5
|
+
name: string;
|
|
6
|
+
version: string | undefined;
|
|
7
|
+
rootPath: string;
|
|
8
|
+
packageJsonPath: string;
|
|
9
|
+
packageJson: PackageJson;
|
|
10
|
+
} | undefined;
|
|
11
|
+
export { createTailwindcssPatcher, getTailwindcssPackageInfo, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function pruneMiniProgramGeneratedCss(css: string): string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
+
import type { ILengthUnitsPatchOptions, NormalizedTailwindCssPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
3
|
+
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
4
|
+
type ResolvedTailwindUserOptions = TailwindUserOptions | NormalizedTailwindCssPatchOptions['tailwind'];
|
|
5
|
+
type TailwindApplyOptions = NonNullable<TailwindCssPatchOptions['apply']>;
|
|
6
|
+
type TailwindExtractOptions = NonNullable<TailwindCssPatchOptions['extract']>;
|
|
7
|
+
type TailwindExtendLengthUnitsOption = TailwindApplyOptions['extendLengthUnits'];
|
|
8
|
+
export interface LegacyTailwindcssPatcherOptions {
|
|
9
|
+
cache?: boolean | {
|
|
10
|
+
enabled?: boolean;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
dir?: string;
|
|
13
|
+
file?: string;
|
|
14
|
+
strategy?: 'merge' | 'overwrite';
|
|
15
|
+
};
|
|
16
|
+
patch?: {
|
|
17
|
+
overwrite?: boolean;
|
|
18
|
+
basedir?: string;
|
|
19
|
+
cwd?: string;
|
|
20
|
+
filter?: (className: string) => boolean;
|
|
21
|
+
resolve?: PackageResolvingOptions;
|
|
22
|
+
tailwindcss?: TailwindUserOptions;
|
|
23
|
+
applyPatches?: {
|
|
24
|
+
exportContext?: boolean;
|
|
25
|
+
extendLengthUnits?: boolean | ILengthUnitsPatchOptions;
|
|
26
|
+
};
|
|
27
|
+
output?: {
|
|
28
|
+
filename?: string;
|
|
29
|
+
loose?: boolean;
|
|
30
|
+
removeUniversalSelector?: boolean;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface LegacyTailwindcssOutputOptions {
|
|
35
|
+
enabled?: boolean;
|
|
36
|
+
file?: string;
|
|
37
|
+
format?: TailwindExtractOptions['format'];
|
|
38
|
+
pretty?: TailwindExtractOptions['pretty'];
|
|
39
|
+
removeUniversalSelector?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface LegacyTailwindcssFeatureOptions {
|
|
42
|
+
exposeContext?: TailwindApplyOptions['exposeContext'];
|
|
43
|
+
extendLengthUnits?: boolean | ILengthUnitsPatchOptions | TailwindExtendLengthUnitsOption;
|
|
44
|
+
}
|
|
45
|
+
export type CompatTailwindCssPatchOptions = TailwindCssPatchOptions & {
|
|
46
|
+
cwd?: string;
|
|
47
|
+
overwrite?: boolean;
|
|
48
|
+
features?: LegacyTailwindcssFeatureOptions;
|
|
49
|
+
output?: LegacyTailwindcssOutputOptions;
|
|
50
|
+
tailwind?: ResolvedTailwindUserOptions;
|
|
51
|
+
};
|
|
52
|
+
export declare function resolveTailwindcssOptions(options?: CompatTailwindCssPatchOptions | LegacyTailwindcssPatcherOptions): ResolvedTailwindUserOptions | undefined;
|
|
53
|
+
export declare function normalizeExtendLengthUnits(value: boolean | ILengthUnitsPatchOptions | undefined): TailwindExtendLengthUnitsOption | undefined;
|
|
54
|
+
export declare function normalizeTailwindcssPatcherOptions(options?: CompatTailwindCssPatchOptions | LegacyTailwindcssPatcherOptions): TailwindCssPatchOptions | undefined;
|
|
55
|
+
export declare function toModernTailwindcssPatchOptions(options?: CompatTailwindCssPatchOptions): TailwindCssPatchOptions | undefined;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function resolveModuleFromPaths(specifier: string | undefined, paths: string[]): string | undefined;
|
|
2
|
+
export declare function resolveTailwindConfigFallback(packageName: string | undefined, paths: string[]): string | undefined;
|
|
3
|
+
export declare function findTailwindConfig(searchRoots: Iterable<string>): string | undefined;
|
|
4
|
+
export declare function createDefaultResolvePaths(basedir?: string): string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
2
|
+
import type { LegacyTailwindcssPatcherOptions } from './patcher-options';
|
|
3
|
+
import type { TailwindcssPatcherLike } from '../types';
|
|
4
|
+
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
5
|
+
export interface CreateTailwindcssPatcherOptions {
|
|
6
|
+
basedir?: string;
|
|
7
|
+
cacheDir?: string;
|
|
8
|
+
supportCustomLengthUnitsPatch?: boolean | ILengthUnitsPatchOptions;
|
|
9
|
+
tailwindcss?: TailwindUserOptions;
|
|
10
|
+
tailwindcssPatcherOptions?: TailwindCssPatchOptions | LegacyTailwindcssPatcherOptions;
|
|
11
|
+
}
|
|
12
|
+
export declare function createTailwindcssPatcher(options?: CreateTailwindcssPatcherOptions): TailwindcssPatcherLike;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PatchTargetRecorder, PatchTargetRecorderOptions } from './targets';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../types';
|
|
3
|
+
interface SetupPatchRecorderOptions extends PatchTargetRecorderOptions {
|
|
4
|
+
logMessage?: boolean;
|
|
5
|
+
messagePrefix?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PatchRecorderState {
|
|
8
|
+
recorder?: PatchTargetRecorder;
|
|
9
|
+
patchPromise: Promise<void>;
|
|
10
|
+
onPatchCompleted?: () => Promise<void> | void;
|
|
11
|
+
}
|
|
12
|
+
export declare function setupPatchRecorder(patcher: TailwindcssPatcherLike | undefined, baseDir: string | undefined, options?: SetupPatchRecorderOptions): PatchRecorderState;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
2
|
+
interface RuntimeClassSetCacheEntry {
|
|
3
|
+
value?: Set<string>;
|
|
4
|
+
promise?: Promise<Set<string>>;
|
|
5
|
+
signature?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const runtimeSignaturePatchersSymbol: unique symbol;
|
|
8
|
+
export declare function invalidateRuntimeClassSet(twPatcher?: TailwindcssPatcherLike): void;
|
|
9
|
+
export declare function getRuntimeClassSetCacheEntry(twPatcher: TailwindcssPatcherLike): RuntimeClassSetCacheEntry;
|
|
10
|
+
export declare function getRuntimeClassSetSignature(twPatcher: TailwindcssPatcherLike): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function logRuntimeTailwindcssTarget(baseDir?: string, rootPath?: string, version?: string): void;
|
|
2
|
+
export declare function logRuntimeTailwindcssVersion(baseDir?: string, rootPath?: string, version?: string): void;
|
|
3
|
+
export declare function __resetRuntimeTailwindcssLogsForTests(): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RefreshTailwindcssPatcherOptions, TailwindcssPatcherLike } from '../types';
|
|
2
|
+
import { invalidateRuntimeClassSet } from './runtime/cache';
|
|
3
|
+
export declare const refreshTailwindcssPatcherSymbol: unique symbol;
|
|
4
|
+
export interface CollectRuntimeClassSetOptions {
|
|
5
|
+
force?: boolean;
|
|
6
|
+
skipRefresh?: boolean;
|
|
7
|
+
clearCache?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface RefreshTailwindRuntimeStateOptions {
|
|
10
|
+
force: boolean;
|
|
11
|
+
clearCache?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function createTailwindPatchPromise(twPatcher: TailwindcssPatcherLike, onPatched?: () => Promise<void> | void): Promise<void>;
|
|
14
|
+
export interface TailwindRuntimeState {
|
|
15
|
+
twPatcher: TailwindcssPatcherLike;
|
|
16
|
+
patchPromise: Promise<void>;
|
|
17
|
+
refreshTailwindcssPatcher?: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
|
|
18
|
+
onPatchCompleted?: () => Promise<void> | void;
|
|
19
|
+
}
|
|
20
|
+
export declare function refreshTailwindRuntimeState(state: TailwindRuntimeState, forceOrOptions: boolean | RefreshTailwindRuntimeStateOptions): Promise<boolean>;
|
|
21
|
+
export interface EnsureRuntimeClassSetOptions {
|
|
22
|
+
forceRefresh?: boolean;
|
|
23
|
+
forceCollect?: boolean;
|
|
24
|
+
clearCache?: boolean;
|
|
25
|
+
allowEmpty?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function ensureRuntimeClassSet(state: TailwindRuntimeState, options?: EnsureRuntimeClassSetOptions): Promise<Set<string>>;
|
|
28
|
+
declare function collectRuntimeClassSet(twPatcher: TailwindcssPatcherLike, options?: CollectRuntimeClassSetOptions): Promise<Set<string>>;
|
|
29
|
+
export { collectRuntimeClassSet, invalidateRuntimeClassSet };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const PATCH_INFO_FILENAME = "tailwindcss-target.json";
|
|
2
|
+
export declare const PATCH_INFO_CACHE_RELATIVE_PATH: string;
|
|
3
|
+
export declare const PATCH_INFO_LEGACY_RELATIVE_PATH: string;
|
|
4
|
+
export declare function formatRelativeToBase(targetPath: string, baseDir?: string): string;
|
|
5
|
+
export declare function resolveRecordLocation(baseDir: string): {
|
|
6
|
+
normalizedBase: string;
|
|
7
|
+
packageRoot: string;
|
|
8
|
+
recordDir: string;
|
|
9
|
+
recordKey: string;
|
|
10
|
+
recordPath: string;
|
|
11
|
+
packageJsonPath: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare function getRecordFileCandidates(baseDir: string): string[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { PatchTargetRecordResult, SavePatchTargetRecordOptions } from './types';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
3
|
+
export declare function readPatchTargetRecord(baseDir?: string): PatchTargetRecordResult | undefined;
|
|
4
|
+
export declare function saveCliPatchTargetRecord(baseDir: string | undefined, patcher: TailwindcssPatcherLike | undefined, options?: SavePatchTargetRecordOptions): Promise<string | undefined>;
|
|
5
|
+
export declare function __resetPatchTargetRecordWarningsForTests(): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PatchTargetRecorder, PatchTargetRecorderOptions } from './types';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
3
|
+
export declare function createPatchTargetRecorder(baseDir: string | undefined, patcher: TailwindcssPatcherLike | undefined, options?: PatchTargetRecorderOptions): PatchTargetRecorder | undefined;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface PatchTargetRecord {
|
|
2
|
+
tailwindPackagePath: string;
|
|
3
|
+
packageVersion?: string;
|
|
4
|
+
recordedAt: string;
|
|
5
|
+
source: 'cli' | 'runtime' | string;
|
|
6
|
+
tailwindcssBasedir?: string;
|
|
7
|
+
cwd?: string;
|
|
8
|
+
patchVersion?: string;
|
|
9
|
+
packageJsonPath?: string;
|
|
10
|
+
recordKey?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface PatchTargetRecordResult {
|
|
13
|
+
baseDir: string;
|
|
14
|
+
path: string;
|
|
15
|
+
record: PatchTargetRecord;
|
|
16
|
+
}
|
|
17
|
+
export interface SavePatchTargetRecordOptions {
|
|
18
|
+
cwd?: string;
|
|
19
|
+
source?: 'cli' | 'runtime' | string;
|
|
20
|
+
recordPath?: string;
|
|
21
|
+
recordKey?: string;
|
|
22
|
+
packageJsonPath?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface PatchTargetRecorder {
|
|
25
|
+
recordPath: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
reason?: string;
|
|
28
|
+
onPatched: () => Promise<string | undefined>;
|
|
29
|
+
}
|
|
30
|
+
export interface PatchTargetRecorderOptions {
|
|
31
|
+
source?: 'cli' | 'runtime' | string;
|
|
32
|
+
cwd?: string;
|
|
33
|
+
recordTarget?: boolean;
|
|
34
|
+
alwaysRecord?: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TailwindcssPatcherLike } from '../types';
|
|
2
|
+
import { __resetPatchTargetRecordWarningsForTests, saveCliPatchTargetRecord } from './targets/record-io';
|
|
3
|
+
import { createPatchTargetRecorder } from './targets/recorder';
|
|
4
|
+
export type { PatchTargetRecorder, PatchTargetRecorderOptions, SavePatchTargetRecordOptions } from './targets/types';
|
|
5
|
+
export declare function logTailwindcssTarget(kind: 'cli' | 'runtime', patcher: TailwindcssPatcherLike | undefined, baseDir?: string): void;
|
|
6
|
+
export { __resetPatchTargetRecordWarningsForTests, createPatchTargetRecorder, saveCliPatchTargetRecord, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { createTailwindV3Engine } from './generator';
|
|
2
|
+
export { transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp } from './miniprogram';
|
|
3
|
+
export { resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, } from './source';
|
|
4
|
+
export type { TailwindV3CandidateSource, TailwindV3Engine, TailwindV3GenerateOptions, TailwindV3GenerateResult, TailwindV3GenerateTarget, TailwindV3ResolvedSource, TailwindV3SourceOptions, } from './types';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV3GenerateTarget } from './types';
|
|
3
|
+
export declare function transformTailwindV3CssToWeapp(css: string, options?: Partial<IStyleHandlerOptions>): Promise<string>;
|
|
4
|
+
export declare function transformTailwindV3CssByTarget(css: string, target: TailwindV3GenerateTarget, options?: Partial<IStyleHandlerOptions>): Promise<string>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TailwindV3ResolvedSource, TailwindV3SourceOptions } from './types';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
3
|
+
export declare function resolveTailwindV3Source(options?: TailwindV3SourceOptions): Promise<TailwindV3ResolvedSource>;
|
|
4
|
+
export declare function resolveTailwindV3SourceOptionsFromPatcher(patcher: TailwindcssPatcherLike): TailwindV3SourceOptions;
|
|
5
|
+
export declare function resolveTailwindV3SourceFromPatcher(patcher: TailwindcssPatcherLike): Promise<TailwindV3ResolvedSource>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { Config } from 'tailwindcss';
|
|
3
|
+
export type TailwindV3GenerateTarget = 'weapp' | 'web' | 'tailwind';
|
|
4
|
+
export interface TailwindV3CandidateSource {
|
|
5
|
+
content: string;
|
|
6
|
+
extension?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TailwindV3SourcePattern {
|
|
9
|
+
base: string;
|
|
10
|
+
pattern: string;
|
|
11
|
+
negated: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface TailwindV3SourceOptions {
|
|
14
|
+
projectRoot?: string;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
base?: string;
|
|
17
|
+
css?: string;
|
|
18
|
+
config?: string;
|
|
19
|
+
packageName?: string;
|
|
20
|
+
postcssPlugin?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TailwindV3ResolvedSource {
|
|
23
|
+
version: 3;
|
|
24
|
+
projectRoot: string;
|
|
25
|
+
cwd: string;
|
|
26
|
+
base: string;
|
|
27
|
+
css: string;
|
|
28
|
+
config?: string;
|
|
29
|
+
configObject?: Config;
|
|
30
|
+
dependencies: string[];
|
|
31
|
+
packageName: string;
|
|
32
|
+
postcssPlugin: string;
|
|
33
|
+
}
|
|
34
|
+
export interface TailwindV3GenerateOptions {
|
|
35
|
+
candidates?: Iterable<string>;
|
|
36
|
+
sources?: TailwindV3CandidateSource[];
|
|
37
|
+
target?: TailwindV3GenerateTarget;
|
|
38
|
+
styleOptions?: Partial<IStyleHandlerOptions>;
|
|
39
|
+
}
|
|
40
|
+
export interface TailwindV3GenerateResult {
|
|
41
|
+
css: string;
|
|
42
|
+
rawCss: string;
|
|
43
|
+
classSet: Set<string>;
|
|
44
|
+
rawCandidates: Set<string>;
|
|
45
|
+
dependencies: string[];
|
|
46
|
+
sources: TailwindV3SourcePattern[];
|
|
47
|
+
root: null;
|
|
48
|
+
target: TailwindV3GenerateTarget;
|
|
49
|
+
version: 3;
|
|
50
|
+
}
|
|
51
|
+
export interface TailwindV3Engine {
|
|
52
|
+
source: TailwindV3ResolvedSource;
|
|
53
|
+
validateCandidates: (candidates: Iterable<string>) => Promise<Set<string>>;
|
|
54
|
+
generate: (options?: TailwindV3GenerateOptions) => Promise<TailwindV3GenerateResult>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { InternalUserDefinedOptions, TailwindcssPatcherLike } from '../../types';
|
|
2
|
+
export declare const DEFAULT_CSS_CALC_CUSTOM_PROPERTIES: (string | RegExp)[];
|
|
3
|
+
export declare function normalizeCssEntriesConfig(entries: unknown): string[] | undefined;
|
|
4
|
+
export declare function warnMissingCssEntries(ctx: InternalUserDefinedOptions, patcher: TailwindcssPatcherLike | undefined): void;
|
|
5
|
+
export declare function applyV4CssCalcDefaults(cssCalc: InternalUserDefinedOptions['cssCalc'], patcher: TailwindcssPatcherLike | undefined): InternalUserDefinedOptions['cssCalc'];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function guessBasedirFromEntries(entries?: string[]): string | undefined;
|
|
2
|
+
export declare function normalizeCssEntries(entries: string[] | undefined, anchor: string): string[] | undefined;
|
|
3
|
+
export interface GroupCssEntriesOptions {
|
|
4
|
+
preferredBaseDir?: string;
|
|
5
|
+
workspaceRoot?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function groupCssEntriesByBase(entries: string[], options?: GroupCssEntriesOptions): Map<string, string[]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
2
|
+
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
3
|
+
export interface LegacyTailwindcssPatcherOptionsLike {
|
|
4
|
+
patch?: {
|
|
5
|
+
basedir?: string;
|
|
6
|
+
cwd?: string;
|
|
7
|
+
tailwindcss?: TailwindUserOptions & {
|
|
8
|
+
v4?: {
|
|
9
|
+
base?: string;
|
|
10
|
+
cssEntries?: string[];
|
|
11
|
+
sources?: Array<{
|
|
12
|
+
base?: string;
|
|
13
|
+
pattern: string;
|
|
14
|
+
negated?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
}
|
|
22
|
+
type TailwindcssPatcherOptionsForBase = TailwindCssPatchOptions | LegacyTailwindcssPatcherOptionsLike | undefined;
|
|
23
|
+
export declare function overrideTailwindcssPatcherOptionsForBase(options: TailwindcssPatcherOptionsForBase, baseDir: string, cssEntries: string[]): TailwindcssPatcherOptionsForBase;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
2
|
+
import type { CreateTailwindcssPatcherOptions } from '../patcher';
|
|
3
|
+
import type { InternalUserDefinedOptions, TailwindcssPatcherLike } from '../../types';
|
|
4
|
+
export { groupCssEntriesByBase, guessBasedirFromEntries, normalizeCssEntries } from './css-entries';
|
|
5
|
+
export { createMultiTailwindcssPatcher } from './multi-patcher';
|
|
6
|
+
type TailwindUserOptions = NonNullable<TailwindCssPatchOptions['tailwindcss']>;
|
|
7
|
+
export interface TailwindcssPatcherFactoryOptions {
|
|
8
|
+
tailwindcss?: TailwindUserOptions;
|
|
9
|
+
tailwindcssPatcherOptions?: CreateTailwindcssPatcherOptions['tailwindcssPatcherOptions'];
|
|
10
|
+
supportCustomLengthUnitsPatch: InternalUserDefinedOptions['supportCustomLengthUnitsPatch'];
|
|
11
|
+
appType: InternalUserDefinedOptions['appType'];
|
|
12
|
+
}
|
|
13
|
+
export declare function createPatcherForBase(baseDir: string, cssEntries: string[] | undefined, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike;
|
|
14
|
+
export declare function tryCreateMultiTailwindcssPatcher(groups: Map<string, string[]>, options: TailwindcssPatcherFactoryOptions): TailwindcssPatcherLike | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from 'tailwindcss-patch';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from './design-system';
|
|
2
|
+
export { createTailwindV4Engine } from './generator';
|
|
3
|
+
export { transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp } from './miniprogram';
|
|
4
|
+
export { resolveTailwindV4Source, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceOptionsFromPatcher, } from './source';
|
|
5
|
+
export type { TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateResult, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourceOptions, } from './types';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV4GenerateTarget } from './types';
|
|
3
|
+
export declare function transformTailwindV4CssToWeapp(css: string, options?: Partial<IStyleHandlerOptions>): Promise<string>;
|
|
4
|
+
export declare function transformTailwindV4CssByTarget(css: string, target: TailwindV4GenerateTarget, options?: Partial<IStyleHandlerOptions>): Promise<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TailwindV4SourceOptions } from './types';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
3
|
+
import { resolveTailwindV4SourceFromPatchOptions } from 'tailwindcss-patch';
|
|
4
|
+
export declare function resolveTailwindV4SourceOptionsFromPatcher(patcher: TailwindcssPatcherLike): TailwindV4SourceOptions;
|
|
5
|
+
export declare function resolveTailwindV4Source(options?: TailwindV4SourceOptions): Promise<import("tailwindcss-patch").TailwindV4ResolvedSource>;
|
|
6
|
+
export declare function resolveTailwindV4SourceFromPatcher(patcher: TailwindcssPatcherLike): Promise<import("tailwindcss-patch").TailwindV4ResolvedSource>;
|
|
7
|
+
export { resolveTailwindV4SourceFromPatchOptions };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { TailwindV4Engine as PatchTailwindV4Engine, TailwindV4GenerateOptions as PatchTailwindV4GenerateOptions, TailwindV4GenerateResult as PatchTailwindV4GenerateResult, TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4ResolvedSource, TailwindV4SourceOptions } from 'tailwindcss-patch';
|
|
3
|
+
export type TailwindV4GenerateTarget = 'weapp' | 'web' | 'tailwind';
|
|
4
|
+
export interface TailwindV4GenerateOptions extends PatchTailwindV4GenerateOptions {
|
|
5
|
+
target?: TailwindV4GenerateTarget;
|
|
6
|
+
styleOptions?: Partial<IStyleHandlerOptions>;
|
|
7
|
+
}
|
|
8
|
+
export interface TailwindV4GenerateResult extends Omit<PatchTailwindV4GenerateResult, 'css'> {
|
|
9
|
+
css: string;
|
|
10
|
+
rawCss: string;
|
|
11
|
+
target: TailwindV4GenerateTarget;
|
|
12
|
+
}
|
|
13
|
+
export interface TailwindV4Engine extends Omit<PatchTailwindV4Engine, 'generate'> {
|
|
14
|
+
source: TailwindV4ResolvedSource;
|
|
15
|
+
generate: (options?: TailwindV4GenerateOptions) => Promise<TailwindV4GenerateResult>;
|
|
16
|
+
}
|
|
17
|
+
export type { TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4ResolvedSource, TailwindV4SourceOptions, };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index';
|
|
2
|
+
export type { DisabledOptions } from './types/disabled-options';
|
|
3
|
+
export type { UserDefinedOptions } from './types/user-defined-options';
|
|
4
|
+
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssPatchOptions, TailwindV2Options, TailwindV3Options, TailwindV4Options, } from 'tailwindcss-patch';
|
|
5
|
+
export type TailwindcssPatchOptions = import('tailwindcss-patch').TailwindCssPatchOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ItemOrItemArray<T> = T | T[];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type { ParseError, ParserOptions } from '@babel/parser';
|
|
2
|
+
import type { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
3
|
+
import type { SourceMap } from 'magic-string';
|
|
4
|
+
import type { Document, Result as PostcssResult, Root } from 'postcss';
|
|
5
|
+
import type { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
6
|
+
import type { ICreateCacheReturnType } from '../cache';
|
|
7
|
+
import type { ItemOrItemArray } from './base';
|
|
8
|
+
import type { DisabledOptions } from './disabled-options';
|
|
9
|
+
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared';
|
|
10
|
+
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options';
|
|
11
|
+
type AsyncableMethod<T> = T extends (...args: infer A) => infer R ? (...args: A) => Promise<Awaited<R>> | Awaited<R> : never;
|
|
12
|
+
export type { DisabledOptions, UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
13
|
+
export type { CssPreflightOptions, IStyleHandlerOptions, ItemOrItemArray };
|
|
14
|
+
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities } from './shared';
|
|
15
|
+
export interface LinkedJsModuleResult {
|
|
16
|
+
code: string;
|
|
17
|
+
}
|
|
18
|
+
export interface JsHandlerResult {
|
|
19
|
+
code: string;
|
|
20
|
+
map?: SourceMap;
|
|
21
|
+
error?: ParseError;
|
|
22
|
+
linked?: Record<string, LinkedJsModuleResult>;
|
|
23
|
+
}
|
|
24
|
+
export interface TailwindcssPatcherLike {
|
|
25
|
+
packageInfo: TailwindcssPatcher['packageInfo'];
|
|
26
|
+
majorVersion?: TailwindcssPatcher['majorVersion'];
|
|
27
|
+
patch: TailwindcssPatcher['patch'];
|
|
28
|
+
getClassSet: AsyncableMethod<TailwindcssPatcher['getClassSet']>;
|
|
29
|
+
getClassSetSync?: TailwindcssPatcher['getClassSetSync'];
|
|
30
|
+
extract: TailwindcssPatcher['extract'];
|
|
31
|
+
collectContentTokens?: TailwindcssPatcher['collectContentTokens'];
|
|
32
|
+
options?: TailwindcssPatcher['options'];
|
|
33
|
+
}
|
|
34
|
+
export interface RefreshTailwindcssPatcherOptions {
|
|
35
|
+
clearCache?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface IJsHandlerOptions {
|
|
38
|
+
escapeMap?: Record<string, string>;
|
|
39
|
+
classNameSet?: Set<string>;
|
|
40
|
+
staleClassNameFallback?: boolean;
|
|
41
|
+
jsArbitraryValueFallback?: boolean | 'auto';
|
|
42
|
+
tailwindcssMajorVersion?: number;
|
|
43
|
+
arbitraryValues?: IArbitraryValues;
|
|
44
|
+
jsPreserveClass?: (keyword: string) => boolean | undefined;
|
|
45
|
+
needEscaped?: boolean;
|
|
46
|
+
generateMap?: boolean;
|
|
47
|
+
alwaysEscape?: boolean;
|
|
48
|
+
unescapeUnicode?: boolean;
|
|
49
|
+
babelParserOptions?: ParserOptions;
|
|
50
|
+
ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[];
|
|
51
|
+
ignoreCallExpressionIdentifiers?: (string | RegExp)[];
|
|
52
|
+
uniAppX?: boolean;
|
|
53
|
+
moduleSpecifierReplacements?: Record<string, string>;
|
|
54
|
+
wrapExpression?: boolean;
|
|
55
|
+
filename?: string;
|
|
56
|
+
moduleGraph?: JsModuleGraphOptions;
|
|
57
|
+
}
|
|
58
|
+
export interface JsHandler {
|
|
59
|
+
(rawSource: string, set?: Set<string>, options?: CreateJsHandlerOptions): JsHandlerResult;
|
|
60
|
+
}
|
|
61
|
+
export interface ICommonReplaceOptions {
|
|
62
|
+
keepEOL?: boolean;
|
|
63
|
+
escapeMap?: Record<string, string>;
|
|
64
|
+
}
|
|
65
|
+
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;
|
|
75
|
+
}
|
|
76
|
+
export type InternalUserDefinedOptions = Required<Omit<UserDefinedOptions, 'supportCustomLengthUnitsPatch' | 'customReplaceDictionary' | 'cache'> & {
|
|
77
|
+
supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | boolean;
|
|
78
|
+
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
79
|
+
styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise<PostcssResult<Root | Document>>;
|
|
80
|
+
jsHandler: JsHandler;
|
|
81
|
+
escapeMap: Record<string, string>;
|
|
82
|
+
customReplaceDictionary: Record<string, string>;
|
|
83
|
+
cache: ICreateCacheReturnType;
|
|
84
|
+
twPatcher: TailwindcssPatcherLike;
|
|
85
|
+
refreshTailwindcssPatcher: (options?: RefreshTailwindcssPatcherOptions) => Promise<TailwindcssPatcherLike>;
|
|
86
|
+
}>;
|
|
87
|
+
export type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
|
|
88
|
+
export interface IBaseWebpackPlugin {
|
|
89
|
+
options: InternalUserDefinedOptions;
|
|
90
|
+
appType?: AppType;
|
|
91
|
+
apply: (compiler: any) => void;
|
|
92
|
+
}
|
|
93
|
+
export interface InternalPatchResult {
|
|
94
|
+
dataTypes?: string;
|
|
95
|
+
processTailwindFeatures?: string;
|
|
96
|
+
plugin?: string;
|
|
97
|
+
}
|
|
98
|
+
export type CreateJsHandlerOptions = Omit<IJsHandlerOptions, 'classNameSet'>;
|
|
99
|
+
export interface JsModuleGraphOptions {
|
|
100
|
+
resolve: (specifier: string, importer: string) => string | undefined;
|
|
101
|
+
load: (id: string) => string | undefined;
|
|
102
|
+
filter?: (id: string, specifier: string, importer: string) => boolean;
|
|
103
|
+
maxDepth?: number;
|
|
104
|
+
}
|