Skip to content

test(vercel): check every server import resolves inside function - #66

Merged
larbish merged 1 commit into
mainfrom
test/import-resolution
Oct 21, 2026
Merged

larbish merged 1 commit into
mainfrom
test/import-resolution

Conversation

@larbish

@larbish larbish commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Runs the server bundle import check on the Vercel function too, not only on the node-server output.

  • Moves the check from test/e2e/bundle.test.ts to a shared expectSelfContainedBundle(serverDir) helper (test/server-bundle.ts), unchanged
  • The e2e project keeps checking .output/server, the vercel project now also checks .vercel/output/functions/__fallback.func
  • Vercel uploads the function directory alone, so an import resolving into the repo's node_modules works locally but fails once deployed

No CI change: the vercel job already runs pnpm test:vercel.

🤖 Generated with Claude Code, reviewed by @larbish before opening.

Summary by CodeRabbit

  • Tests
    • Added validation to ensure server bundles are self-contained and resolve all required imports.
    • Extended bundle integrity checks to deployed Vercel server functions.
    • Consolidated shared bundle validation for more consistent end-to-end test coverage.

@coldtea-pr-lens

Copy link
Copy Markdown

Note

The title starts with test(vercel):, so PR Lens left this pull request undrawn. Comment @pr-lens draw to draw it

github.comment.notice: false in .github/pr-lens.yml turns this note off

@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
comark-docs-layer Ready Ready Preview Oct 21, 2026 10:03am UTC

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5a073fb8-f3ec-4980-ae05-09b7884ee175
📥 Commits

Reviewing files that changed from the base of the PR and between 2a35a14 and b3abe8f.

📒 Files selected for processing: 3
  • test/e2e/bundle.test.ts
  • test/server-bundle.ts
  • test/vercel/output.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The pull request moves server-bundle import validation into a shared test helper. The end-to-end bundle test and Vercel output test both use the helper.

Changes: Server bundle validation

Layer / File(s) Summary
Shared bundle validation helper
test/server-bundle.ts
Adds a helper that scans bundled .mjs files, checks import resolution, and asserts that validation covers imports and finds no external bundle dependencies.
Use the shared helper in bundle tests
test/e2e/bundle.test.ts, test/vercel/output.test.ts
Replaces the end-to-end test’s inline checks with the helper and adds a helper call to the Vercel output test.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to b3abe

No concrete merge-blocking issue is established. The new Vercel check runs after the build in CI; validation against the generated function output remains worthwhile.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the Vercel test and the main change: verifying that server imports resolve within the deployed function bundle.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 21, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/comarkdown/comark-docs@66

commit: b3abe8f

@larbish
larbish merged commit 14016fc into main Oct 21, 2026
7 checks passed
@larbish
larbish deleted the test/import-resolution branch October 21, 2026 10:21

This branch was successfully deployed

1 active deployment
Preview — b3abe8f6 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant