fix: enforce events-inmemory runtime dependency contract - #789
Conversation
📝 WalkthroughWalkthrough
Changesnormalize-packages --check 모드 의존성 누락 감지 테스트
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
📊 Benchmark Results❌ Some benchmarks failed Gate failures
Updated: 2026-06-15T06:55:02.277Z · Commit: cb0060b |
84a6a1b to
7fc85b0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/tests/normalize-packages.spec.ts`:
- Around line 563-575: The peer-declared test case uses only import type syntax
in the sourceContent for the package at line 573, which does not create a
runtime import path. To properly test runtime peer dependency validation, change
the import type statement to a regular import statement (without the type
keyword) so that the test actually exercises the runtime import scenario that
the peerDependencies declaration should allow.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 28e67c14-c8ef-4829-a4b9-202ad0b13ccc
📒 Files selected for processing (1)
scripts/tests/normalize-packages.spec.ts
Fixes #563.
Summary
@croco/events-inmemorynow has issue-specific regression coverage for its direct OpenTelemetry runtime import contract. The fixture mirrors the in-memory event bus importingcontext,trace, andSpanStatusCodefrom@opentelemetry/apiwhile only declaring@croco/telemetry-api, and proves the package manifest checker fails that transitive-dependency leakage.The same coverage confirms declared runtime dependencies, runtime peer dependencies, optional dynamic imports, built-in modules, and type-only imports remain accepted, while runtime imports satisfied only by
@types/*, dev-only dependencies, or no declaration fail manifest validation.Verification
pnpm exec vitest run scripts/tests/normalize-packages.spec.ts --reporter verbose- passed, 11 tests.pnpm package-manifests:check- passed, 97 checked / 2 private skipped.pnpm changeset-required:check -- --base origin/trunk --head HEAD- passed, no publishable package behavior changes detected.git diff --check origin/trunk...HEAD- passed.pnpm check- passed.pnpm --filter @croco/events-inmemory build- passed.pnpm --filter @croco/events-inmemory typecheck- passed.pnpm --filter @croco/events-inmemory test- passed, 35 tests.pnpm package-entrypoints:smoke- passed, 96 public packages;@croco/events-inmemoryresolved through CJS, ESM, and TypeScript consumers.pnpm testpassed 197/197 tasks, and full cachedpnpm typecheckpassed 196/196 tasks.14b61e6passed:validate,benchmark,changes, and WIP. Docs checks were skipped by path filters.Self-review
packages/events-inmemory/package.jsondeclares@opentelemetry/apias^1.9.0, package-entrypoint smoke proves a clean consumer can resolve@croco/events-inmemory, and the new manifest fixture proves the issue shape fails when OTel runtime values are only available transitively.trunkafter fix: enforce direct runtime dependency declarations #778. The pre-rebase all-import approach had a type-only/runtime edge; resolving againsttrunkkept the existing runtime classifier and narrowed this PR to [events-inmemory] Runtime OpenTelemetry API import is undeclared #563 evidence.Risk
Low. The PR only strengthens regression coverage for an existing manifest validation path.