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

upgrade: upstream CSS codemods parse stylesheets as JS

Đang mở
#67 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ó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
66/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ệ
css, typescript
Lĩnh vực
cli, tooling

Hướng nghiên cứu

Start in packages/cli/codemods/upstream.mjs at wrapAstryxTransform, and check how it picks the parser for each file. The bug is that .css files reach the jscodeshift parser instead of the transform's postcss path. Reproduce by running the migrate-deprecated-theme-surface codemod over a stylesheet with an @layer rule. Done when CSS files are transformed without parse errors and JS/TS files still use the jscodeshift path.

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

Mô tả

ui-common upgrade --from 0.2.0-alpha.18 (CLI 0.2.0-alpha.19) runs Astryx's migrate-deprecated-theme-surface codemod over .css files as if they were JS, and every stylesheet fails:

src/index.css (astryx:migrate-deprecated-theme-surface): produced unparseable output, not applied: Leading decorators must be attached to a class declaration. (19:7)
src/components/BAISider.css (astryx:migrate-deprecated-theme-surface): produced unparseable output, not applied: Unexpected token (12:0)

The @layer at-rule is read as a decorator. Running the same codemod with Astryx's own CLI (ui-common astryx upgrade --from 0.6.5 --path src) transforms those files through postcss, so the problem is in how packages/cli/codemods/upstream.mjs wraps an Astryx transform (wrapAstryxTransform): a CSS file should reach the transform's postcss path, not the jscodeshift parser.

Seen while moving backend.ai-webui to alpha.19 (lablup/backend.ai-webui#10327). Note also that Astryx's postcss path rewrites <style> inside CSS comments to \3c style>, so a consumer should review that diff either way.

Ngôn ngữ chính
TypeScript
Star
2
Fork
0
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
32

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 lablup/ui-common

Tất cả issue của lablup/ui-common

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.