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
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
//#region src/tailwindcss/patcher-options.ts
|
|
2
|
-
function resolveTailwindcssOptions(options) {
|
|
3
|
-
if (!options) return;
|
|
4
|
-
const compatOptions = options;
|
|
5
|
-
return compatOptions.tailwindcss ?? compatOptions.tailwind;
|
|
6
|
-
}
|
|
7
|
-
function normalizeExtendLengthUnits(value) {
|
|
8
|
-
if (value === false) return false;
|
|
9
|
-
if (value === true) return { enabled: true };
|
|
10
|
-
if (value && typeof value === "object") return {
|
|
11
|
-
enabled: true,
|
|
12
|
-
...value
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function normalizeTailwindcssPatcherOptions(options) {
|
|
16
|
-
if (!options) return;
|
|
17
|
-
if ("patch" in options) {
|
|
18
|
-
const { cache, patch } = options;
|
|
19
|
-
const normalized = {};
|
|
20
|
-
if (cache !== void 0) normalized.cache = cache;
|
|
21
|
-
const apply = {};
|
|
22
|
-
const extract = {};
|
|
23
|
-
if (patch?.overwrite !== void 0) apply.overwrite = patch.overwrite;
|
|
24
|
-
if (patch?.filter) normalized.filter = patch.filter;
|
|
25
|
-
const extendLengthUnits = normalizeExtendLengthUnits(patch?.applyPatches?.extendLengthUnits);
|
|
26
|
-
const exposeContext = patch?.applyPatches?.exportContext;
|
|
27
|
-
if (extendLengthUnits !== void 0 || exposeContext !== void 0) {
|
|
28
|
-
apply.exposeContext = exposeContext;
|
|
29
|
-
apply.extendLengthUnits = extendLengthUnits;
|
|
30
|
-
}
|
|
31
|
-
const cwd = patch?.cwd ?? patch?.basedir;
|
|
32
|
-
if (cwd) normalized.projectRoot = cwd;
|
|
33
|
-
const tailwindOptions = patch?.tailwindcss ? { ...patch.tailwindcss } : void 0;
|
|
34
|
-
const legacyResolve = patch?.resolve;
|
|
35
|
-
let nextTailwindOptions = tailwindOptions;
|
|
36
|
-
if (nextTailwindOptions?.version === 2 && !nextTailwindOptions.packageName) {
|
|
37
|
-
nextTailwindOptions = {
|
|
38
|
-
...nextTailwindOptions,
|
|
39
|
-
packageName: "@tailwindcss/postcss7-compat",
|
|
40
|
-
postcssPlugin: nextTailwindOptions.postcssPlugin
|
|
41
|
-
};
|
|
42
|
-
if (!nextTailwindOptions.postcssPlugin) nextTailwindOptions.postcssPlugin = "@tailwindcss/postcss7-compat";
|
|
43
|
-
}
|
|
44
|
-
if (nextTailwindOptions || legacyResolve) {
|
|
45
|
-
const resolveOptions = nextTailwindOptions?.resolve;
|
|
46
|
-
const mergedResolve = legacyResolve || resolveOptions ? {
|
|
47
|
-
...resolveOptions ?? {},
|
|
48
|
-
...legacyResolve ?? {}
|
|
49
|
-
} : void 0;
|
|
50
|
-
normalized.tailwindcss = {
|
|
51
|
-
...nextTailwindOptions ?? {},
|
|
52
|
-
...mergedResolve ? { resolve: mergedResolve } : {}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
if (patch?.output) {
|
|
56
|
-
if (patch.output.filename !== void 0) extract.file = patch.output.filename;
|
|
57
|
-
if (patch.output.loose !== void 0) extract.pretty = patch.output.loose ? 2 : false;
|
|
58
|
-
if (patch.output.removeUniversalSelector !== void 0) extract.removeUniversalSelector = patch.output.removeUniversalSelector;
|
|
59
|
-
}
|
|
60
|
-
if (Object.keys(apply).length > 0) normalized.apply = apply;
|
|
61
|
-
if (Object.keys(extract).length > 0) normalized.extract = extract;
|
|
62
|
-
return toModernTailwindcssPatchOptions(normalized);
|
|
63
|
-
}
|
|
64
|
-
return toModernTailwindcssPatchOptions(options);
|
|
65
|
-
}
|
|
66
|
-
function toModernTailwindcssPatchOptions(options) {
|
|
67
|
-
if (!options) return;
|
|
68
|
-
const normalized = {};
|
|
69
|
-
if (options.cache !== void 0) normalized.cache = options.cache;
|
|
70
|
-
if (options.filter) normalized.filter = options.filter;
|
|
71
|
-
const projectRoot = options.projectRoot ?? options.cwd;
|
|
72
|
-
if (projectRoot) normalized.projectRoot = projectRoot;
|
|
73
|
-
const tailwindcss = resolveTailwindcssOptions(options);
|
|
74
|
-
if (tailwindcss) normalized.tailwindcss = { ...tailwindcss };
|
|
75
|
-
const apply = { ...options.apply ?? {} };
|
|
76
|
-
if (apply.overwrite === void 0 && options.overwrite !== void 0) apply.overwrite = options.overwrite;
|
|
77
|
-
if (apply.exposeContext === void 0 && options.features?.exposeContext !== void 0) apply.exposeContext = options.features.exposeContext;
|
|
78
|
-
if (apply.extendLengthUnits === void 0 && options.features?.extendLengthUnits !== void 0) apply.extendLengthUnits = options.features.extendLengthUnits;
|
|
79
|
-
if (Object.keys(apply).length > 0) normalized.apply = apply;
|
|
80
|
-
const extract = { ...options.extract ?? {} };
|
|
81
|
-
if (options.output) {
|
|
82
|
-
if (extract.write === void 0 && options.output.enabled !== void 0) extract.write = options.output.enabled;
|
|
83
|
-
if (extract.file === void 0 && options.output.file !== void 0) extract.file = options.output.file;
|
|
84
|
-
if (extract.format === void 0 && options.output.format !== void 0) extract.format = options.output.format;
|
|
85
|
-
if (extract.pretty === void 0 && options.output.pretty !== void 0) extract.pretty = options.output.pretty;
|
|
86
|
-
if (extract.removeUniversalSelector === void 0 && options.output.removeUniversalSelector !== void 0) extract.removeUniversalSelector = options.output.removeUniversalSelector;
|
|
87
|
-
}
|
|
88
|
-
if (Object.keys(extract).length > 0) normalized.extract = extract;
|
|
89
|
-
return normalized;
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
Object.defineProperty(exports, "normalizeExtendLengthUnits", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function() {
|
|
95
|
-
return normalizeExtendLengthUnits;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
Object.defineProperty(exports, "normalizeTailwindcssPatcherOptions", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function() {
|
|
101
|
-
return normalizeTailwindcssPatcherOptions;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(exports, "resolveTailwindcssOptions", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function() {
|
|
107
|
-
return resolveTailwindcssOptions;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(exports, "toModernTailwindcssPatchOptions", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
get: function() {
|
|
113
|
-
return toModernTailwindcssPatchOptions;
|
|
114
|
-
}
|
|
115
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
//#region src/tailwindcss/patcher-options.ts
|
|
2
|
-
function resolveTailwindcssOptions(options) {
|
|
3
|
-
if (!options) return;
|
|
4
|
-
const compatOptions = options;
|
|
5
|
-
return compatOptions.tailwindcss ?? compatOptions.tailwind;
|
|
6
|
-
}
|
|
7
|
-
function normalizeExtendLengthUnits(value) {
|
|
8
|
-
if (value === false) return false;
|
|
9
|
-
if (value === true) return { enabled: true };
|
|
10
|
-
if (value && typeof value === "object") return {
|
|
11
|
-
enabled: true,
|
|
12
|
-
...value
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
function normalizeTailwindcssPatcherOptions(options) {
|
|
16
|
-
if (!options) return;
|
|
17
|
-
if ("patch" in options) {
|
|
18
|
-
const { cache, patch } = options;
|
|
19
|
-
const normalized = {};
|
|
20
|
-
if (cache !== void 0) normalized.cache = cache;
|
|
21
|
-
const apply = {};
|
|
22
|
-
const extract = {};
|
|
23
|
-
if (patch?.overwrite !== void 0) apply.overwrite = patch.overwrite;
|
|
24
|
-
if (patch?.filter) normalized.filter = patch.filter;
|
|
25
|
-
const extendLengthUnits = normalizeExtendLengthUnits(patch?.applyPatches?.extendLengthUnits);
|
|
26
|
-
const exposeContext = patch?.applyPatches?.exportContext;
|
|
27
|
-
if (extendLengthUnits !== void 0 || exposeContext !== void 0) {
|
|
28
|
-
apply.exposeContext = exposeContext;
|
|
29
|
-
apply.extendLengthUnits = extendLengthUnits;
|
|
30
|
-
}
|
|
31
|
-
const cwd = patch?.cwd ?? patch?.basedir;
|
|
32
|
-
if (cwd) normalized.projectRoot = cwd;
|
|
33
|
-
const tailwindOptions = patch?.tailwindcss ? { ...patch.tailwindcss } : void 0;
|
|
34
|
-
const legacyResolve = patch?.resolve;
|
|
35
|
-
let nextTailwindOptions = tailwindOptions;
|
|
36
|
-
if (nextTailwindOptions?.version === 2 && !nextTailwindOptions.packageName) {
|
|
37
|
-
nextTailwindOptions = {
|
|
38
|
-
...nextTailwindOptions,
|
|
39
|
-
packageName: "@tailwindcss/postcss7-compat",
|
|
40
|
-
postcssPlugin: nextTailwindOptions.postcssPlugin
|
|
41
|
-
};
|
|
42
|
-
if (!nextTailwindOptions.postcssPlugin) nextTailwindOptions.postcssPlugin = "@tailwindcss/postcss7-compat";
|
|
43
|
-
}
|
|
44
|
-
if (nextTailwindOptions || legacyResolve) {
|
|
45
|
-
const resolveOptions = nextTailwindOptions?.resolve;
|
|
46
|
-
const mergedResolve = legacyResolve || resolveOptions ? {
|
|
47
|
-
...resolveOptions ?? {},
|
|
48
|
-
...legacyResolve ?? {}
|
|
49
|
-
} : void 0;
|
|
50
|
-
normalized.tailwindcss = {
|
|
51
|
-
...nextTailwindOptions ?? {},
|
|
52
|
-
...mergedResolve ? { resolve: mergedResolve } : {}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
if (patch?.output) {
|
|
56
|
-
if (patch.output.filename !== void 0) extract.file = patch.output.filename;
|
|
57
|
-
if (patch.output.loose !== void 0) extract.pretty = patch.output.loose ? 2 : false;
|
|
58
|
-
if (patch.output.removeUniversalSelector !== void 0) extract.removeUniversalSelector = patch.output.removeUniversalSelector;
|
|
59
|
-
}
|
|
60
|
-
if (Object.keys(apply).length > 0) normalized.apply = apply;
|
|
61
|
-
if (Object.keys(extract).length > 0) normalized.extract = extract;
|
|
62
|
-
return toModernTailwindcssPatchOptions(normalized);
|
|
63
|
-
}
|
|
64
|
-
return toModernTailwindcssPatchOptions(options);
|
|
65
|
-
}
|
|
66
|
-
function toModernTailwindcssPatchOptions(options) {
|
|
67
|
-
if (!options) return;
|
|
68
|
-
const normalized = {};
|
|
69
|
-
if (options.cache !== void 0) normalized.cache = options.cache;
|
|
70
|
-
if (options.filter) normalized.filter = options.filter;
|
|
71
|
-
const projectRoot = options.projectRoot ?? options.cwd;
|
|
72
|
-
if (projectRoot) normalized.projectRoot = projectRoot;
|
|
73
|
-
const tailwindcss = resolveTailwindcssOptions(options);
|
|
74
|
-
if (tailwindcss) normalized.tailwindcss = { ...tailwindcss };
|
|
75
|
-
const apply = { ...options.apply ?? {} };
|
|
76
|
-
if (apply.overwrite === void 0 && options.overwrite !== void 0) apply.overwrite = options.overwrite;
|
|
77
|
-
if (apply.exposeContext === void 0 && options.features?.exposeContext !== void 0) apply.exposeContext = options.features.exposeContext;
|
|
78
|
-
if (apply.extendLengthUnits === void 0 && options.features?.extendLengthUnits !== void 0) apply.extendLengthUnits = options.features.extendLengthUnits;
|
|
79
|
-
if (Object.keys(apply).length > 0) normalized.apply = apply;
|
|
80
|
-
const extract = { ...options.extract ?? {} };
|
|
81
|
-
if (options.output) {
|
|
82
|
-
if (extract.write === void 0 && options.output.enabled !== void 0) extract.write = options.output.enabled;
|
|
83
|
-
if (extract.file === void 0 && options.output.file !== void 0) extract.file = options.output.file;
|
|
84
|
-
if (extract.format === void 0 && options.output.format !== void 0) extract.format = options.output.format;
|
|
85
|
-
if (extract.pretty === void 0 && options.output.pretty !== void 0) extract.pretty = options.output.pretty;
|
|
86
|
-
if (extract.removeUniversalSelector === void 0 && options.output.removeUniversalSelector !== void 0) extract.removeUniversalSelector = options.output.removeUniversalSelector;
|
|
87
|
-
}
|
|
88
|
-
if (Object.keys(extract).length > 0) normalized.extract = extract;
|
|
89
|
-
return normalized;
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
export { toModernTailwindcssPatchOptions as i, normalizeTailwindcssPatcherOptions as n, resolveTailwindcssOptions as r, normalizeExtendLengthUnits as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,13 +0,0 @@
|
|
|
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[];
|
|
@@ -1,5 +0,0 @@
|
|
|
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;
|
|
@@ -1,3 +0,0 @@
|
|
|
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;
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
}
|