Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Fermée
#239 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@abelzach y travaille déjà.

Depuis le 21/10/2026.

  • #288 par @abelzach — fusionnée

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
75/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
TypeScript
Étoiles
13
Forks
7
Merge moyen
3 h 28 min
PR mergées (30 j)
182

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de codercops/chatcops

Toutes les issues de codercops/chatcops

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.