refactor(cli): call isCompatibilityActionable instead of mirroring the rule
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
- 48/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- build-system, cli, tooling
Hướng nghiên cứu
Start with packages/cli/src/lib/skill-lookup.ts, packages/cli/tsconfig.json, and the CLI tsup.config.ts, then inspect packages/contracts/src/compatibility.test.ts and the existing contract export. Verify the workspace dependency, path resolution, rootDir, and bundling behavior by running the CLI bundler and executing node bin/skillx.js check --target . Done means the artifact agrees with isCompatibilityActionable for all five statuses and pnpm test passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
packages/cli/src/lib/skill-lookup.ts mirrors the compatibility actionability rule by hand:
export function isActionable(status: string | null | undefined): boolean {
return status === 'declared' || status === 'verified';
}
packages/contracts owns the real rule (isCompatibilityActionable, with the vocabulary in COMPATIBILITY_STATUSES). Two implementations of one rule is exactly the drift the cross-surface parity suite in PR #41 exists to catch — and the CLI is the one surface that suite cannot reach.
Why it was not fixed in PR #41
Making the CLI import @skillx/contracts requires changing how the published artifact is bundled:
packages/cli/tsconfig.jsonsetsrootDir: "./src", so any import outsidesrc/fails typecheck;- tsup treats
dependenciesas external by default, and@skillx/contractsships TypeScript source with no compile step, so it has to go indevDependenciesand be force-bundled (noExternal), together with the tsconfigpathsentry that the bundler needs to resolve it.
Getting that wrong breaks the npm publish path, which release-please triggers automatically on merge to main. That is a poor trade for a one-line predicate.
Mitigation already in place
packages/contracts/src/compatibility.test.ts pins COMPATIBILITY_STATUSES to an explicit list, with a comment naming this mirror. Adding a sixth status now fails that test instead of silently leaving the CLI wrong.
What the fix needs
- Add
@skillx/contractstopackages/clidevDependenciesasworkspace:*. - Add the tsconfig
pathsentry and drop or widenrootDir. - Add
noExternal: ['@skillx/contracts']totsup.config.ts. - Delete the mirrored predicate and delegate to the contract.
- Verify at the artifact level, not just in source: run the CLI bundler, then execute the resulting CLI (
node bin/skillx.js check <slug> --target <runtime>) and confirm the bundle inlined the rule instead of leaving an unresolvable import.
Acceptance
- The shipped CLI reports the same actionable decision as
isCompatibilityActionablefor all five statuses. pnpm teststill passes, and the parity test's note about the CLI limitation can be removed.
- Ngôn ngữ chính
- TypeScript
- Star
- 186
- Fork
- 40
- Merge trung bình
- 10 giờ 12 phút
- Pull request đã merge (30 ngày)
- 16
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextlevelbuilder/skillx
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nextlevelbuilder/skillx#65 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
nextlevelbuilder/skillx#63 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
nextlevelbuilder/skillx#49 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nextlevelbuilder/skillx#28 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nextlevelbuilder/skillx#27 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của nextlevelbuilder/skillx
Issue tương tự
-
ai-driven-qa bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
linagora/twake-contacts-frontend#241 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ui(ListToolbar): search takes the full row on a phone instead of sharing it with the result countĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority:high
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
ahmedkhaleel2004/gitdiagram#228 ·