feat: 新增 HBuilderX uni-app Tailwind 演示#882
Open
sonofmagic wants to merge 13 commits into
Open
Conversation
🦋 Changeset detectedLatest commit: 0b8c61a The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
摘要
weapp-tailwindcss,不接入官方 Tailwind PostCSS/Vite 生成插件。hbuilderxpreset,并补强 uni-app x/HBuilderX 的 CJS 兼容,以及 Tailwind v4 Web/H5 的 source candidate 扫描。alwaysBundle且不暴露给消费者的实现依赖下移到devDependencies,覆盖weapp-tailwindcss、@weapp-tailwindcss/postcss、@weapp-tailwindcss/typography、@weapp-tailwindcss/debug-uni-app-x、@weapp-tailwindcss/logger、@weapp-tailwindcss/shared与tailwindcss-config。tailwindcss-config保留jiti为运行期依赖;@weapp-tailwindcss/shared保留defu、get-value、set-value为运行期依赖,因为它们属于公开导出类型/接口的一部分。pnpm e2e:hbuilderx:local。该流程通过E2E_HBUILDERX_LOCAL=1显式开启,不接入 CI/CD,因为 CI 环境无法安装 HBuilderX。.changeset/major-hbuilderx-bundled-deps.md。HBuilderX 本地 E2E 覆盖
uni-app-vite-vue3-hbuilderx-tailwindcss-v3uni-app-vite-vue3-hbuilderx-tailwindcss-v4uni-app-x-hbuilderx-tailwindcss-v3uni-app-x-hbuilderx-tailwindcss-v4unpackage/dist/dev/mp-weixin下的小程序产物、app.wxss中的 Tailwind 转译结果,以及不残留 Tailwind 原始指令。HBUILDERX_CLI_PATH,macOS 下 fallback 到/Applications/HBuilderX.app/Contents/MacOS/cli;浏览器优先使用 Playwright 可用浏览器,macOS 下可 fallback 到系统 Chrome。验证
pnpm --filter weapp-tailwindcss buildpnpm --filter @weapp-tailwindcss/postcss testpnpm --filter weapp-tailwindcss exec vitest run test/presets/hbuilderx.test.ts test/presets/uni-app-x.test.ts test/bundlers/vite-plugin.bundle.unit.test.ts test/v5/vite-generator.bundle.test.ts --testNamePattern "hbuilderx preset|uni-app-x preset|Tailwind v4 web generator buildStart|v4 source candidates|dev hmr adds arbitrary value"node -e "require('./packages/weapp-tailwindcss/dist/presets.js'); require('./packages/weapp-tailwindcss/dist/vite.js'); require('./packages/postcss/dist/index.js'); console.log('cjs-load-ok')"pnpm --filter @weapp-tailwindcss/typography build && pnpm --filter @weapp-tailwindcss/typography test && pnpm --filter @weapp-tailwindcss/typography tsdpnpm --filter @weapp-tailwindcss/debug-uni-app-x build && pnpm --filter @weapp-tailwindcss/debug-uni-app-x tsdpnpm exec vitest run test/index.test.ts(在packages/debug-uni-app-x目录执行)pnpm --filter tailwindcss-config build && pnpm --filter tailwindcss-config testpnpm --filter @weapp-tailwindcss/logger build && pnpm --filter @weapp-tailwindcss/logger testpnpm --filter @weapp-tailwindcss/shared build && pnpm --filter @weapp-tailwindcss/shared testpnpm exec changeset status --since origin/next --verbosepnpm exec eslint e2e/hbuilderx-local.test.ts e2e/hbuilderx-local/*.ts package.jsonpnpm exec vitest run -c ./e2e/vitest.e2e.config.ts e2e/hbuilderx-local.test.ts(默认跳过:1 个文件 skipped,6 个用例 skipped)HBUILDERX_CLI_PATH=/Applications/HBuilderX.app/Contents/MacOS/cli pnpm e2e:hbuilderx:local(通过:1 个文件 passed,6 个用例 passed)dist中作为外部import/require出现。mp-weixin编译和运行日志。备注
uniappx-projectskill 已全局安装到~/.codex/skills/uniappx-project。.agents副本。