Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/move-postcss-entrypoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"weapp-tailwindcss": patch
"@weapp-tailwindcss/postcss": patch
---

将 `weapp-tailwindcss` 中生成型 PostCSS 插件、PostCSS 辅助扫描逻辑和 `css-macro/postcss` 转换入口迁入 `@weapp-tailwindcss/postcss`,主包保留兼容转发入口,方便后续统一维护 PostCSS 能力边界。
18 changes: 11 additions & 7 deletions .github/workflows/e2e-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ jobs:
watch_case: mpx-tailwindcss-v4
round_profile: default
watch_save_snapshots: '1'
watch_main_style_only: '1'
timeout_minutes: 35
watch_timeout_ms: '240000'
watch_poll_ms: '40'
Expand All @@ -187,21 +188,23 @@ jobs:
- os: windows-latest
runner_label: windows
watch_case: taro-webpack-react-tailwindcss-v4
round_profile: issue33
round_profile: default
watch_save_snapshots: '1'
timeout_minutes: 70
watch_timeout_ms: '600000'
watch_web_only: '1'
timeout_minutes: 45
watch_timeout_ms: '420000'
watch_poll_ms: '40'
watch_command_timeout_ms: '1800000'
watch_command_timeout_ms: '960000'
- os: windows-latest
runner_label: windows
watch_case: mpx-tailwindcss-v4
round_profile: default
watch_save_snapshots: '1'
timeout_minutes: 60
watch_timeout_ms: '600000'
watch_main_style_only: '1'
timeout_minutes: 35
watch_timeout_ms: '240000'
watch_poll_ms: '40'
watch_command_timeout_ms: '2400000'
watch_command_timeout_ms: '600000'
runs-on: ${{ matrix.os }}
timeout-minutes: ${{ matrix.timeout_minutes }}

Expand Down Expand Up @@ -251,6 +254,7 @@ jobs:
E2E_WATCH_MAX_ATTEMPTS: ${{ matrix.watch_max_attempts || '2' }}
E2E_WATCH_ROUND_PROFILE: ${{ matrix.round_profile }}
E2E_WATCH_WEB_ONLY: ${{ matrix.watch_web_only || '0' }}
E2E_WATCH_MAIN_STYLE_ONLY: ${{ matrix.watch_main_style_only || '0' }}
E2E_WATCH_SAVE_SNAPSHOTS: ${{ matrix.watch_save_snapshots }}
NODE_OPTIONS: --max-old-space-size=6144
run: pnpm e2e:watch
Expand Down
27 changes: 25 additions & 2 deletions e2e/watch/taro-demo-dev.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ const TARGETS = [
'taro-webpack-vue3-tailwindcss-v4',
]
const STABLE_AFTER_READY_MS = 8_000
const DEFAULT_READY_TIMEOUT_MS = 180_000
const DEFAULT_TEST_TIMEOUT_MS = 240_000

function toNumberEnv(name: string, fallback: number) {
const value = process.env[name]
if (!value) {
return fallback
}
const numeric = Number(value)
return Number.isFinite(numeric) ? numeric : fallback
}

function resolveTaroDevReadyTimeoutMs() {
return Math.max(DEFAULT_READY_TIMEOUT_MS, toNumberEnv('E2E_WATCH_TIMEOUT_MS', DEFAULT_READY_TIMEOUT_MS))
}

function resolveTaroDevTestTimeoutMs() {
return Math.max(
DEFAULT_TEST_TIMEOUT_MS,
resolveTaroDevReadyTimeoutMs() + STABLE_AFTER_READY_MS + 60_000,
)
}

async function stopProcessTree(child: ReturnType<typeof spawnPnpm>) {
const pid = child.pid
Expand All @@ -41,6 +63,7 @@ async function stopProcessTree(child: ReturnType<typeof spawnPnpm>) {
}

async function expectDemoDevWatchReady(project: string) {
const readyTimeoutMs = resolveTaroDevReadyTimeoutMs()
const cwd = `${ROOT}/demo/${project}`
const child = spawnPnpm(['dev'], {
cwd,
Expand Down Expand Up @@ -87,7 +110,7 @@ async function expectDemoDevWatchReady(project: string) {

try {
const startedAt = Date.now()
while (Date.now() - startedAt < 180_000) {
while (Date.now() - startedAt < readyTimeoutMs) {
if (ready) {
break
}
Expand Down Expand Up @@ -144,6 +167,6 @@ describe('e2e watch taro demo dev entry', () => {
for (const target of targets) {
it(`keeps ${target} pnpm dev in watch mode`, async () => {
await expectDemoDevWatchReady(target)
}, 240_000)
}, resolveTaroDevTestTimeoutMs())
}
})
14 changes: 13 additions & 1 deletion packages/postcss/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
"import": "./dist/html-transform.mjs",
"require": "./dist/html-transform.js"
},
"./css-macro/postcss": {
"types": "./dist/css-macro/postcss.d.ts",
"import": "./dist/css-macro/postcss.mjs",
"require": "./dist/css-macro/postcss.js"
},
"./package.json": "./package.json"
},
"main": "./dist/index.js",
Expand All @@ -40,6 +45,9 @@
"html-transform": [
"./dist/html-transform.d.ts"
],
"css-macro/postcss": [
"./dist/css-macro/postcss.d.ts"
],
"types": [
"./dist/types.d.ts"
],
Expand Down Expand Up @@ -72,12 +80,16 @@
"@weapp-tailwindcss/shared": "workspace:*",
"autoprefixer": "catalog:autoprefixer10",
"lru-cache": "11.5.1",
"micromatch": "^4.0.8",
"postcss": "catalog:postcss85tilde",
"postcss-load-config": "^6.0.1",
"postcss-pxtrans": "^1.0.4",
"postcss-rem-to-responsive-pixel": "catalog:postcssRem",
"postcss-rule-unit-converter": "^0.2.2",
"postcss-selector-parser": "~7.1.2",
"postcss-value-parser": "^4.2.0"
"postcss-value-parser": "^4.2.0",
"tailwindcss-config": "workspace:*",
"tailwindcss-patch": "catalog:tailwindcssPatch"
},
"devDependencies": {
"@csstools/css-color-parser": "^4.1.1",
Expand Down
Loading
Loading