Skip to content

feat(decorators)!: bump routup to ^5.0.0 and migrate preset to @trapi…#787

Merged
tada5hi merged 2 commits intomasterfrom
feat/routup-5-trapi-core
May 5, 2026
Merged

feat(decorators)!: bump routup to ^5.0.0 and migrate preset to @trapi…#787
tada5hi merged 2 commits intomasterfrom
feat/routup-5-trapi-core

Conversation

@tada5hi
Copy link
Copy Markdown
Contributor

@tada5hi tada5hi commented May 5, 2026

…/core

  • bump peer routup to ^5.0.0 across all packages
  • replace @trapi/metadata peer dep with @trapi/core runtime dep on @routup/decorators
  • preset sources now import from @trapi/core
  • generateSwagger only accepts pre-built metadata: tests + docs call generateMetadata first
  • export preset as default from @routup/decorators/preset

Summary by CodeRabbit

  • Chores

    • Updated all packages to stable Routup 5.0.0 from beta.6
    • Added @trapi/core as a runtime dependency for the decorators package
  • Documentation

    • Clarified decorators preset usage and OpenAPI generation workflow
    • Updated documentation with customization and dependency guidance
  • Tests

    • Updated preset tests to reflect new metadata generation approach

…/core

- bump peer routup to ^5.0.0 across all packages
- replace @trapi/metadata peer dep with @trapi/core runtime dep on @routup/decorators
- preset sources now import from @trapi/core
- generateSwagger only accepts pre-built metadata: tests + docs call generateMetadata first
- export preset as default from @routup/decorators/preset
Copilot AI review requested due to automatic review settings May 5, 2026 13:03
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR migrates the Routup ecosystem from beta 6 to stable release 5.0.0 across all packages, and refactors the decorators package to adopt TRAPI's new @trapi/core API split, changing the preset from a named export to a default export.

Changes

Decorators TRAPI Core Migration

Layer / File(s) Summary
Dependency & Export Shape
packages/decorators/package.json, packages/decorators/src/preset/index.ts
peerDependencies.routup moves to stable ^5.0.0; dependencies gains @trapi/core as runtime; preset switches from named to default export.
Core Import Migration
packages/decorators/src/preset/class.ts, packages/decorators/src/preset/method.ts, packages/decorators/src/preset/parameter.ts, packages/decorators/src/preset/swagger.ts, packages/decorators/src/preset/module.ts
Decorator handler imports (ControllerHandler, setMethodPath, ParamKind, Preset type, etc.) migrate from @trapi/metadata to @trapi/core.
Test Refactoring
packages/decorators/test/unit/preset/v2.spec.ts, packages/decorators/test/unit/preset/v3.spec.ts
Tests now call generateMetadata() prior to generateSwagger(), passing explicit preset and entry-point config, instead of embedding preset construction inline.
Documentation Updates
packages/decorators/README.md, packages/docs/src/decorators/index.md
OpenAPI generation examples updated to use generateMetadata() with string-based preset specifier; dependency notes clarify @trapi/core is bundled and generators (@trapi/metadata, @trapi/swagger) are dev-only.

Routup 5.0.0 Stable Release Update

Layer / File(s) Summary
Peer & Dev Dependency Bumps
package.json, packages/assets/package.json, packages/basic/package.json, packages/body/package.json, packages/cookie/package.json, packages/i18n/package.json, packages/prometheus/package.json, packages/query/package.json, packages/rate-limit-redis/package.json, packages/rate-limit/package.json, packages/swagger-ui/package.json
All peerDependencies.routup and devDependencies.routup constraints updated from ^5.0.0-beta.6 to ^5.0.0 across the monorepo.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • routup/plugins#779: TRAPI v2 migration for decorators/swagger presets with similar import and preset builder refactoring.
  • routup/plugins#783: Decorators preset code/export restructuring aligned with this PR's migration.
  • routup/plugins#764: Parallel Routup v5 support changes to the decorators package.

Poem

🐰 From beta burrows to stable ground,
We hop toward Routup's release profound,
TRAPI's core now guides our way,
Presets export in style today,
Decorators dance with metadata's song!

🚥 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 changes: bumping routup to stable 5.0.0 and migrating the preset to @trapi/core, which are the primary objectives.
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.

✏️ 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 feat/routup-5-trapi-core

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/decorators/package.json (1)

64-64: ⚡ Quick win

@trapi/core is a pre-release (beta) runtime dependency shipped in dependencies.

All consumers of @routup/decorators will transitively receive @trapi/core@^2.0.0-beta.3 — a pre-release package — as a hard production dependency. This exposes downstream users to any breaking changes between beta versions before a stable 2.x is available. Consider documenting this in the release notes, and plan to tighten the pin to ^2.0.0 once the stable release lands.

🤖 Prompt for 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.

In `@packages/decorators/package.json` at line 64, The package currently declares
a pre-release runtime dependency "@trapi/core": "^2.0.0-beta.3" which will ship
to consumers; either move that entry from dependencies into devDependencies if
"@trapi/core" is only needed at build/test time, or if it is truly a runtime
requirement, add a release note documenting the beta risk and schedule a
follow-up change to tighten the dependency to "^2.0.0" (or a more restrictive
stable range) once the stable `@trapi/core` 2.x is published; update the
package.json dependency entry "@trapi/core": "^2.0.0-beta.3" accordingly and add
an entry in the CHANGELOG/release notes describing this decision.
🤖 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 `@packages/basic/package.json`:
- Around line 66-74: package.json references "routup": "^5.0.0" (both in the
top-level and devDependencies) but that tag isn't published; change both
"routup" entries back to a published beta such as "^5.0.0-beta.8" (or remove the
bump and leave the previous semver) so installs resolve correctly, or hold the
PR until routup@5.0.0 is released.

---

Nitpick comments:
In `@packages/decorators/package.json`:
- Line 64: The package currently declares a pre-release runtime dependency
"@trapi/core": "^2.0.0-beta.3" which will ship to consumers; either move that
entry from dependencies into devDependencies if "@trapi/core" is only needed at
build/test time, or if it is truly a runtime requirement, add a release note
documenting the beta risk and schedule a follow-up change to tighten the
dependency to "^2.0.0" (or a more restrictive stable range) once the stable
`@trapi/core` 2.x is published; update the package.json dependency entry
"@trapi/core": "^2.0.0-beta.3" accordingly and add an entry in the
CHANGELOG/release notes describing this decision.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1e160d15-1615-4108-9da4-0ca345fb8a35

📥 Commits

Reviewing files that changed from the base of the PR and between 7d96957 and 311df49.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (22)
  • package.json
  • packages/assets/package.json
  • packages/basic/package.json
  • packages/body/package.json
  • packages/cookie/package.json
  • packages/decorators/README.md
  • packages/decorators/package.json
  • packages/decorators/src/preset/class.ts
  • packages/decorators/src/preset/index.ts
  • packages/decorators/src/preset/method.ts
  • packages/decorators/src/preset/module.ts
  • packages/decorators/src/preset/parameter.ts
  • packages/decorators/src/preset/swagger.ts
  • packages/decorators/test/unit/preset/v2.spec.ts
  • packages/decorators/test/unit/preset/v3.spec.ts
  • packages/docs/src/decorators/index.md
  • packages/i18n/package.json
  • packages/prometheus/package.json
  • packages/query/package.json
  • packages/rate-limit-redis/package.json
  • packages/rate-limit/package.json
  • packages/swagger-ui/package.json

Comment on lines +66 to +74
"routup": "^5.0.0"
},
"dependencies": {
"@routup/body": "^2.4.3",
"@routup/cookie": "^2.4.3",
"@routup/query": "^2.4.3"
},
"devDependencies": {
"routup": "^5.0.0-beta.6"
"routup": "^5.0.0"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if routup@5.0.0 and `@trapi/core`@2.0.0-beta.3 exist on npm registry.

echo "=== routup versions ==="
curl -sf https://registry.npmjs.org/routup | \
  python3 -c "import sys,json; d=json.load(sys.stdin); print(sorted(d.get('versions',{}).keys())[-5:])"

echo "=== `@trapi/core` versions ==="
curl -sf "https://registry.npmjs.org/%40trapi%2Fcore" | \
  python3 -c "import sys,json; d=json.load(sys.stdin); print(sorted(d.get('versions',{}).keys()))"

Repository: routup/plugins

Length of output: 209


Block merge: routup@5.0.0 is not published to npm.

The change bumps routup from ^5.0.0-beta.6 to ^5.0.0, but only beta versions exist in the npm registry (latest: 5.0.0-beta.8). The semver range ^5.0.0 will not resolve to beta pre-releases, causing unmet peer dependency errors on install for all consumers of this package and its dependents.

Either revert to a compatible beta version (^5.0.0-beta.8) or defer this PR until routup@5.0.0 is released.

🤖 Prompt for 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.

In `@packages/basic/package.json` around lines 66 - 74, package.json references
"routup": "^5.0.0" (both in the top-level and devDependencies) but that tag
isn't published; change both "routup" entries back to a published beta such as
"^5.0.0-beta.8" (or remove the bump and leave the previous semver) so installs
resolve correctly, or hold the PR until routup@5.0.0 is released.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR finalizes the migration to routup@^5.0.0 across the monorepo and updates the decorators OpenAPI preset integration to align with the TRAPI v2 split (@trapi/core vs @trapi/metadata) and the updated @trapi/swagger API (metadata must be generated separately).

Changes:

  • Bump routup peer/dev dependency ranges from ^5.0.0-beta.6 to ^5.0.0 across packages.
  • Migrate the decorators preset implementation to import handler builders/types from @trapi/core and adjust tests/docs to call generateMetadata() before generateSwagger().
  • Change @routup/decorators/preset to export the preset as the module default export.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
package.json Updates root peer dependency to routup@^5.0.0.
package-lock.json Lockfile updates reflecting routup 5.0.0 and TRAPI dependency reshaping.
packages/assets/package.json Bumps routup peer/dev range to ^5.0.0.
packages/basic/package.json Bumps routup peer/dev range to ^5.0.0.
packages/body/package.json Bumps routup peer/dev range to ^5.0.0.
packages/cookie/package.json Bumps routup peer/dev range to ^5.0.0.
packages/decorators/package.json Drops @trapi/metadata peer dep; adds @trapi/core dependency; bumps routup and TRAPI dev deps.
packages/decorators/README.md Updates OpenAPI generation docs to the “generateMetadata then generateSwagger” flow.
packages/decorators/src/preset/class.ts Switches preset handler imports from @trapi/metadata to @trapi/core.
packages/decorators/src/preset/index.ts Changes preset export shape to default export.
packages/decorators/src/preset/method.ts Switches preset handler imports from @trapi/metadata to @trapi/core.
packages/decorators/src/preset/module.ts Switches Preset type import from @trapi/metadata to @trapi/core.
packages/decorators/src/preset/parameter.ts Switches preset handler imports from @trapi/metadata to @trapi/core.
packages/decorators/src/preset/swagger.ts Switches preset handler imports from @trapi/metadata to @trapi/core.
packages/decorators/test/unit/preset/v2.spec.ts Updates tests to call generateMetadata() before generateSwagger().
packages/decorators/test/unit/preset/v3.spec.ts Updates tests to call generateMetadata() before generateSwagger().
packages/docs/src/decorators/index.md Updates docs to the new TRAPI workflow and preset usage guidance.
packages/i18n/package.json Bumps routup peer/dev range to ^5.0.0.
packages/prometheus/package.json Bumps routup peer/dev range to ^5.0.0.
packages/query/package.json Bumps routup peer/dev range to ^5.0.0.
packages/rate-limit/package.json Bumps routup peer/dev range to ^5.0.0.
packages/rate-limit-redis/package.json Bumps routup peer/dev range to ^5.0.0.
packages/swagger-ui/package.json Bumps routup peer/dev range to ^5.0.0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export * from './module';

export const preset = buildPreset();
const preset = buildPreset();

### Programmatically

`generateSwagger()` accepts pre-built metadata, so run `generateMetadata()` from `@trapi/metadata` first. The preset can be referenced by package specifier — `@trapi/metadata` resolves it through the `preset` export of `@routup/decorators/preset`:

### Programmatically

`@trapi/swagger`'s `generateSwagger()` accepts pre-built metadata, so call `generateMetadata()` from `@trapi/metadata` first. Reference the preset by package specifier — `@trapi/metadata` resolves it via the `preset` export of `@routup/decorators/preset`:
Comment on lines 57 to 65
"peerDependencies": {
"@trapi/metadata": ">=2.0.0-beta.2 <3.0.0",
"routup": "^5.0.0-beta.6"
},
"peerDependenciesMeta": {
"@trapi/metadata": {
"optional": true
}
"routup": "^5.0.0"
},
"dependencies": {
"@routup/body": "^2.4.3",
"@routup/cookie": "^2.4.3",
"@routup/query": "^2.4.3"
"@routup/query": "^2.4.3",
"@trapi/core": "^2.0.0-beta.3"
},
Consumers who only use the runtime decorators don't need @trapi/core —
move it from `dependencies` to an optional peerDep so it's only required
when importing `@routup/decorators/preset`.
@tada5hi
Copy link
Copy Markdown
Contributor Author

tada5hi commented May 5, 2026

@coderabbitai pause

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Reviews paused.

@tada5hi tada5hi merged commit 1f5d0f6 into master May 5, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request May 5, 2026
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.

2 participants