[FEATURE]: Read one more project config file, named by OPENCODE_CONFIG_PROJECT_FILE

オープン 初心者向け
#61,587 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
66/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

config/discovery.tsから始めます。issueには、プロジェクト設定のファイル名は固定されていると書かれています。フォルダーの走査中にプロジェクト設定がどのように読み込まれるかを追ってください。既存の設定テストと、プロジェクト設定に関するドキュメント項目を確認してください。指定された優先順位でOPENCODE_CONFIG_PROJECT_FILEのパスが読み込まれ、変更によって再読み込みが発生し、不明なキーが引き続き無視されれば完了です。

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

説明

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Apps that bundle OpenCode often have their own settings file in the repository, like .acme/settings.json. It would help if teams could put OpenCode config in that file too, instead of adding an opencode.json beside it.

Right now the project names (opencode.json, opencode.jsonc, .opencode/) are fixed in config/discovery.ts, and no option or plugin hook can add another one.

Proposal: a projectFile config option, set from an OPENCODE_CONFIG_PROJECT_FILE env var, naming one relative path such as .acme/settings.json. OpenCode reads it in every folder of the project walk, just below that folder's opencode.json. It ranks like project config, editing it reloads config, and keys OpenCode doesn't know are ignored, as they are today.

I have it working, with a test and a docs row, in about a dozen lines: https://github.com/paulsf-cohere/opencode/commit/8b696631d1. Happy to open the PR if the approach looks good.

主要言語
TypeScript
スター
224k
フォーク
30k
平均マージ
6時間 16分
マージ済み PR(30日)
507

環境構築

はじめの一歩

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

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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