Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

src/tailwind-preset.cjs drifted from tailwind-preset.ts — missing `info` and `chart` color scales

Đang mở Phù hợp với người mới
#628 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
tailwindcss, typescript
Lĩnh vực
design, frontend

Hướng nghiên cứu

So sánh các thang màu info và chart trong src/tailwind-preset.ts với src/tailwind-preset.cjs, và kiểm tra mục safelist border-info/40 gần dòng 603 của tệp .cjs. Cách sửa nhanh là sao chép các thang màu còn thiếu vào .cjs. Hoàn thành khi node -e "require('./src/tailwind-preset.cjs')" liệt kê info và chart dưới theme.extend.colors và theme đã resolve khớp với đầu ra đã biên dịch của .ts. Hãy xác nhận với các maintainer lựa chọn giữa sao chép nhanh và sinh .cjs từ .ts trước khi chọn phương án lâu dài.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

There are two copies of the Tailwind preset:

  • src/tailwind-preset.ts — source of truth. tsup compiles it to dist/tailwind-preset.cjs/.js, which is what package consumers get via the ./tailwind-preset export. Complete.
  • src/tailwind-preset.cjs — a hand-maintained CJS twin used only by this repo's own tailwind.config.js (presets: [require('./src/tailwind-preset.cjs')]) for dev/Storybook builds.

The info and chart color scales were added to the .ts in 5ef64bff (2026-01-24, Card expansion) but never mirrored into the .cjs, which has never had them.

Impact

  • Consumers: none. The published preset is built from the .ts and is correct.
  • In-repo dev/Storybook builds: the preset doesn't define info-* / chart-* colors, so those utilities aren't generated from the preset. Notably the .cjs safelist even includes border-info/40 (~line 603) for a color it doesn't define.

Found while generating the mieweb-ui-tokens skill for #545 — the generator deliberately imports src/tailwind-preset.ts (via Node type stripping) specifically to avoid this drifted copy.

Fix options

  1. Quick: copy the info and chart scales from the .ts into the .cjs.
  2. Durable (preferred): eliminate the second copy — generate src/tailwind-preset.cjs from the .ts (or point tailwind.config.js at a build output) so it can't drift again. scripts/rtl-scan.mjs also reminds contributors to update "BOTH" files, which is the smell.

Verify

  • node -e "const p=require('./src/tailwind-preset.cjs'); console.log(Object.keys(p.theme.extend.colors))" lists info and chart
  • Storybook: info/chart utilities render (e.g. bg-info-500, text-chart-1)
  • Diff the resolved theme of .cjs vs compiled .ts to confirm zero remaining drift
Ngôn ngữ chính
TypeScript
Star
2
Fork
4
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mieweb/ui

Tất cả issue của mieweb/ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.