Skip to content

Commit fb723b0

Browse files
committed
chore: bump version
1 parent 62ee343 commit fb723b0

File tree

12 files changed

+1515
-1657
lines changed

12 files changed

+1515
-1657
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'weapp-tailwindcss': patch
3+
---
4+
5+
修复配置 cssEntries 时默认强制覆盖 tailwind v4 base 导致 @config 解析到错误目录的问题,保持用户自定义 base 并让入口目录成为默认解析基准,避免运行时类名收集为空。
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tailwindcss-weapp': patch
3+
---
4+
5+
修复 mp-weixin 构建时强制使用内置的 uni-mp-vue 运行时,避免缺失 findComponentPropsData 导致的打包错误。

apps/tailwindcss-weapp/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"@dcloudio/uni-mp-lark": "3.0.0-4080720251210001",
6868
"@dcloudio/uni-mp-qq": "3.0.0-4080720251210001",
6969
"@dcloudio/uni-mp-toutiao": "3.0.0-4080720251210001",
70+
"@dcloudio/uni-mp-vue": "3.0.0-4080720251210001",
7071
"@dcloudio/uni-mp-weixin": "3.0.0-4080720251210001",
7172
"@dcloudio/uni-mp-xhs": "3.0.0-4080720251210001",
7273
"@dcloudio/uni-quickapp-webview": "3.0.0-4080720251210001",
@@ -98,7 +99,7 @@
9899
"miniprogram-api-typings": "^4.0.5",
99100
"postcss": "^8.5.3",
100101
"prettier": "^3.5.3",
101-
"prettier-plugin-tailwindcss": "^0.6.11",
102+
"prettier-plugin-tailwindcss": "^0.7.2",
102103
"redent": "^4.0.0",
103104
"strip-indent": "^4.1.1",
104105
"tailwindcss": "^3.4.18",

apps/tailwindcss-weapp/vite.config.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,42 @@
1+
import { createRequire } from 'node:module'
2+
import { dirname } from 'node:path'
3+
import { fileURLToPath } from 'node:url'
4+
15
import uni from '@dcloudio/vite-plugin-uni'
26
import AutoImport from 'unplugin-auto-import/vite'
37
import { defineConfig } from 'vite'
48
import { UnifiedViteWeappTailwindcssPlugin as uvtw } from 'weapp-tailwindcss/vite'
59
import { WeappTailwindcssDisabled } from './platform'
610
import postcssPlugins from './postcss.config.cjs'
711

12+
const require = createRequire(import.meta.url)
13+
const here = dirname(fileURLToPath(import.meta.url))
14+
const mpWeixinDir = dirname(
15+
require.resolve('@dcloudio/uni-mp-weixin/package.json', { paths: [here] }),
16+
)
17+
// Resolve vue runtime from the same version bundled with mp-weixin to avoid older 2.x builds lacking findComponentPropsData
18+
const uniMpVueRuntimePath = require.resolve('@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js', {
19+
paths: [mpWeixinDir, here],
20+
})
21+
const uniMpVueDir = dirname(uniMpVueRuntimePath)
22+
823
// https://vitejs.dev/config/
924
export default defineConfig({
1025
// uvtw 一定要放在 uni 后面
1126
plugins: [
27+
{
28+
name: 'force-uni-mp-vue-runtime',
29+
enforce: 'pre',
30+
resolveId(id) {
31+
if (
32+
id === 'vue' ||
33+
id === '@dcloudio/uni-mp-vue' ||
34+
id === '@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js'
35+
) {
36+
return uniMpVueRuntimePath
37+
}
38+
},
39+
},
1240
uni(),
1341
uvtw({
1442
rem2rpx: true,
@@ -35,4 +63,12 @@ export default defineConfig({
3563
},
3664
},
3765
},
66+
resolve: {
67+
alias: {
68+
vue: uniMpVueRuntimePath,
69+
// Ensure we always consume the Vue 3 runtime that exposes findComponentPropsData
70+
'@dcloudio/uni-mp-vue/dist/vue.runtime.esm.js': uniMpVueRuntimePath,
71+
'@dcloudio/uni-mp-vue': uniMpVueDir,
72+
},
73+
},
3874
})

apps/vue-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"class-variance-authority": "^0.7.1",
1313
"clsx": "^2.1.1",
1414
"lucide-vue-next": "catalog:lucideVueNext0555",
15-
"reka-ui": "^2.6.1",
15+
"reka-ui": "^2.7.0",
1616
"tailwind-merge": "^3.4.0",
1717
"vue": "catalog:vue3"
1818
},

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"@csstools/postcss-is-pseudo-class": "^5.0.3",
125125
"@eslint/config-inspector": "^1.4.2",
126126
"@icebreakers/commitlint-config": "^1.2.3",
127-
"@icebreakers/eslint-config": "^1.6.8",
127+
"@icebreakers/eslint-config": "^1.6.9",
128128
"@icebreakers/monorepo": "^3.1.12",
129129
"@icebreakers/stylelint-config": "^1.2.4",
130130
"@swc/core": "^1.15.7",
@@ -219,12 +219,12 @@
219219
"normalize-newline": "^5.0.0",
220220
"npm-registry-fetch": "^19.1.1",
221221
"only-allow": "^1.2.2",
222-
"oxc-parser": "^0.103.0",
222+
"oxc-parser": "^0.105.0",
223223
"pathe": "^2.0.3",
224224
"picocolors": "^1.1.1",
225225
"pkg-types": "^2.3.0",
226226
"postcss": "catalog:postcss85",
227-
"postcss-js": "^5.0.2",
227+
"postcss-js": "^5.0.3",
228228
"postcss-load-config": "^6.0.1",
229229
"postcss-loader": "^8.2.0",
230230
"postcss-preset-env": "^10.5.0",
@@ -246,7 +246,7 @@
246246
"traverse": "^0.6.11",
247247
"ts-morph": "^27.0.2",
248248
"tsd": "^0.33.0",
249-
"tsdown": "0.18.1",
249+
"tsdown": "0.18.2",
250250
"tslib": "^2.8.1",
251251
"tsup": "^8.5.1",
252252
"tsx": "^4.21.0",
@@ -271,6 +271,13 @@
271271
"pnpm": {
272272
"overrides": {
273273
"postcss-urlrewrite": "0.3.0"
274+
},
275+
"packageExtensions": {
276+
"@dcloudio/vue-cli-plugin-hbuilderx@*": {
277+
"dependencies": {
278+
"@dcloudio/uni-cli-shared": "2.0.2-4080520251106001"
279+
}
280+
}
274281
}
275282
}
276283
}

packages-runtime/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"@storybook/react-vite": "^8.5.0",
141141
"@storybook/test": "^8.5.0",
142142
"@tailwindcss/vite": "catalog:tailwindcss4",
143-
"@types/react": "^19.0.0",
143+
"@types/react": "^19.2.7",
144144
"@types/react-dom": "^19.0.0",
145145
"react": "^18.3.1",
146146
"react-dom": "^18.3.1",

packages/debug-uni-app-x/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"defu": "6.1.4",
40-
"fs-extra": "11.3.2",
40+
"fs-extra": "11.3.3",
4141
"pathe": "2.0.3"
4242
},
4343
"devDependencies": {

packages/weapp-tailwindcss/src/tailwindcss/v4/patcher.ts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ export function createPatcherForBase(
205205
supportCustomLengthUnitsPatch,
206206
} = options
207207

208+
const hasCssEntries = Boolean(cssEntries?.length)
209+
208210
const defaultTailwindcssConfig: TailwindUserOptions = {
209211
cwd: baseDir,
210212
v2: {
@@ -213,13 +215,15 @@ export function createPatcherForBase(
213215
v3: {
214216
cwd: baseDir,
215217
},
216-
v4: {
217-
base: baseDir,
218-
cssEntries,
219-
},
218+
v4: hasCssEntries
219+
? { cssEntries }
220+
: {
221+
base: baseDir,
222+
cssEntries,
223+
},
220224
}
221225

222-
if (cssEntries?.length && (tailwindcss == null || tailwindcss.version == null)) {
226+
if (hasCssEntries && (tailwindcss == null || tailwindcss.version == null)) {
223227
defaultTailwindcssConfig.version = 4
224228
}
225229

@@ -229,18 +233,28 @@ export function createPatcherForBase(
229233
)
230234

231235
if (!mergedTailwindOptions.v4) {
232-
mergedTailwindOptions.v4 = {
233-
base: baseDir,
234-
cssEntries: cssEntries ?? [],
235-
}
236+
mergedTailwindOptions.v4 = hasCssEntries
237+
? { cssEntries: cssEntries ?? [] }
238+
: {
239+
base: baseDir,
240+
cssEntries: cssEntries ?? [],
241+
}
236242
}
237243
else {
238-
mergedTailwindOptions.v4.base = baseDir
239-
if (cssEntries?.length) {
240-
mergedTailwindOptions.v4.cssEntries = cssEntries
244+
if (!hasCssEntries && !mergedTailwindOptions.v4.base) {
245+
mergedTailwindOptions.v4.base = baseDir
246+
}
247+
248+
if (hasCssEntries) {
249+
if (cssEntries?.length) {
250+
mergedTailwindOptions.v4.cssEntries = cssEntries
251+
}
252+
else if (!mergedTailwindOptions.v4.cssEntries) {
253+
mergedTailwindOptions.v4.cssEntries = []
254+
}
241255
}
242256
else if (!mergedTailwindOptions.v4.cssEntries) {
243-
mergedTailwindOptions.v4.cssEntries = []
257+
mergedTailwindOptions.v4.cssEntries = cssEntries ?? []
244258
}
245259
}
246260

packages/weapp-tailwindcss/test/tailwindcss/v4/patcher.test.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('tailwindcss/v4/patcher helpers', () => {
198198
expect(new Set([callA.basedir, callB.basedir])).toEqual(new Set([baseDir]))
199199
expect(callA.cacheDir).toBeUndefined()
200200
expect(callA.tailwindcss?.version).toBe(4)
201-
expect(callA.tailwindcss?.v4?.base).toBe(baseDir)
201+
expect(callA.tailwindcss?.v4?.base).toBeUndefined()
202202
expect(callA.tailwindcss?.v4?.cssEntries).toEqual(cssEntries)
203203
expect(patcher.majorVersion).toBe(4)
204204
})
@@ -288,7 +288,22 @@ describe('tailwindcss/v4/patcher helpers', () => {
288288
appType: 'taro',
289289
} as unknown as InternalUserDefinedOptions) as any
290290

291-
expect(patcher.tailwindcss?.v4?.base).toBe('/workspace/app')
291+
expect(patcher.tailwindcss?.v4?.base).toBeUndefined()
292+
expect(patcher.tailwindcss?.v4?.cssEntries).toEqual(['/workspace/app/src/app.css'])
293+
})
294+
295+
it('preserves user-specified v4 base when css entries are provided', async () => {
296+
createTailwindcssPatcher.mockImplementation(options => options)
297+
const { createPatcherForBase } = await loadModule()
298+
299+
const patcher = createPatcherForBase('/workspace/app', ['/workspace/app/src/app.css'], {
300+
tailwindcss: { v4: { base: '/custom/base' } },
301+
tailwindcssPatcherOptions: undefined,
302+
supportCustomLengthUnitsPatch: true,
303+
appType: 'taro',
304+
} as unknown as InternalUserDefinedOptions) as any
305+
306+
expect(patcher.tailwindcss?.v4?.base).toBe('/custom/base')
292307
expect(patcher.tailwindcss?.v4?.cssEntries).toEqual(['/workspace/app/src/app.css'])
293308
})
294309

0 commit comments

Comments
 (0)