diff --git a/.changeset/bright-variants-cascade.md b/.changeset/bright-variants-cascade.md deleted file mode 100644 index 16ab2bc99..000000000 --- a/.changeset/bright-variants-cascade.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"weapp-tailwindcss": patch ---- - -修复 uni-app x H5 局部 Tailwind 工具类的级联优先级,确保 `dark` 等条件变体能够覆盖同一元素上的基础工具类。 diff --git a/.changeset/calm-react-native-compatibility.md b/.changeset/calm-react-native-compatibility.md deleted file mode 100644 index ac809916a..000000000 --- a/.changeset/calm-react-native-compatibility.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -'@weapp-tailwindcss/react-native': patch ---- - -收紧 React Native 样式编译边界,只生成平台明确支持的属性和条件变体,并补充比例值、百分比透明度、项目根目录及 CSS 入口类型支持,避免未知 CSS 属性或浏览器 selector 变体被误报为可用原生样式。 - -稳定 Babel 静态 lookup 使用的 StyleSheet ID,避免 TSX 或 CSS HMR 改变规则顺序后串用其他 class 的样式;同时加入 Expo Web、Android、iOS 共用的 118 项兼容性报告、截图和独立 TSX/CSS HMR 门禁。 - -Metro transformer 在未透传自定义 id 或 manifest 路径时也会按项目根目录等待异步样式生成完成,并通过跨进程 ready 标记同步 manifest 与 virtual module,避免构建速度较慢或 HMR 刷新时使用空 manifest 导致静态 className 未被转换。 - -React Native 类型增强入口改为纯类型依赖,不再从 workspace 包目录额外加载另一份 React Native 运行时,避免 Metro bundle 与 Expo 原生二进制使用不同 patch 版本后出现原生模块注册表为空的问题。 - -Android 与 iOS 的 Metro resolver 进一步把 `react`、`react-native` 及其子路径锚定到应用项目根目录,确保 linked workspace 包与原生二进制共用同一份 React Native runtime;Web 保留 Expo 原有的平台解析与 `react-native-web` 映射。 diff --git a/.changeset/fuzzy-layouts-match.md b/.changeset/fuzzy-layouts-match.md deleted file mode 100644 index 00c5e76da..000000000 --- a/.changeset/fuzzy-layouts-match.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"weapp-tailwindcss": patch ---- - -支持通过 `uniAppX.componentLocalStyles.componentMatcher` 和 `pageMatcher` 为 `layouts` 等自定义目录启用局部 Tailwind 样式,并保持 Web、原生 App 与鸿蒙构建的路径匹配行为一致。 diff --git a/.changeset/ledger.yaml b/.changeset/ledger.yaml index 9025204de..c31e407b2 100644 --- a/.changeset/ledger.yaml +++ b/.changeset/ledger.yaml @@ -2,6 +2,10 @@ dir: packages/lynx intents: - lynx-tailwind-v4-compat +"@weapp-tailwindcss/react-native@0.2.5": + dir: packages/react-native + intents: + - calm-react-native-compatibility weapp-tailwindcss@5.3.1: dir: packages/weapp-tailwindcss intents: @@ -10,3 +14,9 @@ weapp-tailwindcss@5.3.2: dir: packages/weapp-tailwindcss intents: - bright-harmony-vdom +weapp-tailwindcss@5.3.3: + dir: packages/weapp-tailwindcss + intents: + - bright-variants-cascade + - fuzzy-layouts-match + - slick-bears-sleep diff --git a/.changeset/slick-bears-sleep.md b/.changeset/slick-bears-sleep.md deleted file mode 100644 index ff055b670..000000000 --- a/.changeset/slick-bears-sleep.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"weapp-tailwindcss": patch ---- - -修复 uni-app x H5 中已进入构建图但未命中显式 Tailwind 正向源码范围的页面,暗色等 variant 任意值类无法生成和同步转译的问题。 diff --git a/e2e/web-vite-demo-hmr.test.ts b/e2e/web-vite-demo-hmr.test.ts index 3eb19f980..e8ea591e8 100644 --- a/e2e/web-vite-demo-hmr.test.ts +++ b/e2e/web-vite-demo-hmr.test.ts @@ -9,6 +9,7 @@ import process from 'node:process' import path from 'pathe' import { chromium } from 'playwright' import { afterEach, describe, it } from 'vitest' +import { writeFilePreserveEol } from '../tools/weapp-tailwindcss-scripts/src/watch-hmr-regression/text' import { resolveChromeExecutable } from './hbuilderx-local/process' import { webViteHmrCases } from './web-vite-demo-hmr-cases' @@ -206,7 +207,7 @@ async function mutateSource(item: WebViteHmrCase, sourceFile: string, kind: Sour if (next === current) { throw new Error(`${item.name} Web HMR 源码替换没有产生变化`) } - await fs.writeFile(sourceFile, next, 'utf8') + await writeFilePreserveEol(sourceFile, next, current) return { previous: current, next, @@ -281,9 +282,9 @@ async function runWebIconifyHmr(page: Page, item: WebViteHmrCase, sourceFile: st throw new Error(`${item.name} Web Iconify HMR probe 缺少 before content class`) } const sourceWithUpdatedContent = sourceWithProbe.replace(iconifyBeforeContentClass, iconifyAfterContentClass) - await fs.writeFile(sourceFile, sourceWithProbe, 'utf8') + await writeFilePreserveEol(sourceFile, sourceWithProbe, original) await waitForIconifyCss(page, item, iconifyBeforeContentClass) - await fs.writeFile(sourceFile, sourceWithUpdatedContent, 'utf8') + await writeFilePreserveEol(sourceFile, sourceWithUpdatedContent, original) await waitForIconifyCss(page, item, iconifyAfterContentClass) } @@ -464,9 +465,9 @@ async function waitForTitleHmrAfterMutation(page: Page, item: WebViteHmrCase, so firstError = error } - await fs.writeFile(sourceFile, mutation.previous, 'utf8') + await writeFilePreserveEol(sourceFile, mutation.previous, mutation.previous) await wait(500) - await fs.writeFile(sourceFile, mutation.next, 'utf8') + await writeFilePreserveEol(sourceFile, mutation.next, mutation.previous) const elapsedMs = Date.now() - startedAt try { @@ -702,7 +703,7 @@ describe('demo/web source HMR', () => { const hmrMessages = collectViteHmrMessages(page) const original = await fs.readFile(sourceFile, 'utf8') restoreSource = async () => { - await fs.writeFile(sourceFile, original, 'utf8') + await writeFilePreserveEol(sourceFile, original, original) } await page.goto(baseUrl, { waitUntil: 'domcontentloaded', @@ -765,7 +766,7 @@ describe('demo/web source HMR', () => { const original = await fs.readFile(sourceFile, 'utf8') const flow = createTailwindClassFlowMutation(item, original) restoreSource = async () => { - await fs.writeFile(sourceFile, original, 'utf8') + await writeFilePreserveEol(sourceFile, original, original) } await page.goto(baseUrl, { waitUntil: 'domcontentloaded', @@ -793,7 +794,7 @@ describe('demo/web source HMR', () => { const addMessageStart = hmrMessages.length await measureHmrLatency(`${item.name} class add`, async () => { - await fs.writeFile(sourceFile, flow.addedSource, 'utf8') + await writeFilePreserveEol(sourceFile, flow.addedSource, original) await waitForFlowElementStyle(page, item, flow.selector, { backgroundColor: 'rgb(255, 255, 255)', borderTopColor: 'rgb(0, 255, 0)', @@ -808,7 +809,7 @@ describe('demo/web source HMR', () => { const modifyMessageStart = hmrMessages.length await measureHmrLatency(`${item.name} class modify`, async () => { - await fs.writeFile(sourceFile, flow.modifiedSource, 'utf8') + await writeFilePreserveEol(sourceFile, flow.modifiedSource, original) await waitForFlowElementStyle(page, item, flow.selector, { backgroundColor: 'rgb(255, 255, 255)', borderTopColor: 'rgb(255, 0, 170)', @@ -823,7 +824,7 @@ describe('demo/web source HMR', () => { const removeClassMessageStart = hmrMessages.length await measureHmrLatency(`${item.name} class remove`, async () => { - await fs.writeFile(sourceFile, flow.removedClassSource, 'utf8') + await writeFilePreserveEol(sourceFile, flow.removedClassSource, original) await waitForFlowElementStyle(page, item, flow.selector, { backgroundColor: 'rgb(255, 255, 255)', borderTopColor: originalState.borderTopColor, @@ -838,7 +839,7 @@ describe('demo/web source HMR', () => { const rollbackMessageStart = hmrMessages.length await measureHmrLatency(`${item.name} class rollback`, async () => { - await fs.writeFile(sourceFile, original, 'utf8') + await writeFilePreserveEol(sourceFile, original, original) await waitForFlowElementStyle(page, item, flow.selector, { backgroundColor: 'rgb(255, 255, 255)', borderTopColor: originalState.borderTopColor, diff --git a/examples/react-lynx/CHANGELOG.md b/examples/react-lynx/CHANGELOG.md index 6c58c9601..d4bcc361e 100644 --- a/examples/react-lynx/CHANGELOG.md +++ b/examples/react-lynx/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies: + - @weapp-tailwindcss/lynx@0.3.2 + +## 0.1.2 + +### Patch Changes + - Updated dependencies: - @weapp-tailwindcss/lynx@0.3.1 diff --git a/examples/react-native-expo/CHANGELOG.md b/examples/react-native-expo/CHANGELOG.md index ddc781103..af1552d74 100644 --- a/examples/react-native-expo/CHANGELOG.md +++ b/examples/react-native-expo/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies: + - @weapp-tailwindcss/react-native@0.2.5 + +## 0.1.3 + +### Patch Changes + - Updated dependencies: - @weapp-tailwindcss/react-native@0.2.4 diff --git a/packages/build-all/CHANGELOG.md b/packages/build-all/CHANGELOG.md index a8b2e7440..02e45e9ac 100644 --- a/packages/build-all/CHANGELOG.md +++ b/packages/build-all/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies: + - weapp-tailwindcss@5.3.3 + +## 0.0.72 + +### Patch Changes + - Updated dependencies: - weapp-tailwindcss@5.3.2 diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 40e973229..f9762dfff 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,12 @@ # @weapp-tailwindcss/cli +## 5.3.3 + +### Patch Changes + +- Updated dependencies: + - weapp-tailwindcss@5.3.3 + ## 5.3.2 ### Patch Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index a38d47c1b..4c614960b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@weapp-tailwindcss/cli", "type": "module", - "version": "5.3.2", + "version": "5.3.3", "description": "Cross-platform Tailwind CSS CLI for Web and mini-program builds. 面向 Web 与小程序构建的跨端 Tailwind CSS CLI。", "author": "ice breaker <1324318532@qq.com>", "license": "MIT", diff --git a/packages/lynx/CHANGELOG.md b/packages/lynx/CHANGELOG.md index 3f96896f5..48bf0de00 100644 --- a/packages/lynx/CHANGELOG.md +++ b/packages/lynx/CHANGELOG.md @@ -1,5 +1,12 @@ # @weapp-tailwindcss/lynx +## 0.3.2 + +### Patch Changes + +- Updated dependencies: + - weapp-tailwindcss@5.3.3 + ## 0.3.1 ### Patch Changes diff --git a/packages/lynx/package.json b/packages/lynx/package.json index f88fa6c3b..561eaf2af 100644 --- a/packages/lynx/package.json +++ b/packages/lynx/package.json @@ -1,7 +1,7 @@ { "name": "@weapp-tailwindcss/lynx", "type": "module", - "version": "0.3.1", + "version": "0.3.2", "description": "Tailwind CSS integration for ReactLynx and Rspeedy cross-platform builds. 面向 ReactLynx 与 Rspeedy 跨端构建的 Tailwind CSS 集成。", "license": "MIT", "repository": { diff --git a/packages/react-native/CHANGELOG.md b/packages/react-native/CHANGELOG.md index b1b90d5ac..d8bc78918 100644 --- a/packages/react-native/CHANGELOG.md +++ b/packages/react-native/CHANGELOG.md @@ -1,5 +1,22 @@ # @weapp-tailwindcss/react-native +## 0.2.5 + +### Patch Changes + +- 收紧 React Native 样式编译边界,只生成平台明确支持的属性和条件变体,并补充比例值、百分比透明度、项目根目录及 CSS 入口类型支持,避免未知 CSS 属性或浏览器 selector 变体被误报为可用原生样式。 + + 稳定 Babel 静态 lookup 使用的 StyleSheet ID,避免 TSX 或 CSS HMR 改变规则顺序后串用其他 class 的样式;同时加入 Expo Web、Android、iOS 共用的 118 项兼容性报告、截图和独立 TSX/CSS HMR 门禁。 + + Metro transformer 在未透传自定义 id 或 manifest 路径时也会按项目根目录等待异步样式生成完成,并通过跨进程 ready 标记同步 manifest 与 virtual module,避免构建速度较慢或 HMR 刷新时使用空 manifest 导致静态 className 未被转换。 + + React Native 类型增强入口改为纯类型依赖,不再从 workspace 包目录额外加载另一份 React Native 运行时,避免 Metro bundle 与 Expo 原生二进制使用不同 patch 版本后出现原生模块注册表为空的问题。 + + Android 与 iOS 的 Metro resolver 进一步把 `react`、`react-native` 及其子路径锚定到应用项目根目录,确保 linked workspace 包与原生二进制共用同一份 React Native runtime;Web 保留 Expo 原有的平台解析与 `react-native-web` 映射。 + +- Updated dependencies: + - weapp-tailwindcss@5.3.3 + ## 0.2.4 ### Patch Changes diff --git a/packages/react-native/package.json b/packages/react-native/package.json index eb63e119a..af6d96613 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -1,7 +1,7 @@ { "name": "@weapp-tailwindcss/react-native", "type": "module", - "version": "0.2.4", + "version": "0.2.5", "description": "Tailwind CSS compiler and Expo Metro integration for cross-platform React Native apps. 面向跨端 React Native 应用的 Tailwind CSS 编译器与 Expo Metro 集成。", "license": "MIT", "repository": { diff --git a/packages/weapp-tailwindcss/CHANGELOG.md b/packages/weapp-tailwindcss/CHANGELOG.md index 4481b6732..e62e0a7a8 100644 --- a/packages/weapp-tailwindcss/CHANGELOG.md +++ b/packages/weapp-tailwindcss/CHANGELOG.md @@ -1,5 +1,15 @@ # weapp-tailwindcss +## 5.3.3 + +### Patch Changes + +- 修复 uni-app x H5 局部 Tailwind 工具类的级联优先级,确保 `dark` 等条件变体能够覆盖同一元素上的基础工具类。 + +- 支持通过 `uniAppX.componentLocalStyles.componentMatcher` 和 `pageMatcher` 为 `layouts` 等自定义目录启用局部 Tailwind 样式,并保持 Web、原生 App 与鸿蒙构建的路径匹配行为一致。 + +- 修复 uni-app x H5 中已进入构建图但未命中显式 Tailwind 正向源码范围的页面,暗色等 variant 任意值类无法生成和同步转译的问题。 + ## 5.3.2 ### Patch Changes diff --git a/packages/weapp-tailwindcss/package.json b/packages/weapp-tailwindcss/package.json index 500cef042..3ef70784a 100644 --- a/packages/weapp-tailwindcss/package.json +++ b/packages/weapp-tailwindcss/package.json @@ -1,7 +1,7 @@ { "name": "weapp-tailwindcss", "type": "module", - "version": "5.3.2", + "version": "5.3.3", "description": "Bring Tailwind CSS to every platform! 把 Tailwind CSS 的原子化开发体验带到全端!", "author": "ice breaker <1324318532@qq.com>", "license": "MIT", diff --git a/website/CHANGELOG.md b/website/CHANGELOG.md index 78576dda9..3310ca6a1 100644 --- a/website/CHANGELOG.md +++ b/website/CHANGELOG.md @@ -4,6 +4,13 @@ ### Patch Changes +- Updated dependencies: + - weapp-tailwindcss@5.3.3 + +## 1.0.65 + +### Patch Changes + - Updated dependencies: - weapp-tailwindcss@5.3.2