Repository navigation
sdk: scaffold @pagespace/sdk package - #1780
Conversation
Failing test asserting SDK_VERSION/MIN_SERVER_API_VERSION exports and build/typecheck/test scripts, plus the package.json/tsconfig/vitest harness needed to run it. Fails because src/index.ts does not exist yet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMFSFJChydanBadPdJADvF
- src/index.ts exports SDK_VERSION and a reserved MIN_SERVER_API_VERSION (ADR 0001 D3; cross-check against API_CONTRACT_VERSION deferred until packages/lib/src/api-contract-version.ts exists, noted in README) - tsconfig.json/tsconfig.build.json use NodeNext module+moduleResolution (required for 'type: module' + package.json exports-field resolution, including Node's self-referencing-package feature the scaffold test exercises) with an empty 'paths' override so typecheck genuinely resolves '@pagespace/sdk' through the exports map rather than aliasing around it - pretypecheck/pretest hooks build the package first, since both the entry test and tsc's own resolution of '@pagespace/sdk' need dist/ to exist - runtime deps: zod only, per epic non-negotiable Gate green from a clean worktree: bun install && bun run --filter '@pagespace/sdk' typecheck && bun run --filter '@pagespace/sdk' test Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMFSFJChydanBadPdJADvF
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
packages/sdk(@pagespace/sdk) per Phase 2 task 1 (task pagei1nkmoax9kp7h1rwqg82eq4d):package.json("type": "module", rootexportsentry,build/typecheck/testscripts wired forbun run --filter),tsconfig.json/tsconfig.build.json,vitest.config.ts— mirroringpackages/libconventions, no vitest aliases.src/index.tsexportsSDK_VERSIONand reservesMIN_SERVER_API_VERSIONper ADR 0001 D3; the repo-levelMIN_SERVER_API_VERSION <= API_CONTRACT_VERSIONassertion is deferred untilpackages/lib/src/api-contract-version.tsexists (noted in the package README).src/__tests__/scaffold.test.ts) imports@pagespace/sdkby its published name (not a relative path) to prove real installability, and asserts the required scripts exist.zod, per epic non-negotiable Activate client telemetry for monitoring dashboards #4.Notes for reviewers
tsconfig.jsonoverridesmoduleResolution/moduletoNodeNextand clears the inherited root"@pagespace/*"path-alias wildcard ("paths": {}). Without this,tscwould silently resolve the self-import via a source alias instead of genuinely validating theexportsmap — the empty override forces realpackage.json-exports resolution (matching how Vitest/Node already resolve it via Node's self-referencing-package feature).pretypecheck/pretesthooks runbun run buildfirst, since bothtsc's own resolution of@pagespace/sdkand the entry test needdist/to exist.Test plan
bun install && bun run --filter '@pagespace/sdk' typecheck && bun run --filter '@pagespace/sdk' testgreen from a clean worktree (dist removed before each run)Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01EMFSFJChydanBadPdJADvF