Replace the vendored analyzer with a dependency once @codepact/core is published

Đang mở
#3 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
github-actions, javascript, node.js
Lĩnh vực
build-system, devtools

Hướng nghiên cứu

Read VENDORING.md and compare src/comments.js, src/parse.js, and src/analyze.js with the corresponding codepact-core modules. Check the status of codepact-core#8 and PR #11 first, since the issue recommends waiting for parity work to land. Once that dependency is published, add a pinned @codepact/core dependency and lockfile, remove the duplicated source and VENDORING.md, then run the self-test job; done means no src/ file duplicates codepact-core and the self-test passes unchanged.

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

Mô tả

enhancement

Context

src/comments.js, src/parse.js and src/analyze.js are hand-ported CommonJS copies of the same modules in codepact-core. The reasoning is in VENDORING.md: a using: node20 action has no install step, so it can only depend on code committed to the repository, and committing readable source beats committing a minified bundle.

It is still duplication, and duplication drifts.

What needs to happen

  1. Publish @codepact/core to npm with a real version.
  2. Add it as a dependency here, with a committed lockfile.
  3. Either commit node_modules for that single dependency-free package, or add a dist/ build step — whichever keeps review honest. Since @codepact/core has no transitive dependencies, committing it is a handful of readable files, not a vendored ecosystem.
  4. Delete the vendored copies and the VENDORING.md rules that exist only to police them.
  5. Pin the version and adopt upstream changes deliberately, so an upstream release cannot change what a consumer's @v1 build does without a commit here.

Why not yet

Publishing to npm is a one-way door: the name is claimed permanently and consumers start depending on the API. The parser API should settle first — codepact-core#1 and #2 both change what parseContractErrors returns.

Update: codepact-core#1 and #2 are now closed, resolved respectively by merged PRs codepact-core#6 (qualified attribute paths) and codepact-core#13 (constant discriminants). So this issue is unblocked on the API-settling front. The remaining open question is whether this repo's own vendored-analyzer parity (tracked in #8, with a fix proposed in open PR #11, not yet merged) should land first, so the npm-published version and this repo's current vendored copy are behaviourally identical before the swap.

Blocked on

  • codepact-core#1 (qualified attribute paths) — closed, via codepact-core#6.
  • codepact-core#2 (constant discriminants) — closed, via codepact-core#13.
  • Recommend waiting on #8 (vendored-analyzer parity) landing first, so the swap to a published dependency doesn't also silently change behaviour at the same time.

Acceptance

  • No file in src/ here duplicates a file in codepact-core.
  • The self-test job passes unchanged, proving behaviour did not shift during the swap.
Ngôn ngữ chính
JavaScript
Star
0
Fork
0
Merge trung bình
7 giờ 28 phút
Pull request đã merge (30 ngày)
10

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 codepacct/codepact-action

Tất cả issue của codepacct/codepact-action

Issue tương tự

Thêm issue về JavaScript

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.