feat(decorators)!: bump routup to ^5.0.0 and migrate preset to @trapi…#787
feat(decorators)!: bump routup to ^5.0.0 and migrate preset to @trapi…#787
Conversation
…/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
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis 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 ChangesDecorators TRAPI Core Migration
Routup 5.0.0 Stable Release Update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 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 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/decorators/package.json (1)
64-64: ⚡ Quick win
@trapi/coreis a pre-release (beta) runtime dependency shipped independencies.All consumers of
@routup/decoratorswill 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.0once 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
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (22)
package.jsonpackages/assets/package.jsonpackages/basic/package.jsonpackages/body/package.jsonpackages/cookie/package.jsonpackages/decorators/README.mdpackages/decorators/package.jsonpackages/decorators/src/preset/class.tspackages/decorators/src/preset/index.tspackages/decorators/src/preset/method.tspackages/decorators/src/preset/module.tspackages/decorators/src/preset/parameter.tspackages/decorators/src/preset/swagger.tspackages/decorators/test/unit/preset/v2.spec.tspackages/decorators/test/unit/preset/v3.spec.tspackages/docs/src/decorators/index.mdpackages/i18n/package.jsonpackages/prometheus/package.jsonpackages/query/package.jsonpackages/rate-limit-redis/package.jsonpackages/rate-limit/package.jsonpackages/swagger-ui/package.json
| "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" |
There was a problem hiding this comment.
🧩 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.
There was a problem hiding this comment.
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
routuppeer/dev dependency ranges from^5.0.0-beta.6to^5.0.0across packages. - Migrate the decorators preset implementation to import handler builders/types from
@trapi/coreand adjust tests/docs to callgenerateMetadata()beforegenerateSwagger(). - Change
@routup/decorators/presetto 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`: |
| "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`.
|
@coderabbitai pause |
✅ Actions performedReviews paused. |
…/core
Summary by CodeRabbit
Chores
Documentation
Tests