Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

refactor(cli): call isCompatibilityActionable instead of mirroring the rule

オープン
#48 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement

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.json sets rootDir: "./src", so any import outside src/ fails typecheck;
  • tsup treats dependencies as external by default, and @skillx/contracts ships TypeScript source with no compile step, so it has to go in devDependencies and be force-bundled (noExternal), together with the tsconfig paths entry 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

  1. Add @skillx/contracts to packages/cli devDependencies as workspace:*.
  2. Add the tsconfig paths entry and drop or widen rootDir.
  3. Add noExternal: ['@skillx/contracts'] to tsup.config.ts.
  4. Delete the mirrored predicate and delegate to the contract.
  5. 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 isCompatibilityActionable for all five statuses.
  • pnpm test still passes, and the parity test's note about the CLI limitation can be removed.
主要言語
TypeScript
スター
186
フォーク
40
平均マージ
10時間 12分
マージ済み PR(30日)
16

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nextlevelbuilder/skillx のほかの issue

nextlevelbuilder/skillx の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。