postgres({ config }) resolves from the working directory, but the guide says relative to the module file
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
Read packages/1-prisma-cloud/1-extensions/target/src/orm-postgres.ts, then trace how config reaches resolveOrmConfig in packages/1-prisma-cloud/1-extensions/target/src/descriptors/orm-postgres.ts and loadConfig in packages/1-prisma-cloud/1-extensions/target/src/orm-config.ts. Compare that path handling with the guide and ADR-0004; the issue is resolved when module-relative behavior matches the documented rule or the guide is corrected. The report was inferred from source and was not reproduced.
索引モデルが issue の本文から書いたものです。
説明
Composer 0.40.0, prisma/orm 8.0.0-rc.25.
Inferred from source at v0.40.0; not reproduced.
- The guide promises module-relative resolution:
docs/guides/building-an-app.mdlines 240-243, "naming theprisma.config.tspath (relative to the module file) so the deploy can reload the emittedcontract.jsonand findmigrations/". ADR-0004 ("paths resolve relative to the authoring file") states the same rule for authoring paths in general. - The code does not:
PostgresResourceNodekeepsconfigas given (packages/1-prisma-cloud/1-extensions/target/src/orm-postgres.ts). The lowering passes it unchanged,resolveOrmConfig(node.config)(packages/1-prisma-cloud/1-extensions/target/src/descriptors/orm-postgres.tsline 43), which callsloadConfig(configPath)with nocwd(packages/1-prisma-cloud/1-extensions/target/src/orm-config.tsline 51). The ORM resolves a relative path againstprocess.cwd():const cwd = options?.cwd ?? process.cwd(); const resolvedConfigPath = configPath ? resolve(cwd, configPath) : undefined;(prisma/ormv8.0.0-rc.25,packages/1-framework/3-tooling/config-loader/src/load.tslines 276-277).prisma devandprisma deployconverge with the working directory set to where the command ran (packages/0-framework/3-tooling/cli/src/operations/execute-dev.tsline 305, theDEV.WORKER_THREADexplanation;packages/0-framework/3-tooling/cli/src/converge-process.ts). - Composer's own nested example steps around it:
examples/store/modules/catalog/src/module.tsline 20 builds an absolute path,const config = fileURLToPath(new URL('../prisma.config.ts', import.meta.url));. - Effect: a module in a subdirectory that passes
config: './prisma.config.ts', meaning the file beside the module as the guide says, gets theprisma.config.tsin the directory the command runs from instead. A rootmodule.tsbesideprisma.config.ts, run from that directory, works under both readings. - Expected:
configresolves relative to the file that callspostgres(), as the guide and ADR-0004 say, or the guide says otherwise.
Found while writing the Composer docs on prisma.io (prisma/web#8965). The docs do not work around this.
- 主要言語
- TypeScript
- スター
- 6
- フォーク
- 2
- 平均マージ
- 1日 2時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prisma/composer のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
prisma/composer の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tenstorrent/ttnn-visualizer#2526 ·
メンテナーはふだん 1 日以内に返信
-
trySessionCache calls /get-session twice when minting session_data (cache miss or expired cookie)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
neondatabase/neon-js#301 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tashfeenahmed/freellmapi#2305 ·
メンテナーはふだん 1 日以内に返信