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

Don't load the provider SDKs when @chatcops/core is imported

クローズ
#239 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

@abelzach がすでに取り組んでいます。

2026年10月21日 から。

  • #288 @abelzach による — マージ済み

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript

調査の方向性

Read packages/core/src/index.ts, packages/core/src/providers/index.ts, and packages/core/package.json, then trace how the build emits package entry points and tests are run. Remove the provider classes from the main exports, add typed subpath exports and the regression test described in the issue, and update the changeset. Done when the main entry does not statically load provider SDKs, all three subpaths work, and the stated checks pass.

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

説明

core enhancement hacktoberfest help wanted

createProvider loads each provider's SDK with a dynamic import() (packages/core/src/providers/base.ts, lines 10 to 27), so only the one you use should load. But packages/core/src/index.ts, line 51, and packages/core/src/providers/index.ts, lines 12 to 14, also re-export ClaudeProvider, OpenAIProvider and GeminiProvider directly. That's a static import of all three SDKs, so importing anything from @chatcops/core (even FAQKnowledgeSource) loads @anthropic-ai/sdk, openai and @google/genai. That costs startup time on every serverless cold start.

What to do

  • Stop re-exporting the three provider classes from packages/core/src/index.ts and packages/core/src/providers/index.ts.
  • Make them importable from subpaths instead: @chatcops/core/providers/claude, /openai and /gemini. Add them to exports in packages/core/package.json with types and import, the same shape as ".".
  • Leave the SDKs in dependencies. Making them optional is a separate decision.
  • Add a test that fails if the main entry loads an SDK again. One way: after the build, read dist/index.js, follow its static import ... from './x.js' statements (not import()) through dist, and check that none of the reached files import one of the three SDK packages.
  • Mention the moved classes in the changeset. Nothing in our docs imports them, but someone's code might.

Where to look

  • packages/core/src/index.ts, packages/core/src/providers/index.ts, packages/core/package.json
  • pnpm publint (in CI) checks the new exports entries

Acceptance criteria

  • import { FAQKnowledgeSource } from '@chatcops/core' loads no provider SDK, and the new test proves it (and fails if you put the re-export back; say in the PR that you tried)
  • import { ClaudeProvider } from '@chatcops/core/providers/claude' works, with types
  • createProvider works as before for all three types
  • pnpm publint passes
  • Changeset for @chatcops/core (minor, with the move noted)
  • pnpm test:coverage and pnpm lint pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

主要言語
TypeScript
スター
13
フォーク
7
平均マージ
3時間 33分
マージ済み PR(30日)
176

環境構築

はじめの一歩

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

codercops/chatcops のほかの issue

codercops/chatcops の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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