Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

objectui doctor 把「没有 tailwind.config.js」算成一条 issue —— 在 Tailwind 4 项目上这是错的建议(本仓自己零个该文件,doctor 跑在仓根就误报) #3891

Closed

Description

@yinlianghui

越界发现,记录于 #3852(生成物 Tailwind 4 迁移)实施期间。#3852 的文件面是 app-generator.ts 的生成物与 commands/dev.ts;这一条是 commands/doctor.ts 的诊断逻辑,不同命令、不同面。

事实(核于 origin/main = 56ff0916e)

packages/cli/src/commands/doctor.ts:52-74:

// 2. Check tailwind.config.js
const tailwindConfigPath = join(cwd, 'tailwind.config.js');
const tailwindTsPath = join(cwd, 'tailwind.config.ts');
if (existsSync(tailwindConfigPath) || existsSync(tailwindTsPath)) {
   ...
   if (configContent.includes('content') && (configContent.includes('./src') || ...)) {
     console.log(chalk.green('✓ Tailwind content paths configured'));
   } else {
     console.log(chalk.yellow('⚠️ Tailwind content paths may not be configured. ...'));
     issues++;
   }
} else {
  console.log(chalk.yellow('⚠️ tailwind.config.js not found'));
  issues++;
}

三点都与 Tailwind 4 相反:

  1. v4 不需要这个文件,而且没有 @config 指向它时它是死文件。本仓自己就是证据:tailwind.config.* 在 tracked 文件里 0 个(components README §Setup 第 1 步仍是 Tailwind 3 写法(叫读者写 tailwind.config.js),而该包是 v4 CSS-first、全仓没有这个文件 #3780 也记过这条),而 6 份 postcss.config.* 全部写 '@tailwindcss/postcss': {}。所以在本仓根跑 objectui doctor 会稳定报出一条不存在的问题并让 issues++。
  2. content 数组在 v4 里已被 @source 取代,所以第二条分支("content paths configured")即使文件存在也是在检查一个 v4 不读的键。
  3. 同一函数上面几行(doctor.ts:36-42)只检查 tailwindcss 是否被声明,不看 major,也不检查 v4 真正需要的 @tailwindcss/postcss —— 一个 v4 项目缺了后者会 PostCSS 加载失败(packages/cli 生成的临时 app 是 Tailwind 3 全套(CSS 指令/postcss 插件键/config 文件),而仓内是 v4 且 components peer 写 ^4.2.1 —— 仓内 objectui dev 的 CSS 管线今天就是死的 #3852 记录的正是这个失败形态),doctor 却报 ✓ Tailwind CSS installed。

影响

objectui doctor 的产出是"issues 数 + 建议"。对任何 v4 项目(含本仓),它今天:少报真问题(缺 @tailwindcss/postcss)、多报假问题(缺 tailwind.config.js),并把读者推向去补一个 v4 不会读的文件。属于用户可见的错误建议,不是 dormant。

不预判修法

要判的一格:doctor 该只支持 v4(检查 @tailwindcss/postcss 声明 + CSS 入口里的 @import 'tailwindcss'/@source),还是同时容忍 v3 项目(按 tailwindcss 的 major 分流两套检查)。前者与本仓 v4-only 的现状一致且简单;后者对仓外老项目更友好但要维护两条路径。留给维护者定。

已搜重

本仓开放 issue 搜过 objectui init doctor scaffold、tailwind、标题含 cli 三组:tailwind 一组命中 #3852(生成物,已在实施)、#3883(theming/troubleshooting 文档面)、#3884(quick-start 的 @source 行)、#3855/#3787(无关文档面),没有一条覆盖 doctor.ts。

Activity

  1. os-zhuang commented on Aug 9, 2026

    @os-zhuang
    Contributor

    Triage: pm:queue (sister-repo card: pm-state only, no domain:* here).

    本评论来自分诊座位 Routine(#5474 试点),不构成认领。


    Generated by Claude Code

  2. os-project-manager commented on Aug 9, 2026

    @os-project-manager
    Collaborator

    Release board: target:v17 applied — class ④, the shipped objectui doctor command reports a false issue ("no tailwind.config.js") on every Tailwind 4 project and misses the check that matters (@tailwindcss/postcss), so it both under-reports the real failure and pushes first-hour users toward creating a file v4 never reads. One-time stock pass per objectstack#6904 (maintainer directive 2026-08-09).


    Generated by Claude Code

  3. self-assigned this
    on Aug 10, 2026
  4. yinlianghui commented on Aug 10, 2026

    @yinlianghui
    ContributorAuthor

    Claim: PM loop round 1.5 (objectui whole-repo seat, v17 board priority — maintainer raised the concurrency target to 5 on 2026-08-10, so this card is pulled forward from the planned round 2)
    Session: session_017Qqyix2QcnpUC9XeYVDzx3
    Branch: claude/issue-3891-doctor-tailwind4
    Worktree: objectui-issue-3891
    Domain: repo:objectui (whole-repo seat — no domain:* in this repo)
    File surface — region-exclusive vs the in-flight #3892 (same package): packages/cli/src/commands/doctor.ts + doctor-specific tests ONLY. ⛔ Must not touch init.ts, app-generator.ts, or app-generator.test.ts (those are #3892's declared surface). Merge origin/main before opening the PR, and again after the sibling lands; conflicts, if any, go to the merge queue — no manual ordering.
    Container & model: M, mode:subagent, model: opus
    Serial constraints cleared: #3892 in flight on init.ts (disjoint file, region declared above); #3852 (app-generator.ts/dev.ts) CLOSED; #3827 MERGED. No other open claim or PR touches doctor.ts.

    Premise re-verified at dispatch on origin/main (11c1e71): doctor.ts:72 still prints "⚠️ tailwind.config.js not found"; zero hits for @tailwindcss/postcss in doctor.ts.


    Generated by Claude Code

  5. yinlianghui commented on Aug 10, 2026

    @yinlianghui
    ContributorAuthor

    ACCEPT (objectui seat PM, session session_017Qqyix2QcnpUC9XeYVDzx3, review of record) — PR #4064.

    What shipped: objectui doctor's Tailwind section rewritten to the v4 contract per the triage direction (v4-only; no dual path). A missing tailwind.config.* no longer produces any finding; a present-but-inert one is named (judged by @config opt-in, not the v3 content key); @tailwindcss/postcss is now checked (declared or workspace-provided), the PostCSS config's v3 spelling is diagnosed independently of the v4 one, the CSS entry's @import 'tailwindcss' is verified, and the declared major is read. runDiagnostics() split from rendering makes the matrix testable; 21 new tests pin verdicts by stable id. Changeset: @object-ui/cli patch.

    Review notes: 3 files exactly in the declared region (doctor.ts, new doctor.test.ts, changeset) — init.ts/app-generator.* untouched as required vs the concurrent #3892. Before/after evidence measured against the REAL origin/main doctor in three real directories (correct v4 app: false positive gone; inert-config app: false green replaced by a true finding; repo root: clean). Reverse verification predicted red beforehand and produced 6/21 red on re-introducing the deleted branch. Bonus catch: the createRequire().resolve() probe was falsified under vitest's NODE_PATH and replaced with a filesystem walk — the "missing plugin" branch is now genuinely covered both ways. The dev also corrected the issue body upward (repo tracks TWO inert v3 configs that the old check false-greened — the headline root-false-positive claim still holds), and filed #4065 / #4066 as observation-class findings. All 20 checks completed: 18 success / 2 skipped / 0 failures (Lint, Type Check, 4 shards individually verified).

    Landing next: flipping ready and driving to MERGED.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions