weapp-tailwindcss 5.0.13 → 5.1.0
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.en.md +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +21 -9
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +0 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/types.d.ts +13 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +10 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +12 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +21 -18
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle.d.ts +3 -1
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -5
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +9 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -6
- package/dist/bundlers/vite/source-scan.d.ts +2 -2
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +24 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -11
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -2
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +10 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +124 -437
- package/dist/cli.mjs +120 -433
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +4 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-B0Z8yW7E.js → context-BHxLe743.js} +391 -153
- package/dist/{precheck-CRI90iL1.mjs → context-Mbzkek1q.mjs} +368 -137
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-C_J_kBpw.js → defaults-CVcKbXBG.js} +4 -15
- package/dist/{defaults-Bqx18S1f.mjs → defaults-ZElj1zKc.mjs} +5 -10
- package/dist/defaults.d.ts +1 -7
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-9rUz4Hcb.js +170 -0
- package/dist/generator-Dc4qaPmT.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-XT8Jc7lH.js → gulp-B_sdP6dx.js} +47 -87
- package/dist/{gulp-DfOQERcV.mjs → gulp-uM36oIJs.mjs} +40 -80
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DQIP_8qP.mjs → hmr-timing-BXMLsF4b.mjs} +1145 -842
- package/dist/{hmr-timing-BMftW7Us.js → hmr-timing-CogqkFaF.js} +1262 -881
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +9 -19
- package/dist/presets.mjs +8 -18
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-CKWeTEhv.js → source-candidate-scan-signature-2ybpptAK.js} +261 -19
- package/dist/{bundle-state-zQ2MrDdi.mjs → source-candidate-scan-signature-Cvb5z1ha.mjs} +187 -17
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +86 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +23 -6
- package/dist/tailwindcss/v4-engine/types.d.ts +8 -9
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-DHIYcqXT.js +1523 -0
- package/dist/tailwindcss-wyUHrfil.mjs +1418 -0
- package/dist/{transform-YmrmxuF3.js → transform-CQVOgmzM.js} +17 -17
- package/dist/{transform-DfcEjsZF.mjs → transform-tExdt40m.mjs} +2 -2
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +5 -3
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/v4-engine-CF9zt4Cw.mjs +2396 -0
- package/dist/v4-engine-D4ubP7N5.js +2778 -0
- package/dist/{vite-CXHVsHmX.js → vite-CP0ylSxZ.js} +1081 -542
- package/dist/{vite-DjI09vVN.mjs → vite-CPO83EhA.mjs} +916 -376
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5350 -4165
- package/dist/weapp-tw-runtime-classset-loader.js +15 -4
- package/dist/webpack-Bsek8VhR.js +2094 -0
- package/dist/webpack-BzqhJ8yK.mjs +2082 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +4 -5
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-CzpArpCL.js +0 -92
- package/dist/generator-ITLd7PTl.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-DTq3uYBK.mjs +0 -556
- package/dist/tailwindcss-DZEwT3C_.js +0 -613
- package/dist/v3-engine-2rrgylhn.js +0 -4686
- package/dist/v3-engine-C6eJ0YzK.mjs +0 -4272
- package/dist/webpack-BcPpnT90.mjs +0 -1184
- package/dist/webpack-CfkUkMXG.js +0 -1196
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import semver from "semver";
|
|
4
|
-
import * as tailwindcssPatch from "tailwindcss-patch";
|
|
5
|
-
import { createTailwindcssPatchCli, splitCandidateTokens } from "tailwindcss-patch";
|
|
6
4
|
import path from "node:path";
|
|
7
5
|
import { access, mkdir, writeFile } from "node:fs/promises";
|
|
8
6
|
import { logger } from "@weapp-tailwindcss/logger";
|
|
@@ -12,10 +10,11 @@ import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
|
12
10
|
import "@weapp-tailwindcss/shared";
|
|
13
11
|
import { constants, existsSync, readFileSync } from "node:fs";
|
|
14
12
|
import _createDebug from "debug";
|
|
13
|
+
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
15
14
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
16
15
|
import "micromatch";
|
|
17
|
-
import "tailwindcss-config";
|
|
18
16
|
import "fast-glob";
|
|
17
|
+
import "tailwindcss-config";
|
|
19
18
|
import _babelTraverse from "@babel/traverse";
|
|
20
19
|
import { parse } from "@babel/parser";
|
|
21
20
|
import MagicString from "magic-string";
|
|
@@ -49,367 +48,11 @@ function omitUndefined(value) {
|
|
|
49
48
|
return Object.fromEntries(definedEntries(value));
|
|
50
49
|
}
|
|
51
50
|
//#endregion
|
|
52
|
-
//#region src/tailwindcss/v4-engine/
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"300",
|
|
58
|
-
"400",
|
|
59
|
-
"500",
|
|
60
|
-
"600",
|
|
61
|
-
"700",
|
|
62
|
-
"800",
|
|
63
|
-
"900",
|
|
64
|
-
"950"
|
|
65
|
-
];
|
|
66
|
-
const TAILWIND_V3_COLOR_PALETTE = {
|
|
67
|
-
slate: [
|
|
68
|
-
"#f8fafc",
|
|
69
|
-
"#f1f5f9",
|
|
70
|
-
"#e2e8f0",
|
|
71
|
-
"#cbd5e1",
|
|
72
|
-
"#94a3b8",
|
|
73
|
-
"#64748b",
|
|
74
|
-
"#475569",
|
|
75
|
-
"#334155",
|
|
76
|
-
"#1e293b",
|
|
77
|
-
"#0f172a",
|
|
78
|
-
"#020617"
|
|
79
|
-
],
|
|
80
|
-
gray: [
|
|
81
|
-
"#f9fafb",
|
|
82
|
-
"#f3f4f6",
|
|
83
|
-
"#e5e7eb",
|
|
84
|
-
"#d1d5db",
|
|
85
|
-
"#9ca3af",
|
|
86
|
-
"#6b7280",
|
|
87
|
-
"#4b5563",
|
|
88
|
-
"#374151",
|
|
89
|
-
"#1f2937",
|
|
90
|
-
"#111827",
|
|
91
|
-
"#030712"
|
|
92
|
-
],
|
|
93
|
-
zinc: [
|
|
94
|
-
"#fafafa",
|
|
95
|
-
"#f4f4f5",
|
|
96
|
-
"#e4e4e7",
|
|
97
|
-
"#d4d4d8",
|
|
98
|
-
"#a1a1aa",
|
|
99
|
-
"#71717a",
|
|
100
|
-
"#52525b",
|
|
101
|
-
"#3f3f46",
|
|
102
|
-
"#27272a",
|
|
103
|
-
"#18181b",
|
|
104
|
-
"#09090b"
|
|
105
|
-
],
|
|
106
|
-
neutral: [
|
|
107
|
-
"#fafafa",
|
|
108
|
-
"#f5f5f5",
|
|
109
|
-
"#e5e5e5",
|
|
110
|
-
"#d4d4d4",
|
|
111
|
-
"#a3a3a3",
|
|
112
|
-
"#737373",
|
|
113
|
-
"#525252",
|
|
114
|
-
"#404040",
|
|
115
|
-
"#262626",
|
|
116
|
-
"#171717",
|
|
117
|
-
"#0a0a0a"
|
|
118
|
-
],
|
|
119
|
-
stone: [
|
|
120
|
-
"#fafaf9",
|
|
121
|
-
"#f5f5f4",
|
|
122
|
-
"#e7e5e4",
|
|
123
|
-
"#d6d3d1",
|
|
124
|
-
"#a8a29e",
|
|
125
|
-
"#78716c",
|
|
126
|
-
"#57534e",
|
|
127
|
-
"#44403c",
|
|
128
|
-
"#292524",
|
|
129
|
-
"#1c1917",
|
|
130
|
-
"#0c0a09"
|
|
131
|
-
],
|
|
132
|
-
red: [
|
|
133
|
-
"#fef2f2",
|
|
134
|
-
"#fee2e2",
|
|
135
|
-
"#fecaca",
|
|
136
|
-
"#fca5a5",
|
|
137
|
-
"#f87171",
|
|
138
|
-
"#ef4444",
|
|
139
|
-
"#dc2626",
|
|
140
|
-
"#b91c1c",
|
|
141
|
-
"#991b1b",
|
|
142
|
-
"#7f1d1d",
|
|
143
|
-
"#450a0a"
|
|
144
|
-
],
|
|
145
|
-
orange: [
|
|
146
|
-
"#fff7ed",
|
|
147
|
-
"#ffedd5",
|
|
148
|
-
"#fed7aa",
|
|
149
|
-
"#fdba74",
|
|
150
|
-
"#fb923c",
|
|
151
|
-
"#f97316",
|
|
152
|
-
"#ea580c",
|
|
153
|
-
"#c2410c",
|
|
154
|
-
"#9a3412",
|
|
155
|
-
"#7c2d12",
|
|
156
|
-
"#431407"
|
|
157
|
-
],
|
|
158
|
-
amber: [
|
|
159
|
-
"#fffbeb",
|
|
160
|
-
"#fef3c7",
|
|
161
|
-
"#fde68a",
|
|
162
|
-
"#fcd34d",
|
|
163
|
-
"#fbbf24",
|
|
164
|
-
"#f59e0b",
|
|
165
|
-
"#d97706",
|
|
166
|
-
"#b45309",
|
|
167
|
-
"#92400e",
|
|
168
|
-
"#78350f",
|
|
169
|
-
"#451a03"
|
|
170
|
-
],
|
|
171
|
-
yellow: [
|
|
172
|
-
"#fefce8",
|
|
173
|
-
"#fef9c3",
|
|
174
|
-
"#fef08a",
|
|
175
|
-
"#fde047",
|
|
176
|
-
"#facc15",
|
|
177
|
-
"#eab308",
|
|
178
|
-
"#ca8a04",
|
|
179
|
-
"#a16207",
|
|
180
|
-
"#854d0e",
|
|
181
|
-
"#713f12",
|
|
182
|
-
"#422006"
|
|
183
|
-
],
|
|
184
|
-
lime: [
|
|
185
|
-
"#f7fee7",
|
|
186
|
-
"#ecfccb",
|
|
187
|
-
"#d9f99d",
|
|
188
|
-
"#bef264",
|
|
189
|
-
"#a3e635",
|
|
190
|
-
"#84cc16",
|
|
191
|
-
"#65a30d",
|
|
192
|
-
"#4d7c0f",
|
|
193
|
-
"#3f6212",
|
|
194
|
-
"#365314",
|
|
195
|
-
"#1a2e05"
|
|
196
|
-
],
|
|
197
|
-
green: [
|
|
198
|
-
"#f0fdf4",
|
|
199
|
-
"#dcfce7",
|
|
200
|
-
"#bbf7d0",
|
|
201
|
-
"#86efac",
|
|
202
|
-
"#4ade80",
|
|
203
|
-
"#22c55e",
|
|
204
|
-
"#16a34a",
|
|
205
|
-
"#15803d",
|
|
206
|
-
"#166534",
|
|
207
|
-
"#14532d",
|
|
208
|
-
"#052e16"
|
|
209
|
-
],
|
|
210
|
-
emerald: [
|
|
211
|
-
"#ecfdf5",
|
|
212
|
-
"#d1fae5",
|
|
213
|
-
"#a7f3d0",
|
|
214
|
-
"#6ee7b7",
|
|
215
|
-
"#34d399",
|
|
216
|
-
"#10b981",
|
|
217
|
-
"#059669",
|
|
218
|
-
"#047857",
|
|
219
|
-
"#065f46",
|
|
220
|
-
"#064e3b",
|
|
221
|
-
"#022c22"
|
|
222
|
-
],
|
|
223
|
-
teal: [
|
|
224
|
-
"#f0fdfa",
|
|
225
|
-
"#ccfbf1",
|
|
226
|
-
"#99f6e4",
|
|
227
|
-
"#5eead4",
|
|
228
|
-
"#2dd4bf",
|
|
229
|
-
"#14b8a6",
|
|
230
|
-
"#0d9488",
|
|
231
|
-
"#0f766e",
|
|
232
|
-
"#115e59",
|
|
233
|
-
"#134e4a",
|
|
234
|
-
"#042f2e"
|
|
235
|
-
],
|
|
236
|
-
cyan: [
|
|
237
|
-
"#ecfeff",
|
|
238
|
-
"#cffafe",
|
|
239
|
-
"#a5f3fc",
|
|
240
|
-
"#67e8f9",
|
|
241
|
-
"#22d3ee",
|
|
242
|
-
"#06b6d4",
|
|
243
|
-
"#0891b2",
|
|
244
|
-
"#0e7490",
|
|
245
|
-
"#155e75",
|
|
246
|
-
"#164e63",
|
|
247
|
-
"#083344"
|
|
248
|
-
],
|
|
249
|
-
sky: [
|
|
250
|
-
"#f0f9ff",
|
|
251
|
-
"#e0f2fe",
|
|
252
|
-
"#bae6fd",
|
|
253
|
-
"#7dd3fc",
|
|
254
|
-
"#38bdf8",
|
|
255
|
-
"#0ea5e9",
|
|
256
|
-
"#0284c7",
|
|
257
|
-
"#0369a1",
|
|
258
|
-
"#075985",
|
|
259
|
-
"#0c4a6e",
|
|
260
|
-
"#082f49"
|
|
261
|
-
],
|
|
262
|
-
blue: [
|
|
263
|
-
"#eff6ff",
|
|
264
|
-
"#dbeafe",
|
|
265
|
-
"#bfdbfe",
|
|
266
|
-
"#93c5fd",
|
|
267
|
-
"#60a5fa",
|
|
268
|
-
"#3b82f6",
|
|
269
|
-
"#2563eb",
|
|
270
|
-
"#1d4ed8",
|
|
271
|
-
"#1e40af",
|
|
272
|
-
"#1e3a8a",
|
|
273
|
-
"#172554"
|
|
274
|
-
],
|
|
275
|
-
indigo: [
|
|
276
|
-
"#eef2ff",
|
|
277
|
-
"#e0e7ff",
|
|
278
|
-
"#c7d2fe",
|
|
279
|
-
"#a5b4fc",
|
|
280
|
-
"#818cf8",
|
|
281
|
-
"#6366f1",
|
|
282
|
-
"#4f46e5",
|
|
283
|
-
"#4338ca",
|
|
284
|
-
"#3730a3",
|
|
285
|
-
"#312e81",
|
|
286
|
-
"#1e1b4b"
|
|
287
|
-
],
|
|
288
|
-
violet: [
|
|
289
|
-
"#f5f3ff",
|
|
290
|
-
"#ede9fe",
|
|
291
|
-
"#ddd6fe",
|
|
292
|
-
"#c4b5fd",
|
|
293
|
-
"#a78bfa",
|
|
294
|
-
"#8b5cf6",
|
|
295
|
-
"#7c3aed",
|
|
296
|
-
"#6d28d9",
|
|
297
|
-
"#5b21b6",
|
|
298
|
-
"#4c1d95",
|
|
299
|
-
"#2e1065"
|
|
300
|
-
],
|
|
301
|
-
purple: [
|
|
302
|
-
"#faf5ff",
|
|
303
|
-
"#f3e8ff",
|
|
304
|
-
"#e9d5ff",
|
|
305
|
-
"#d8b4fe",
|
|
306
|
-
"#c084fc",
|
|
307
|
-
"#a855f7",
|
|
308
|
-
"#9333ea",
|
|
309
|
-
"#7e22ce",
|
|
310
|
-
"#6b21a8",
|
|
311
|
-
"#581c87",
|
|
312
|
-
"#3b0764"
|
|
313
|
-
],
|
|
314
|
-
fuchsia: [
|
|
315
|
-
"#fdf4ff",
|
|
316
|
-
"#fae8ff",
|
|
317
|
-
"#f5d0fe",
|
|
318
|
-
"#f0abfc",
|
|
319
|
-
"#e879f9",
|
|
320
|
-
"#d946ef",
|
|
321
|
-
"#c026d3",
|
|
322
|
-
"#a21caf",
|
|
323
|
-
"#86198f",
|
|
324
|
-
"#701a75",
|
|
325
|
-
"#4a044e"
|
|
326
|
-
],
|
|
327
|
-
pink: [
|
|
328
|
-
"#fdf2f8",
|
|
329
|
-
"#fce7f3",
|
|
330
|
-
"#fbcfe8",
|
|
331
|
-
"#f9a8d4",
|
|
332
|
-
"#f472b6",
|
|
333
|
-
"#ec4899",
|
|
334
|
-
"#db2777",
|
|
335
|
-
"#be185d",
|
|
336
|
-
"#9d174d",
|
|
337
|
-
"#831843",
|
|
338
|
-
"#500724"
|
|
339
|
-
],
|
|
340
|
-
rose: [
|
|
341
|
-
"#fff1f2",
|
|
342
|
-
"#ffe4e6",
|
|
343
|
-
"#fecdd3",
|
|
344
|
-
"#fda4af",
|
|
345
|
-
"#fb7185",
|
|
346
|
-
"#f43f5e",
|
|
347
|
-
"#e11d48",
|
|
348
|
-
"#be123c",
|
|
349
|
-
"#9f1239",
|
|
350
|
-
"#881337",
|
|
351
|
-
"#4c0519"
|
|
352
|
-
]
|
|
353
|
-
};
|
|
354
|
-
function createTailwindV3DefaultColorThemeCss() {
|
|
355
|
-
const declarations = [" --color-black: #000;", " --color-white: #fff;"];
|
|
356
|
-
for (const [color, values] of Object.entries(TAILWIND_V3_COLOR_PALETTE)) for (let index = 0; index < TAILWIND_V3_COLOR_STEPS.length; index++) declarations.push(` --color-${color}-${TAILWIND_V3_COLOR_STEPS[index]}: ${values[index]};`);
|
|
357
|
-
return [
|
|
358
|
-
"@theme {",
|
|
359
|
-
...declarations,
|
|
360
|
-
"}"
|
|
361
|
-
].join("\n");
|
|
362
|
-
}
|
|
363
|
-
[
|
|
364
|
-
"@theme {",
|
|
365
|
-
" --default-ring-width: 3px;",
|
|
366
|
-
" --default-ring-color: var(--color-blue-500, #3b82f6);",
|
|
367
|
-
" --default-outline-width: 3px;",
|
|
368
|
-
"",
|
|
369
|
-
" --shadow-xs: 0 1px rgb(0 0 0 / 0.05);",
|
|
370
|
-
" --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);",
|
|
371
|
-
" --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);",
|
|
372
|
-
" --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / 0.05);",
|
|
373
|
-
" --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.15);",
|
|
374
|
-
" --drop-shadow: 0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06);",
|
|
375
|
-
"",
|
|
376
|
-
" --blur-xs: 4px;",
|
|
377
|
-
" --blur-sm: 4px;",
|
|
378
|
-
" --blur: 8px;",
|
|
379
|
-
" --backdrop-blur-xs: 4px;",
|
|
380
|
-
" --backdrop-blur-sm: 4px;",
|
|
381
|
-
" --backdrop-blur: 8px;",
|
|
382
|
-
"",
|
|
383
|
-
" --radius-xs: 0.125rem;",
|
|
384
|
-
" --radius-sm: 0.125rem;",
|
|
385
|
-
" --radius: 0.25rem;",
|
|
386
|
-
"}",
|
|
387
|
-
createTailwindV3DefaultColorThemeCss()
|
|
388
|
-
].join("\n");
|
|
389
|
-
[
|
|
390
|
-
"*,",
|
|
391
|
-
"::after,",
|
|
392
|
-
"::before,",
|
|
393
|
-
"::backdrop,",
|
|
394
|
-
"::file-selector-button {",
|
|
395
|
-
" border-color: var(--color-gray-200, currentcolor);",
|
|
396
|
-
"}",
|
|
397
|
-
"",
|
|
398
|
-
"input::placeholder,",
|
|
399
|
-
"textarea::placeholder {",
|
|
400
|
-
" opacity: 1;",
|
|
401
|
-
" color: var(--color-gray-400, currentcolor);",
|
|
402
|
-
"}",
|
|
403
|
-
"",
|
|
404
|
-
"button:not(:disabled),",
|
|
405
|
-
"[role=\"button\"]:not(:disabled) {",
|
|
406
|
-
" cursor: pointer;",
|
|
407
|
-
"}",
|
|
408
|
-
"",
|
|
409
|
-
"dialog {",
|
|
410
|
-
" margin: auto;",
|
|
411
|
-
"}"
|
|
412
|
-
].join("\n");
|
|
51
|
+
//#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
|
|
52
|
+
const RPX_LENGTH_UTILITY_PATTERN = String.raw`text|border(?:-[trblxyse])?|bg|outline|ring`;
|
|
53
|
+
new RegExp(String.raw`(^|:)(!?)(${RPX_LENGTH_UTILITY_PATTERN})-\[([-+]?(?:\d+|\d*\.\d+)rpx)\](.*)$`, "u");
|
|
54
|
+
new RegExp(String.raw`(?:^|:)!?(${RPX_LENGTH_UTILITY_PATTERN})-\[length:([-+]?(?:\d+|\d*\.\d+)rpx)\].*$`, "u");
|
|
55
|
+
new RegExp(String.raw`(${RPX_LENGTH_UTILITY_PATTERN})-\\\[length\\:((?:\\[.+-]|[+\-.\d])+rpx)\\\]`, "g");
|
|
413
56
|
//#endregion
|
|
414
57
|
//#region src/tailwindcss/source-scan.ts
|
|
415
58
|
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
@@ -480,33 +123,17 @@ createStyleHandler({
|
|
|
480
123
|
});
|
|
481
124
|
//#endregion
|
|
482
125
|
//#region src/tailwindcss/v4-engine/generator.ts
|
|
483
|
-
const INCREMENTAL_GENERATE_CACHE_MAX
|
|
126
|
+
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
484
127
|
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
485
|
-
new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX
|
|
128
|
+
new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
486
129
|
new LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
487
130
|
createRequire(import.meta.url);
|
|
488
|
-
createStyleHandler({
|
|
489
|
-
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
490
|
-
cssRemoveHoverPseudoClass: true,
|
|
491
|
-
isMainChunk: true,
|
|
492
|
-
majorVersion: 3
|
|
493
|
-
});
|
|
494
|
-
new LRUCache({ max: 8 });
|
|
495
|
-
typeof tailwindcssPatch.generateTailwindV3RawStyle === "function" && tailwindcssPatch.generateTailwindV3RawStyle;
|
|
496
|
-
[
|
|
497
|
-
"@tailwind base;",
|
|
498
|
-
"@tailwind components;",
|
|
499
|
-
"@tailwind utilities;"
|
|
500
|
-
].join("\n");
|
|
501
|
-
createDebug("[tailwindcss:runtime-patch] ");
|
|
502
|
-
createRequire(import.meta.url);
|
|
503
131
|
createDebug("[tailwindcss:runtime] ");
|
|
504
132
|
//#endregion
|
|
505
133
|
//#region src/tailwindcss/runtime-logs.ts
|
|
506
134
|
const runtimeLogDedupeHolder = globalThis;
|
|
507
135
|
runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ ?? (runtimeLogDedupeHolder.__WEAPP_TW_RUNTIME_LOG_DEDUPE__ = /* @__PURE__ */ new Set());
|
|
508
|
-
|
|
509
|
-
//#region src/context/compiler-context-cache.ts
|
|
136
|
+
createRequire(import.meta.url);
|
|
510
137
|
const globalCacheHolder = globalThis;
|
|
511
138
|
globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ ?? (globalCacheHolder.__WEAPP_TW_COMPILER_CONTEXT_CACHE__ = /* @__PURE__ */ new Map());
|
|
512
139
|
//#endregion
|
|
@@ -863,6 +490,19 @@ function hasIgnoreComment(node) {
|
|
|
863
490
|
}
|
|
864
491
|
return false;
|
|
865
492
|
}
|
|
493
|
+
function isConditionTestLiteral(path) {
|
|
494
|
+
let current = path;
|
|
495
|
+
while (current?.parentPath) {
|
|
496
|
+
const parent = current.parentPath;
|
|
497
|
+
if (parent.isConditionalExpression()) return parent.node.test === current.node;
|
|
498
|
+
if (parent.isBinaryExpression() || parent.isCallExpression() || parent.isLogicalExpression() || parent.isMemberExpression() || parent.isUnaryExpression()) {
|
|
499
|
+
current = parent;
|
|
500
|
+
continue;
|
|
501
|
+
}
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
|
+
return false;
|
|
505
|
+
}
|
|
866
506
|
function extractLiteralValue(path, { unescapeUnicode }) {
|
|
867
507
|
const { node } = path;
|
|
868
508
|
let offset = 0;
|
|
@@ -928,6 +568,7 @@ function replaceHandleValue(path, options) {
|
|
|
928
568
|
const fallbackEnabled = shouldEnableArbitraryValueFallback(options);
|
|
929
569
|
if (!alwaysEscape && !fallbackEnabled && (!classNameSet || classNameSet.size === 0)) return;
|
|
930
570
|
if (hasIgnoreComment(path.node)) return;
|
|
571
|
+
if (isConditionTestLiteral(path)) return;
|
|
931
572
|
const { literal, original, offset } = extractLiteralValue(path, options);
|
|
932
573
|
const candidates = splitCandidateTokens(literal);
|
|
933
574
|
if (candidates.length === 0) return;
|
|
@@ -1942,6 +1583,7 @@ function jsHandler(rawSource, options) {
|
|
|
1942
1583
|
return result;
|
|
1943
1584
|
}
|
|
1944
1585
|
defaultEvalHandler = jsHandler;
|
|
1586
|
+
createRequire(import.meta.url);
|
|
1945
1587
|
Object.freeze({ wrapExpression: true });
|
|
1946
1588
|
//#endregion
|
|
1947
1589
|
//#region src/wxml/whitespace.ts
|
|
@@ -2126,8 +1768,7 @@ const FRAMEWORK_DEPS = [
|
|
|
2126
1768
|
["@tarojs/taro", "Taro"],
|
|
2127
1769
|
["@dcloudio/uni-app", "uni-app"],
|
|
2128
1770
|
["@mpxjs/core", "MPX"],
|
|
2129
|
-
["remax", "Remax"]
|
|
2130
|
-
["rax", "Rax"]
|
|
1771
|
+
["remax", "Remax"]
|
|
2131
1772
|
];
|
|
2132
1773
|
//#endregion
|
|
2133
1774
|
//#region src/cli/doctor.ts
|
|
@@ -2277,7 +1918,7 @@ function createDoctorReport(options = {}) {
|
|
|
2277
1918
|
title: "Tailwind 配置",
|
|
2278
1919
|
status: tailwindMajor === 4 ? "info" : "warn",
|
|
2279
1920
|
message: "未检测到 tailwind.config.*。",
|
|
2280
|
-
suggestion: tailwindMajor === 4 ? "Tailwind CSS v4 可以采用 CSS-first
|
|
1921
|
+
suggestion: tailwindMajor === 4 ? "Tailwind CSS v4 可以采用 CSS-first 配置;复杂 content/source 场景请补充配置文件。" : "请确认 Tailwind content/source 配置能够覆盖小程序页面、组件和脚本文件。"
|
|
2281
1922
|
});
|
|
2282
1923
|
addCheck(checks, postcssConfig ? {
|
|
2283
1924
|
id: "postcss-config",
|
|
@@ -2307,7 +1948,7 @@ function createDoctorReport(options = {}) {
|
|
|
2307
1948
|
id: "framework",
|
|
2308
1949
|
title: "框架识别",
|
|
2309
1950
|
status: "info",
|
|
2310
|
-
message: "未从依赖中识别出 Taro、uni-app、MPX
|
|
1951
|
+
message: "未从依赖中识别出 Taro、uni-app、MPX 或 Remax。"
|
|
2311
1952
|
});
|
|
2312
1953
|
addCheck(checks, viteConfig || webpackConfig ? {
|
|
2313
1954
|
id: "bundler-config",
|
|
@@ -2393,7 +2034,7 @@ function resolveCliCwd(value) {
|
|
|
2393
2034
|
async function ensureDir(dir) {
|
|
2394
2035
|
await mkdir(dir, { recursive: true });
|
|
2395
2036
|
}
|
|
2396
|
-
function handleCliError
|
|
2037
|
+
function handleCliError(error) {
|
|
2397
2038
|
if (error instanceof Error) {
|
|
2398
2039
|
logger.error(error.message);
|
|
2399
2040
|
if (error.stack && process.env["WEAPP_TW_DEBUG"] === "1") logger.error(error.stack);
|
|
@@ -2404,7 +2045,7 @@ function commandAction(handler) {
|
|
|
2404
2045
|
try {
|
|
2405
2046
|
await handler(...args);
|
|
2406
2047
|
} catch (error) {
|
|
2407
|
-
handleCliError
|
|
2048
|
+
handleCliError(error);
|
|
2408
2049
|
process.exitCode = 1;
|
|
2409
2050
|
}
|
|
2410
2051
|
};
|
|
@@ -2412,27 +2053,7 @@ function commandAction(handler) {
|
|
|
2412
2053
|
//#endregion
|
|
2413
2054
|
//#region src/cli/mount-options.ts
|
|
2414
2055
|
const PATCH_COMMAND_OBSOLETE_NOTICE = "提示:weapp-tailwindcss@5 已由构建运行时接管 Tailwind CSS 处理,weapp-tw patch 已无需执行;请移除 package.json 中的 postinstall 钩子。";
|
|
2415
|
-
|
|
2416
|
-
logger.warn(PATCH_COMMAND_OBSOLETE_NOTICE);
|
|
2417
|
-
}
|
|
2418
|
-
function handleCliError(error) {
|
|
2419
|
-
if (error instanceof Error) {
|
|
2420
|
-
logger.error(error.message);
|
|
2421
|
-
if (error.stack && process.env["WEAPP_TW_DEBUG"] === "1") logger.error(error.stack);
|
|
2422
|
-
} else logger.error(String(error));
|
|
2423
|
-
}
|
|
2424
|
-
function withCommandErrorHandling(handler) {
|
|
2425
|
-
return (async (ctx, next) => {
|
|
2426
|
-
try {
|
|
2427
|
-
return await handler(ctx, next);
|
|
2428
|
-
} catch (error) {
|
|
2429
|
-
handleCliError(error);
|
|
2430
|
-
process.exitCode = 1;
|
|
2431
|
-
return;
|
|
2432
|
-
}
|
|
2433
|
-
});
|
|
2434
|
-
}
|
|
2435
|
-
const forwardedCommands = [
|
|
2056
|
+
const obsoletePatchCommands = [
|
|
2436
2057
|
"extract",
|
|
2437
2058
|
"tokens",
|
|
2438
2059
|
"init",
|
|
@@ -2440,14 +2061,13 @@ const forwardedCommands = [
|
|
|
2440
2061
|
"restore",
|
|
2441
2062
|
"validate"
|
|
2442
2063
|
];
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
const DEFAULT_VSCODE_ENTRY_OUTPUT = ".vscode/weapp-tailwindcss.intellisense.css";
|
|
2064
|
+
function logPatchCommandObsoleteNotice() {
|
|
2065
|
+
logger.warn(PATCH_COMMAND_OBSOLETE_NOTICE);
|
|
2066
|
+
}
|
|
2067
|
+
function logObsoletePatchCommand(command) {
|
|
2068
|
+
logPatchCommandObsoleteNotice();
|
|
2069
|
+
logger.warn(`命令 "${command}" 来自旧版 tailwindcss-patch 工作流,当前版本无需执行。`);
|
|
2070
|
+
}
|
|
2451
2071
|
const DEFAULT_VSCODE_SOURCES = [
|
|
2452
2072
|
"not \"./dist\"",
|
|
2453
2073
|
"not \"./unpackage\"",
|
|
@@ -2547,15 +2167,47 @@ async function generateVscodeIntellisenseEntry(options) {
|
|
|
2547
2167
|
//#region src/cli.ts
|
|
2548
2168
|
process.title = "node (weapp-tailwindcss)";
|
|
2549
2169
|
if (!semver.satisfies(process.versions.node, "^20.19.0 || >=22.12.0")) logger.warn(`You are using Node.js ${process.versions.node}. For weapp-tailwindcss, Node.js version ${WEAPP_TW_REQUIRED_NODE_VERSION_RANGE} is required.`);
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2170
|
+
function parseArgs(argv) {
|
|
2171
|
+
const options = {};
|
|
2172
|
+
const positional = [];
|
|
2173
|
+
for (let index = 0; index < argv.length; index++) {
|
|
2174
|
+
const arg = argv[index];
|
|
2175
|
+
if (!arg.startsWith("--")) {
|
|
2176
|
+
positional.push(arg);
|
|
2177
|
+
continue;
|
|
2178
|
+
}
|
|
2179
|
+
const [rawKey, inlineValue] = arg.slice(2).split("=", 2);
|
|
2180
|
+
const key = rawKey.replace(/-([a-z])/g, (_, char) => char.toUpperCase());
|
|
2181
|
+
const next = argv[index + 1];
|
|
2182
|
+
const value = inlineValue ?? (next && !next.startsWith("-") ? argv[++index] : true);
|
|
2183
|
+
const current = options[key];
|
|
2184
|
+
if (current === void 0) options[key] = value;
|
|
2185
|
+
else if (Array.isArray(current)) current.push(String(value));
|
|
2186
|
+
else options[key] = [String(current), String(value)];
|
|
2187
|
+
}
|
|
2188
|
+
return {
|
|
2189
|
+
command: positional[0],
|
|
2190
|
+
options
|
|
2191
|
+
};
|
|
2192
|
+
}
|
|
2193
|
+
function printHelp() {
|
|
2194
|
+
logger.log(`weapp-tailwindcss
|
|
2195
|
+
|
|
2196
|
+
Usage:
|
|
2197
|
+
weapp-tw <command> [options]
|
|
2198
|
+
|
|
2199
|
+
Commands:
|
|
2200
|
+
patch Deprecated no-op: v5 runtime handles Tailwind CSS automatically
|
|
2201
|
+
status Deprecated no-op: patch status is no longer required
|
|
2202
|
+
vscode-entry Generate a VS Code helper CSS for Tailwind IntelliSense
|
|
2203
|
+
doctor Check project setup for weapp-tailwindcss
|
|
2204
|
+
`);
|
|
2205
|
+
}
|
|
2206
|
+
async function runPatch() {
|
|
2555
2207
|
logPatchCommandObsoleteNotice();
|
|
2556
2208
|
logger.success("已跳过:当前版本不需要手动执行 Tailwind CSS patch。");
|
|
2557
|
-
}
|
|
2558
|
-
|
|
2209
|
+
}
|
|
2210
|
+
async function runStatus(options) {
|
|
2559
2211
|
const payload = {
|
|
2560
2212
|
required: false,
|
|
2561
2213
|
status: "unnecessary",
|
|
@@ -2567,8 +2219,8 @@ cli.command("status", "Deprecated no-op: patch status is no longer required").op
|
|
|
2567
2219
|
}
|
|
2568
2220
|
logPatchCommandObsoleteNotice();
|
|
2569
2221
|
logger.success("无需检查 Tailwind CSS patch 状态。");
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2222
|
+
}
|
|
2223
|
+
async function runVscodeEntry(options) {
|
|
2572
2224
|
const resolvedCwd = resolveCliCwd(options.cwd);
|
|
2573
2225
|
const baseDir = resolvedCwd ?? process.cwd();
|
|
2574
2226
|
const cssEntry = readStringOption("css", options.css);
|
|
@@ -2581,15 +2233,50 @@ cli.command("vscode-entry", "Generate a VS Code helper CSS for Tailwind IntelliS
|
|
|
2581
2233
|
force: toBoolean(options.force, false)
|
|
2582
2234
|
});
|
|
2583
2235
|
logger.success(`VS Code helper generated -> ${formatOutputPath(result.outputPath, resolvedCwd)}`);
|
|
2584
|
-
}
|
|
2585
|
-
|
|
2236
|
+
}
|
|
2237
|
+
async function runDoctor(options) {
|
|
2586
2238
|
const report = createDoctorReport({ cwd: resolveCliCwd(options.cwd) });
|
|
2587
2239
|
if (toBoolean(options.json, false)) logger.log(JSON.stringify(report, null, 2));
|
|
2588
2240
|
else logger.log(formatDoctorReport(report));
|
|
2589
2241
|
if (hasDoctorFailure(report, toBoolean(options.strict, false))) process.exitCode = 1;
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2242
|
+
}
|
|
2243
|
+
async function main() {
|
|
2244
|
+
const { command, options } = parseArgs(process.argv.slice(2));
|
|
2245
|
+
await commandAction(async () => {
|
|
2246
|
+
switch (command) {
|
|
2247
|
+
case void 0:
|
|
2248
|
+
case "-h":
|
|
2249
|
+
case "--help":
|
|
2250
|
+
case "help":
|
|
2251
|
+
printHelp();
|
|
2252
|
+
return;
|
|
2253
|
+
case "-v":
|
|
2254
|
+
case "--version":
|
|
2255
|
+
case "version":
|
|
2256
|
+
logger.log(process.env["npm_package_version"] ?? "0.0.0");
|
|
2257
|
+
return;
|
|
2258
|
+
case "patch":
|
|
2259
|
+
case "install":
|
|
2260
|
+
await runPatch();
|
|
2261
|
+
return;
|
|
2262
|
+
case "status":
|
|
2263
|
+
await runStatus(options);
|
|
2264
|
+
return;
|
|
2265
|
+
case "vscode-entry":
|
|
2266
|
+
await runVscodeEntry(options);
|
|
2267
|
+
return;
|
|
2268
|
+
case "doctor":
|
|
2269
|
+
await runDoctor(options);
|
|
2270
|
+
return;
|
|
2271
|
+
default:
|
|
2272
|
+
if (obsoletePatchCommands.includes(command)) {
|
|
2273
|
+
logObsoletePatchCommand(command);
|
|
2274
|
+
return;
|
|
2275
|
+
}
|
|
2276
|
+
throw new Error(`Unknown command: ${command}`);
|
|
2277
|
+
}
|
|
2278
|
+
})();
|
|
2279
|
+
}
|
|
2280
|
+
main();
|
|
2594
2281
|
//#endregion
|
|
2595
2282
|
export {};
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InternalUserDefinedOptions,
|
|
2
|
-
interface
|
|
1
|
+
import type { InternalUserDefinedOptions, TailwindcssRuntimeLike, UserDefinedOptions } from '../types';
|
|
2
|
+
interface ClearTailwindcssRuntimeCacheOptions {
|
|
3
3
|
removeDirectory?: boolean;
|
|
4
4
|
}
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function clearTailwindcssRuntimeCache(tailwindRuntime: TailwindcssRuntimeLike | undefined, options?: ClearTailwindcssRuntimeCacheOptions): Promise<void>;
|
|
6
6
|
export declare function getCompilerContext(opts?: UserDefinedOptions): InternalUserDefinedOptions;
|
|
7
7
|
export {};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
2
|
import type { InternalUserDefinedOptions } from '../types';
|
|
3
|
-
export
|
|
3
|
+
export type ResolvedStyleOptions = Partial<IStyleHandlerOptions> & {
|
|
4
|
+
appType?: InternalUserDefinedOptions['appType'] | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function resolveStyleOptionsFromContext(ctx: InternalUserDefinedOptions, tailwindcssMajorVersion?: number): ResolvedStyleOptions;
|