Skip to content

feat(assets): update @routup/assets for routup v5#755

Merged
tada5hi merged 2 commits intomasterfrom
741-assets
Apr 7, 2026
Merged

feat(assets): update @routup/assets for routup v5#755
tada5hi merged 2 commits intomasterfrom
741-assets

Conversation

@tada5hi
Copy link
Copy Markdown
Contributor

@tada5hi tada5hi commented Apr 7, 2026

closes #741

Summary by CodeRabbit

  • Dependencies

    • Updated routup to ^5.0.0-beta.2
    • Removed test-specific dev dependencies
  • Refactor

    • Restructured internal handler architecture for improved framework compatibility
    • Updated request and response handling mechanisms

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

Warning

Rate limit exceeded

@tada5hi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 51 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 4 minutes and 51 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d83f09c0-fa7c-4d5f-b640-96fe62eabcd7

📥 Commits

Reviewing files that changed from the base of the PR and between 283a19b and 2bc275b.

📒 Files selected for processing (4)
  • .gitignore
  • packages/assets/README.md
  • packages/assets/src/handler.ts
  • packages/assets/test/unit/module.spec.ts
📝 Walkthrough

Walkthrough

This PR updates the @routup/assets package to support routup v5's event-based handler architecture. Changes include upgrading peerDependencies to ^5.0.0-beta.2, rewriting handlers from (req, res, next) callback pattern to async event-based handlers, replacing deprecated request utilities with event properties, and updating tests to use fetch-based validation instead of supertest.

Changes

Cohort / File(s) Summary
Package Dependencies
packages/assets/package.json
Updated routup from ^4.0.1 to ^5.0.0-beta.2 in both peerDependencies and devDependencies; removed testing dependencies @types/supertest and supertest.
Handler API Migration
packages/assets/src/handler.ts
Migrated handler from callback-based (req, res, next) to async event-based pattern using defineCoreHandler. Changed request metadata access from useRequest* utilities to event.path/event.mountPath, converted Promise chains to async/await, replaced res.setHeader/res.writeHead with event.response.headers/status setters, and updated file streaming to use Readable.toWeb for web-standard ReadableStream conversion.
Test Suite Migration
packages/assets/test/unit/module.spec.ts
Transitioned from supertest-based HTTP testing to direct in-process fetch testing via router.fetch() with Request objects; added helper functions (createTestRequest, tick) and updated assertions from supertest response properties to Fetch API semantics (response.text(), response.headers.get(), response.status).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

Poem

🐰 Handlers now dance with events so bright,
No more callbacks in the dead of night,
From req and res to async streams,
Routup five fulfills our dreams,
Web standards flow where files take flight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of updating @routup/assets for routup v5, matching the primary change in the changeset.
Linked Issues check ✅ Passed All coding requirements from issue #741 are met: routup dependency updated to ^5.0.0-beta.2, handlers rewritten to event-based API, useRequest* calls replaced with event properties, tests updated to Fetch API, and internal implementation refactored accordingly.
Out of Scope Changes check ✅ Passed All changes are directly related to the routup v5 migration. The removal of supertest/types is an in-scope cleanup necessary for the migration to the new handler API.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 741-assets

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 and usage tips.

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.

feat: update @routup/assets for routup v5

1 participant