weapp-tailwindcss 4.12.0-next.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/bin/weapp-tailwindcss.js +21 -1
- 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 +2517 -1544
- package/dist/cli.mjs +2493 -1524
- 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 -87
- package/dist/weapp-tw-runtime-classset-loader.js +33 -47
- 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 +379 -481
- package/dist/webpack4.mjs +370 -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 +28 -13
- package/scripts/postinstall.mjs +59 -0
- package/dist/chunk-2LH6PZH3.mjs +0 -51
- package/dist/chunk-4AFQP74Z.js +0 -24
- package/dist/chunk-5ONE75V7.js +0 -2381
- package/dist/chunk-76S2EME4.mjs +0 -34
- package/dist/chunk-A5PB4KZT.js +0 -138
- package/dist/chunk-AYJ4HLWZ.mjs +0 -1508
- package/dist/chunk-DYLQ6UOI.js +0 -71
- package/dist/chunk-F2CKKG6Q.mjs +0 -171
- package/dist/chunk-F5XJWJYO.mjs +0 -582
- package/dist/chunk-FMK6SFQQ.js +0 -276
- package/dist/chunk-GC7WXUOW.js +0 -3906
- package/dist/chunk-GD4SQMVF.mjs +0 -2378
- package/dist/chunk-GMKSBLNY.js +0 -175
- package/dist/chunk-HL3US2OT.mjs +0 -10
- package/dist/chunk-LVSUBDJC.js +0 -579
- package/dist/chunk-NIS74SI6.js +0 -1511
- package/dist/chunk-OF6MFURR.js +0 -34
- package/dist/chunk-ONLKZIRQ.js +0 -7
- package/dist/chunk-OOHJLO5M.mjs +0 -71
- package/dist/chunk-OYSABARD.js +0 -51
- package/dist/chunk-QNRJCEZN.mjs +0 -3906
- package/dist/chunk-UUJWDME4.mjs +0 -276
- package/dist/chunk-WSS26HZS.js +0 -292
- package/dist/chunk-XAKAD2CR.mjs +0 -138
- package/dist/chunk-ZR3KN3FG.mjs +0 -292
- 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/bin/weapp-tailwindcss.js
CHANGED
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const fs = require('node:fs')
|
|
3
3
|
const path = require('node:path')
|
|
4
|
+
const process = require('node:process')
|
|
5
|
+
|
|
6
|
+
function isInstallLifecycle() {
|
|
7
|
+
return process.env.npm_lifecycle_event === 'postinstall' || process.env.npm_lifecycle_event === 'prepare'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function isMissingRuntimeModuleError(error) {
|
|
11
|
+
return error && error.code === 'MODULE_NOT_FOUND'
|
|
12
|
+
}
|
|
4
13
|
|
|
5
14
|
const cliPath = path.resolve(__dirname, '../dist/cli.js')
|
|
6
15
|
if (fs.existsSync(cliPath)) {
|
|
7
|
-
|
|
16
|
+
try {
|
|
17
|
+
require(cliPath)
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (isInstallLifecycle() && isMissingRuntimeModuleError(error)) {
|
|
21
|
+
console.error('[weapp-tailwindcss] install lifecycle patch skipped because a runtime module is missing.')
|
|
22
|
+
console.error('Run `pnpm --filter weapp-tailwindcss build` before strict CLI validation.')
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
throw error
|
|
26
|
+
}
|
|
27
|
+
}
|
|
8
28
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CreateJsHandlerOptions, IStyleHandlerOptions, ITemplateHandlerOptions, UserDefinedOptions } from '../../types';
|
|
2
|
+
import stream from 'node:stream';
|
|
3
|
+
export declare function createPlugins(options?: UserDefinedOptions): {
|
|
4
|
+
transformWxss: (options?: Partial<IStyleHandlerOptions>) => stream.Transform;
|
|
5
|
+
transformWxml: (options?: Partial<ITemplateHandlerOptions>) => stream.Transform;
|
|
6
|
+
transformJs: (options?: Partial<CreateJsHandlerOptions>) => stream.Transform;
|
|
7
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CacheValue, HashMapKey, ICreateCacheReturnType } from '../../cache';
|
|
2
|
+
export interface ProcessCachedTaskOptions<TValue extends CacheValue> {
|
|
3
|
+
cache: ICreateCacheReturnType;
|
|
4
|
+
cacheKey: string;
|
|
5
|
+
hashKey?: HashMapKey;
|
|
6
|
+
rawSource?: string;
|
|
7
|
+
hash?: string;
|
|
8
|
+
readCache?: () => TValue | undefined;
|
|
9
|
+
applyResult: (value: TValue) => void | Promise<void>;
|
|
10
|
+
transform: () => Promise<{
|
|
11
|
+
result: TValue;
|
|
12
|
+
cacheValue?: CacheValue;
|
|
13
|
+
}>;
|
|
14
|
+
onCacheHit?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function processCachedTask<TValue extends CacheValue>({ cache, cacheKey, hashKey, rawSource, hash, readCache, applyResult, transform, onCacheHit, }: ProcessCachedTaskOptions<TValue>): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function removeUnsupportedMiniProgramAtRules(css: string): string;
|
|
2
|
+
export declare function removeUnsupportedAtSupports(css: string): string;
|
|
3
|
+
export declare function hoistTailwindPreflightBase(css: string): string;
|
|
4
|
+
export declare function finalizeMiniProgramCss(css: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppType } from '../../types';
|
|
2
|
+
export interface ResolveTailwindcssImportOptions {
|
|
3
|
+
join?: (base: string, subpath: string) => string;
|
|
4
|
+
appType?: AppType;
|
|
5
|
+
rootImport?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function resolveTailwindcssImport(specifier: string, pkgDir: string, options?: ResolveTailwindcssImportOptions): string | null;
|
|
8
|
+
export declare function rewriteTailwindcssImportsInCode(code: string, pkgDir: string, options?: ResolveTailwindcssImportOptions): string | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
+
import type { InternalUserDefinedOptions } from '../../types';
|
|
3
|
+
export interface GenerateCssByGeneratorOptions {
|
|
4
|
+
opts: InternalUserDefinedOptions;
|
|
5
|
+
runtimeState: {
|
|
6
|
+
twPatcher: InternalUserDefinedOptions['twPatcher'];
|
|
7
|
+
patchPromise: Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
runtime: Set<string>;
|
|
10
|
+
rawSource: string;
|
|
11
|
+
file: string;
|
|
12
|
+
cssHandlerOptions: IStyleHandlerOptions;
|
|
13
|
+
cssUserHandlerOptions: IStyleHandlerOptions;
|
|
14
|
+
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
15
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
16
|
+
}
|
|
17
|
+
export interface GenerateCssByGeneratorResult {
|
|
18
|
+
css: string;
|
|
19
|
+
target: string;
|
|
20
|
+
source: 'generator' | 'generator-forced';
|
|
21
|
+
}
|
|
22
|
+
export declare function createCssAppend(base: string, extra: string): string;
|
|
23
|
+
export declare function splitTailwindV4GeneratedCss(rawSource: string, rawTailwindCss: string): string | undefined;
|
|
24
|
+
export declare function removeTailwindGeneratedCssByBanner(rawSource: string): string | undefined;
|
|
25
|
+
export declare function stripTailwindBanner(css: string): string;
|
|
26
|
+
export declare function stripTailwindBanners(css: string): string;
|
|
27
|
+
export declare function stripGeneratorPlaceholderMarkers(css: string): string;
|
|
28
|
+
export declare function hasTailwindGeneratedCss(rawSource: string): boolean;
|
|
29
|
+
export declare function hasTailwindGeneratedCssMarkers(rawSource: string): boolean;
|
|
30
|
+
export declare function inheritLegacyUnitConvertedDeclarations(css: string, legacyCss: string): string;
|
|
31
|
+
export declare function removeTailwindSourceDirectives(rawSource: string): string;
|
|
32
|
+
export declare function hasTailwindSourceDirectives(rawSource: string): boolean;
|
|
33
|
+
export declare function resolveCssEntrySource(rawSource: string, base: string): {
|
|
34
|
+
css: string;
|
|
35
|
+
config: string | undefined;
|
|
36
|
+
configRequest: string | undefined;
|
|
37
|
+
base: string;
|
|
38
|
+
} | undefined;
|
|
39
|
+
export declare function resolveGeneratorSource(majorVersion: number | undefined, runtimeState: GenerateCssByGeneratorOptions['runtimeState'], rawSource: string, file: string, cssHandlerOptions: IStyleHandlerOptions): Promise<import("@/generator").TailwindV3ResolvedSource | import("tailwindcss-patch").TailwindV4ResolvedSource>;
|
|
40
|
+
export declare function isPureLocalCssImportWrapper(css: string): boolean;
|
|
41
|
+
export declare function generateCssByGenerator(options: GenerateCssByGeneratorOptions): Promise<GenerateCssByGeneratorResult | undefined>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function normalizeOutputPathKey(value: string): string;
|
|
2
|
+
export declare function stripQueryAndHash(specifier: string): string;
|
|
3
|
+
export declare function isResolvableSpecifier(specifier: string): boolean;
|
|
4
|
+
export declare function toAbsoluteOutputPath(fileName: string, outDir: string): string;
|
|
5
|
+
export declare function resolveOutputSpecifier(specifier: string, importer: string, outDir: string, hasOutput: (value: string) => boolean): string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { LinkedJsModuleResult } from '../../types';
|
|
3
|
+
export interface OutputEntry {
|
|
4
|
+
fileName: string;
|
|
5
|
+
output: OutputAsset | OutputChunk;
|
|
6
|
+
}
|
|
7
|
+
export declare function readOutputEntry(entry: OutputEntry): string | undefined;
|
|
8
|
+
export declare function isJavaScriptEntry(entry: OutputEntry): boolean;
|
|
9
|
+
export declare function createBundleModuleGraphOptions(outputDir: string, entries: Map<string, OutputEntry>): {
|
|
10
|
+
resolve(specifier: string, importer: string): string | undefined;
|
|
11
|
+
load(id: string): string | undefined;
|
|
12
|
+
filter(id: string): boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function applyLinkedResults(linked: Record<string, LinkedJsModuleResult> | undefined, entries: Map<string, OutputEntry>, onLinkedUpdate: (fileName: string, previous: string, next: string) => void, onApplied?: (entry: OutputEntry, code: string) => void): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { OutputEntry } from './bundle-entries';
|
|
3
|
+
import type { InternalUserDefinedOptions } from '../../types';
|
|
4
|
+
export type EntryType = 'html' | 'js' | 'css' | 'other';
|
|
5
|
+
export interface BundleStateEntry {
|
|
6
|
+
file: string;
|
|
7
|
+
output: OutputAsset | OutputChunk;
|
|
8
|
+
source: string;
|
|
9
|
+
type: EntryType;
|
|
10
|
+
}
|
|
11
|
+
export interface ProcessFileSets {
|
|
12
|
+
html: Set<string>;
|
|
13
|
+
js: Set<string>;
|
|
14
|
+
css: Set<string>;
|
|
15
|
+
}
|
|
16
|
+
export interface BundleSnapshot {
|
|
17
|
+
entries: BundleStateEntry[];
|
|
18
|
+
jsEntries: Map<string, OutputEntry>;
|
|
19
|
+
sourceHashByFile: Map<string, string>;
|
|
20
|
+
runtimeAffectingSignatureByFile: Map<string, string>;
|
|
21
|
+
runtimeAffectingHashByFile: Map<string, string>;
|
|
22
|
+
changedByType: Record<EntryType, Set<string>>;
|
|
23
|
+
runtimeAffectingChangedByType: Record<EntryType, Set<string>>;
|
|
24
|
+
processFiles: ProcessFileSets;
|
|
25
|
+
linkedImpactsByEntry: Map<string, Set<string>>;
|
|
26
|
+
}
|
|
27
|
+
export interface BundleBuildState {
|
|
28
|
+
iteration: number;
|
|
29
|
+
sourceHashByFile: Map<string, string>;
|
|
30
|
+
runtimeAffectingSignatureByFile: Map<string, string>;
|
|
31
|
+
runtimeAffectingHashByFile: Map<string, string>;
|
|
32
|
+
linkedByEntry: Map<string, Set<string>>;
|
|
33
|
+
dependentsByLinkedFile: Map<string, Set<string>>;
|
|
34
|
+
}
|
|
35
|
+
interface UpdateBundleBuildStateOptions {
|
|
36
|
+
incremental?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function createBundleBuildState(): BundleBuildState;
|
|
39
|
+
export declare function classifyBundleEntry(file: string, opts: InternalUserDefinedOptions): EntryType;
|
|
40
|
+
export declare function buildBundleSnapshot(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string, state: BundleBuildState, forceAll?: boolean): BundleSnapshot;
|
|
41
|
+
export declare function buildBundleSnapshotForBuild(bundle: Record<string, OutputAsset | OutputChunk>, opts: InternalUserDefinedOptions, outDir: string): BundleSnapshot;
|
|
42
|
+
export declare function updateBundleBuildState(state: BundleBuildState, snapshot: BundleSnapshot, linkedByEntry: Map<string, Set<string>>, options?: UpdateBundleBuildStateOptions): void;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { OutputAsset } from 'rollup';
|
|
2
|
+
import type { Plugin, ResolvedConfig } from 'vite';
|
|
3
|
+
import type { InternalUserDefinedOptions } from '../../types';
|
|
4
|
+
interface CssFinalizerContext {
|
|
5
|
+
opts: InternalUserDefinedOptions;
|
|
6
|
+
runtimeState: {
|
|
7
|
+
twPatcher: InternalUserDefinedOptions['twPatcher'];
|
|
8
|
+
patchPromise: Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
11
|
+
isCssAssetProcessed: (asset: OutputAsset, file?: string) => boolean;
|
|
12
|
+
markCssAssetProcessed: (asset: OutputAsset, file?: string) => void;
|
|
13
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
14
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
15
|
+
recordCssAssetResult?: (file: string, css: string) => void;
|
|
16
|
+
getRecordedGeneratorCandidates?: () => Set<string> | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare function createViteCssFinalizerOutputPlugin(context: CssFinalizerContext): Plugin;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
+
import type { ResolvedConfig } from 'vite';
|
|
3
|
+
import type { BundleSnapshot } from './bundle-state';
|
|
4
|
+
import type { InternalUserDefinedOptions } from '../../types';
|
|
5
|
+
interface GenerateBundleContext {
|
|
6
|
+
opts: InternalUserDefinedOptions;
|
|
7
|
+
runtimeState: {
|
|
8
|
+
twPatcher: InternalUserDefinedOptions['twPatcher'];
|
|
9
|
+
patchPromise: Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
12
|
+
ensureBundleRuntimeClassSet: (snapshot: BundleSnapshot, forceRefresh?: boolean) => Promise<Set<string>>;
|
|
13
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
14
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
15
|
+
markCssAssetProcessed?: (asset: OutputAsset, file?: string) => void;
|
|
16
|
+
recordCssAssetResult?: (file: string, css: string) => void;
|
|
17
|
+
recordGeneratorCandidates?: (candidates: Set<string>) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function createGenerateBundleHook(context: GenerateBundleContext): (_opt: unknown, bundle: Record<string, OutputAsset | OutputChunk>) => Promise<void>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BundleSnapshot } from './bundle-state';
|
|
2
|
+
import type { TailwindcssPatcherLike } from '../../types';
|
|
3
|
+
import { extractRawCandidatesWithPositions, extractValidCandidates } from 'tailwindcss-patch';
|
|
4
|
+
type ExtractValidCandidatesOptions = Parameters<typeof extractValidCandidates>[0];
|
|
5
|
+
type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & {
|
|
6
|
+
content?: string;
|
|
7
|
+
extension?: string;
|
|
8
|
+
};
|
|
9
|
+
type ExtractValidCandidatesFn = (options?: MemoryExtractValidCandidatesOptions) => Promise<string[]>;
|
|
10
|
+
type ExtractRawCandidateResult = Awaited<ReturnType<typeof extractRawCandidatesWithPositions>>;
|
|
11
|
+
type ExtractRawCandidatesFn = (content: string, extension?: string) => Promise<ExtractRawCandidateResult>;
|
|
12
|
+
export interface BundleRuntimeClassSetManager {
|
|
13
|
+
sync: (patcher: TailwindcssPatcherLike, snapshot: BundleSnapshot) => Promise<Set<string>>;
|
|
14
|
+
reset: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
interface CreateBundleRuntimeClassSetManagerOptions {
|
|
17
|
+
extractCandidates?: ExtractValidCandidatesFn;
|
|
18
|
+
extractRawCandidates?: ExtractRawCandidatesFn;
|
|
19
|
+
}
|
|
20
|
+
export declare function createBundleRuntimeClassSetManager(options?: CreateBundleRuntimeClassSetManagerOptions): BundleRuntimeClassSetManager;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { shouldSkipJsTransform as shouldSkipViteJsTransform } from '../../js/precheck';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface VueQuery {
|
|
2
|
+
vue?: boolean;
|
|
3
|
+
src?: string;
|
|
4
|
+
type?: 'script' | 'template' | 'style' | 'custom';
|
|
5
|
+
index?: number;
|
|
6
|
+
lang?: string;
|
|
7
|
+
raw?: boolean;
|
|
8
|
+
url?: boolean;
|
|
9
|
+
scoped?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function parseVueRequest(id: string): {
|
|
13
|
+
filename: string;
|
|
14
|
+
query: VueQuery;
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
import type { AppType } from '../../types';
|
|
3
|
+
interface RewriteCssImportsOptions {
|
|
4
|
+
appType?: AppType;
|
|
5
|
+
getAppType?: () => AppType | undefined;
|
|
6
|
+
shouldRewrite: boolean;
|
|
7
|
+
rootImport?: string;
|
|
8
|
+
weappTailwindcssDirPosix: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function createRewriteCssImportsPlugins(options: RewriteCssImportsOptions): Plugin[];
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ExistingRawSourceMap } from 'rollup';
|
|
2
|
+
import { cleanUrl } from '@weapp-tailwindcss/shared';
|
|
3
|
+
export declare function slash(p: string): string;
|
|
4
|
+
export declare const isWindows: boolean;
|
|
5
|
+
export declare const cssLangRE: RegExp;
|
|
6
|
+
export declare function isCSSRequest(request: string): boolean;
|
|
7
|
+
export declare function normalizePath(id: string): string;
|
|
8
|
+
export { cleanUrl };
|
|
9
|
+
export declare function formatPostcssSourceMap(rawMap: ExistingRawSourceMap, file: string): Promise<ExistingRawSourceMap>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AppType } from '../../../types';
|
|
2
|
+
export declare function getCacheKey(filename: string): string;
|
|
3
|
+
export declare function stripResourceQuery(resource?: string): string | undefined;
|
|
4
|
+
export declare function isCssLikeModuleResource(resource: string | undefined, cssMatcher: (file: string) => boolean, appType?: AppType): boolean;
|
|
5
|
+
export declare function hasLoaderEntry(entries: Array<{
|
|
6
|
+
loader?: string;
|
|
7
|
+
}>, target?: string): boolean;
|
|
8
|
+
interface ChunkLike {
|
|
9
|
+
id?: string | number | null;
|
|
10
|
+
name?: string;
|
|
11
|
+
hash?: string | null;
|
|
12
|
+
files?: Iterable<string> | Array<string>;
|
|
13
|
+
}
|
|
14
|
+
interface WebpackWatchChangeLike {
|
|
15
|
+
modifiedFiles?: Set<string>;
|
|
16
|
+
removedFiles?: Set<string>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createAssetHashByChunkMap(chunks: Iterable<ChunkLike>): Map<string, string>;
|
|
19
|
+
export declare function hasWatchChanges(compiler: WebpackWatchChangeLike): boolean;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack4';
|
|
2
|
+
import type { AppType, InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
interface SetupWebpackV4EmitHookOptions {
|
|
4
|
+
compiler: Compiler;
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
runtimeState: {
|
|
8
|
+
twPatcher: InternalUserDefinedOptions['twPatcher'];
|
|
9
|
+
patchPromise: Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function setupWebpackV4EmitHook(options: SetupWebpackV4EmitHookOptions): void;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack4';
|
|
2
|
+
import type { AppType, InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
interface SetupWebpackV4LoadersOptions {
|
|
4
|
+
compiler: Compiler;
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
weappTailwindcssPackageDir: string;
|
|
8
|
+
shouldRewriteCssImports: boolean;
|
|
9
|
+
runtimeLoaderPath?: string;
|
|
10
|
+
runtimeCssImportRewriteLoaderPath?: string;
|
|
11
|
+
getClassSetInLoader: () => Promise<void>;
|
|
12
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function setupWebpackV4Loaders(options: SetupWebpackV4LoadersOptions): void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack4';
|
|
2
|
+
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
3
|
+
export declare const weappTailwindcssPackageDir: string;
|
|
4
|
+
export declare class UnifiedWebpackPluginV4 implements IBaseWebpackPlugin {
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
constructor(options?: UserDefinedOptions);
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack';
|
|
2
|
+
import type { AppType, InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
interface SetupWebpackV5ProcessAssetsHookOptions {
|
|
4
|
+
compiler: Compiler;
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
runtimeState: {
|
|
8
|
+
twPatcher: InternalUserDefinedOptions['twPatcher'];
|
|
9
|
+
patchPromise: Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
getRuntimeRefreshRequirement: () => boolean;
|
|
12
|
+
refreshRuntimeMetadata: (force: boolean) => Promise<void>;
|
|
13
|
+
consumeRuntimeRefreshRequirement: () => void;
|
|
14
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function setupWebpackV5ProcessAssetsHook(options: SetupWebpackV5ProcessAssetsHookOptions): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack';
|
|
2
|
+
import type { AppType, InternalUserDefinedOptions } from '../../../types';
|
|
3
|
+
interface SetupWebpackV5LoadersOptions {
|
|
4
|
+
compiler: Compiler;
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
weappTailwindcssPackageDir: string;
|
|
8
|
+
shouldRewriteCssImports: boolean;
|
|
9
|
+
runtimeLoaderPath?: string;
|
|
10
|
+
runtimeCssImportRewriteLoaderPath?: string;
|
|
11
|
+
getClassSetInLoader: () => Promise<void>;
|
|
12
|
+
getRuntimeWatchDependencies: () => {
|
|
13
|
+
files: ReadonlySet<string>;
|
|
14
|
+
contexts: ReadonlySet<string>;
|
|
15
|
+
};
|
|
16
|
+
debug: (format: string, ...args: unknown[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function setupWebpackV5Loaders(options: SetupWebpackV5LoadersOptions): void;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Compiler } from 'webpack';
|
|
2
|
+
import type { AppType, IBaseWebpackPlugin, InternalUserDefinedOptions, UserDefinedOptions } from '../../../types';
|
|
3
|
+
export declare const weappTailwindcssPackageDir: string;
|
|
4
|
+
export declare class UnifiedWebpackPluginV5 implements IBaseWebpackPlugin {
|
|
5
|
+
options: InternalUserDefinedOptions;
|
|
6
|
+
appType?: AppType;
|
|
7
|
+
constructor(options?: UserDefinedOptions);
|
|
8
|
+
apply(compiler: Compiler): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BaseUnifiedPlugin/v5';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
import type { AppType } from '../../../types';
|
|
3
|
+
import { Buffer } from 'node:buffer';
|
|
4
|
+
interface CssImportRewriteLoaderOptions {
|
|
5
|
+
rewriteCssImports?: {
|
|
6
|
+
pkgDir: string;
|
|
7
|
+
appType?: AppType;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function transformCssImportRewriteSource(source: string | Buffer, options: CssImportRewriteLoaderOptions | undefined): string | Buffer<ArrayBufferLike>;
|
|
11
|
+
declare const WeappTwCssImportRewriteLoader: webpack.LoaderDefinitionFunction<CssImportRewriteLoaderOptions>;
|
|
12
|
+
export default WeappTwCssImportRewriteLoader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type webpack from 'webpack';
|
|
2
|
+
interface RuntimeClassSetLoaderOptions {
|
|
3
|
+
getClassSet?: () => void | Promise<void>;
|
|
4
|
+
getWatchDependencies?: () => RuntimeLoaderWatchDependencies | Promise<RuntimeLoaderWatchDependencies | void> | void;
|
|
5
|
+
}
|
|
6
|
+
interface RuntimeLoaderWatchDependencies {
|
|
7
|
+
files?: Iterable<string>;
|
|
8
|
+
contexts?: Iterable<string>;
|
|
9
|
+
}
|
|
10
|
+
declare const WeappTwRuntimeClassSetLoader: webpack.LoaderDefinitionFunction<RuntimeClassSetLoaderOptions>;
|
|
11
|
+
export default WeappTwRuntimeClassSetLoader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AppType } from '../../../types';
|
|
2
|
+
export interface LoaderEntry {
|
|
3
|
+
loader?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function createLoaderAnchorFinders(appType?: AppType): {
|
|
6
|
+
findRewriteAnchor: (entries: LoaderEntry[]) => number;
|
|
7
|
+
findClassSetAnchor: (entries: LoaderEntry[]) => number;
|
|
8
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Buffer } from 'node:buffer';
|
|
2
|
+
import type { sources } from 'webpack';
|
|
3
|
+
import { LRUCache } from 'lru-cache';
|
|
4
|
+
export interface HashMapValue {
|
|
5
|
+
hash: string;
|
|
6
|
+
changed: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type HashMapKey = string | number;
|
|
9
|
+
export type CacheValue = sources.Source | string;
|
|
10
|
+
export interface CacheProcessResult<T extends CacheValue> {
|
|
11
|
+
result: T;
|
|
12
|
+
cacheValue?: CacheValue;
|
|
13
|
+
}
|
|
14
|
+
export interface CacheProcessOptions<T extends CacheValue> {
|
|
15
|
+
key: string;
|
|
16
|
+
hashKey?: HashMapKey;
|
|
17
|
+
rawSource?: string | Buffer;
|
|
18
|
+
hash?: string;
|
|
19
|
+
resolveCache?: () => T | undefined;
|
|
20
|
+
transform: () => Promise<CacheProcessResult<T> | T>;
|
|
21
|
+
onCacheHit?: (value: T) => void | Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export interface ICreateCacheReturnType {
|
|
24
|
+
readonly hashMap: Map<HashMapKey, HashMapValue>;
|
|
25
|
+
readonly instance: LRUCache<string, CacheValue>;
|
|
26
|
+
hasHashKey: (key: HashMapKey) => boolean;
|
|
27
|
+
getHashValue: (key: HashMapKey) => HashMapValue | undefined;
|
|
28
|
+
setHashValue: (key: HashMapKey, value: HashMapValue) => Map<HashMapKey, HashMapValue>;
|
|
29
|
+
computeHash: (message: string | Buffer) => string;
|
|
30
|
+
get: <V extends CacheValue = sources.Source>(key: string) => V | undefined;
|
|
31
|
+
set: <V extends CacheValue = sources.Source>(key: string, value: V) => LRUCache<string, CacheValue>;
|
|
32
|
+
has: (key: string) => boolean;
|
|
33
|
+
calcHashValueChanged: (key: HashMapKey, hash: string) => ICreateCacheReturnType;
|
|
34
|
+
process: <T extends CacheValue>(options: CacheProcessOptions<T>) => Promise<T>;
|
|
35
|
+
}
|
|
36
|
+
declare function createCache(options?: boolean): ICreateCacheReturnType;
|
|
37
|
+
declare function initializeCache(cacheConfig?: boolean | ICreateCacheReturnType): ICreateCacheReturnType;
|
|
38
|
+
export { createCache, initializeCache };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { md5 as md5Hash } from '@weapp-tailwindcss/shared/node';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
Object.defineProperty(exports, "__toESM", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function() {
|
|
26
|
+
return __toESM;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CompatTailwindCssPatchOptions } from '../tailwindcss/patcher-options';
|
|
2
|
+
import type { UserDefinedOptions } from '../types';
|
|
3
|
+
export declare function resolveEntry(entry: string, cwd: string | undefined): string;
|
|
4
|
+
export declare function buildTailwindcssPatcherOptions(overrides: Partial<CompatTailwindCssPatchOptions> | undefined): CompatTailwindCssPatchOptions | undefined;
|
|
5
|
+
export declare function createCliContext(overrides: Partial<UserDefinedOptions> | undefined, resolvedCwd: string | undefined): Required<Omit<UserDefinedOptions, "supportCustomLengthUnitsPatch" | "customReplaceDictionary" | "cache"> & {
|
|
6
|
+
supportCustomLengthUnitsPatch: import("tailwindcss-patch").ILengthUnitsPatchOptions | boolean;
|
|
7
|
+
templateHandler: (rawSource: string, options?: import("@/types").ITemplateHandlerOptions) => Promise<string>;
|
|
8
|
+
styleHandler: (rawSource: string, options?: import("@weapp-tailwindcss/postcss").IStyleHandlerOptions) => Promise<import("postcss").Result<import("postcss").Root | import("postcss").Document>>;
|
|
9
|
+
jsHandler: import("@/types").JsHandler;
|
|
10
|
+
escapeMap: Record<string, string>;
|
|
11
|
+
customReplaceDictionary: Record<string, string>;
|
|
12
|
+
cache: import("../cache").ICreateCacheReturnType;
|
|
13
|
+
twPatcher: import("@/types").TailwindcssPatcherLike;
|
|
14
|
+
refreshTailwindcssPatcher: (options?: import("@/types").RefreshTailwindcssPatcherOptions) => Promise<import("@/types").TailwindcssPatcherLike>;
|
|
15
|
+
}>;
|
|
16
|
+
export declare function formatOutputPath(target: string, baseDir?: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type DoctorCheckStatus = 'ok' | 'warn' | 'error' | 'info';
|
|
2
|
+
export interface DoctorCheck {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
status: DoctorCheckStatus;
|
|
6
|
+
message: string;
|
|
7
|
+
suggestion?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DoctorReport {
|
|
10
|
+
cwd: string;
|
|
11
|
+
nodeVersion: string;
|
|
12
|
+
detected: {
|
|
13
|
+
packageManager?: string;
|
|
14
|
+
frameworks: string[];
|
|
15
|
+
tailwindcssVersion?: string;
|
|
16
|
+
weappTailwindcssVersion?: string;
|
|
17
|
+
};
|
|
18
|
+
summary: Record<DoctorCheckStatus, number>;
|
|
19
|
+
checks: DoctorCheck[];
|
|
20
|
+
}
|
|
21
|
+
export interface DoctorOptions {
|
|
22
|
+
cwd?: string;
|
|
23
|
+
nodeVersion?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface PackageJson {
|
|
26
|
+
dependencies?: Record<string, string>;
|
|
27
|
+
devDependencies?: Record<string, string>;
|
|
28
|
+
optionalDependencies?: Record<string, string>;
|
|
29
|
+
peerDependencies?: Record<string, string>;
|
|
30
|
+
packageManager?: string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DoctorOptions, DoctorReport } from './doctor/types';
|
|
2
|
+
export declare function createDoctorReport(options?: DoctorOptions): DoctorReport;
|
|
3
|
+
export declare function hasDoctorFailure(report: DoctorReport, strict?: boolean): boolean;
|
|
4
|
+
export declare function formatDoctorReport(report: DoctorReport): string;
|