fix(typegen): move fmdapi/fmodata from optional peerDeps to dependencies#200
Conversation
When run via npx, the isolated environment doesn't auto-install optional peer dependencies, causing ERR_MODULE_NOT_FOUND for @proofkit/fmodata. Both packages are imported unconditionally at runtime, so they must be regular dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: dc9b29a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@chriscors is attempting to deploy a commit to the Proof Geist Team on Vercel. A member of the Team first needs to authorize it. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@proofkit/better-auth
@proofkit/cli
create-proofkit
@proofkit/fmdapi
@proofkit/fmodata
@proofkit/typegen
@proofkit/webviewer
commit: |
- Move entry-point guidance to package-specific skills - Drop obsolete typegen skill and bin export - Refresh skill tree and changelog
Bug
Running
npx @proofkit/typegen(v1.1.0-beta.21) fails immediately with:Root cause
In the published typegen package,
@proofkit/fmdapiand@proofkit/fmodataare declared as optional peer dependencies (withpeerDependenciesMeta.optional: true). They are also listed indevDependencies, which means they're available during local development and CI — but are not included when a user installs the package.When
npxruns typegen, it creates an isolated environment and installs onlydependencies. Optional peer dependencies are not auto-installed, so both@proofkit/fmdapiand@proofkit/fmodataare missing at runtime.However, both packages are imported unconditionally via static
importstatements:src/fmodata/downloadMetadata.ts→import { FMServerConnection } from "@proofkit/fmodata"src/server/createDataApiClient.ts→import { Database, FMServerConnection } from "@proofkit/fmodata"src/fmodata/generateODataTypes.ts→ generates code referencing@proofkit/fmodataThese imports are pulled in through the main
typegen.tsentry point, meaning the CLI crashes on startup before any user code runs — regardless of whether the user's project actually uses fmodata.Fix
Moved
@proofkit/fmdapiand@proofkit/fmodatafrom optionalpeerDependencies+devDependenciesinto regulardependencies. This ensures they are always installed alongside typegen, matching the fact that they are unconditionally imported at runtime.Removed the now-unnecessary
peerDependenciesandpeerDependenciesMetasections entirely.Test plan
fmdapi,fmodata,typegen)/tmpdirectory to simulatenpxbehaviornpx typegen --helpruns successfully withoutERR_MODULE_NOT_FOUND🤖 Generated with Claude Code
Summary by CodeRabbit