refactor: clean up API surface, fix metadata, and improve internals#770
refactor: clean up API surface, fix metadata, and improve internals#770
Conversation
📝 WalkthroughWalkthroughThis PR consolidates internal symbol constants across the body package, simplifies export maps in the basic package, refactors handler delegation patterns, removes re-exports from cookie and query packages, and updates documentation and metadata across multiple packages. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/i18n/package.json`:
- Line 50: Add a CHANGELOG entry documenting the dependency bump of "ilingo" to
^5.0.0: note this is a major, breaking change (ESM-only requirement and the API
rename Store → IStore), state that `@routup/i18n` itself is compatible but
downstream consumers who depend on ilingo v3 or use transitive v3 should be
warned, and include migration guidance (update imports to ESM and rename Store
to IStore) and the package.json change ("ilingo": "^5.0.0") as the trigger for
the entry.
In `@packages/rate-limit-redis/package.json`:
- Around line 21-22: The package.json scripts "test" and "test:coverage" invoke
the vitest CLI but vitest is not declared in devDependencies; add "vitest"
(choose a current compatible semver, e.g. "^1.0.0" or your repo's standard
version) to the devDependencies object in packages/rate-limit-redis/package.json
so the scripts can run, then run npm/yarn/pnpm install to update lockfiles;
ensure the version aligns with other workspace packages to avoid mismatches.
🪄 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: d756c18f-87bd-43ad-a1aa-d0517f6d6028
📒 Files selected for processing (25)
packages/assets/README.mdpackages/assets/package.jsonpackages/assets/src/handler.tspackages/basic/package.jsonpackages/basic/src/body.tspackages/basic/src/cookie.tspackages/basic/src/index.tspackages/basic/src/query.tspackages/basic/tsdown.config.tspackages/body/src/constants.tspackages/body/src/helpers/options.tspackages/body/src/helpers/read-raw.tspackages/body/src/helpers/read.tspackages/cookie/src/index.tspackages/i18n/README.mdpackages/i18n/package.jsonpackages/prometheus/package.jsonpackages/query/src/index.tspackages/query/test/unit/module.spec.tspackages/rate-limit-redis/package.jsonpackages/rate-limit/README.mdpackages/rate-limit/package.jsonpackages/rate-limit/src/request.tspackages/swagger/README.mdpackages/swagger/src/ui/handler.ts
💤 Files with no reviewable changes (8)
- packages/i18n/README.md
- packages/basic/src/cookie.ts
- packages/basic/src/body.ts
- packages/basic/src/index.ts
- packages/basic/src/query.ts
- packages/query/src/index.ts
- packages/basic/package.json
- packages/cookie/src/index.ts
| "homepage": "https://github.com/routup/plugins#readme", | ||
| "peerDependencies": { | ||
| "ilingo": "^3.2.0", | ||
| "ilingo": "^5.0.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
ilingo npm package version 5.0.0 breaking changes migration guide
💡 Result:
ilingo v5.0.0 (released 2026-01-14) — breaking changes + migration
Breaking changes
- ESM-only:
ilingono longer supports CommonJS (require(...)). Your project/build must consume it as ESM. [1] - Type/interface rename: the
Storeinterface was renamed toIStore. Update any imports/annotations/implements accordingly. [1]
Migration checklist (from 4.4.x → 5.0.0)
-
Update imports to ESM
- ✅ ESM:
import { Ilingo } from "ilingo";
- ❌ CommonJS (won’t work in v5):
const { Ilingo } = require("ilingo");
- If your app is still CommonJS, you’ll need to migrate the app to ESM (or use an ESM-capable bundler/runtime strategy) because the package is ESM-only. [1]
- ✅ ESM:
-
Rename
Store→IStoreeverywhere- Example:
// before import type { Store } from "ilingo"; // after import type { IStore } from "ilingo";
- If you had custom stores implementing
Store, change them to implementIStore. [1]
- Example:
Notes:
- The same release set also moved
@ilingo/vueto ESM-only and renamedStore→IStorethere as well. [1]
Source(s)
[1] GitHub Releases (tada5hi/ilingo) – entries for ilingo: v5.0.0 and related packages, including the “⚠ BREAKING CHANGES” section. (github.com)
Citations:
🏁 Script executed:
#!/bin/bash
# Description: Identify ilingo API usage patterns in the i18n package to assess compatibility risk
# Search for ilingo imports and usage patterns
echo "=== Ilingo imports ==="
rg -n "from ['\"]ilingo['\"]" packages/i18n/src/
echo -e "\n=== Ilingo API usage patterns ==="
# Look for common ilingo API methods that may have changed
rg -n -C3 "\b(translate|t|locale|language|setLocale|getLocale|addTranslation|loadTranslation)\(" packages/i18n/src/
echo -e "\n=== Check for any ilingo type imports ==="
rg -n "import.*ilingo.*type" packages/i18n/src/Repository: routup/plugins
Length of output: 1397
🏁 Script executed:
#!/bin/bash
# Description: Check if migration documentation exists for this breaking change
# Check CHANGELOG for ilingo v5 migration notes
echo "=== Checking CHANGELOG ==="
fd -t f "CHANGELOG" packages/i18n/ --exec cat {}
# Check README for migration notes
echo -e "\n=== Checking README ==="
fd -t f "README" packages/i18n/ --exec cat {}
# Check for any migration guide files
echo -e "\n=== Looking for migration guides ==="
fd -t f -e md . packages/i18n/ --exec basename {}Repository: routup/plugins
Length of output: 4165
🏁 Script executed:
# Read types.ts to see what's imported from ilingo
cat -n packages/i18n/src/types.tsRepository: routup/plugins
Length of output: 526
🏁 Script executed:
# Search for Store type usage in the entire packages/i18n/src directory
rg -n "Store" packages/i18n/src/Repository: routup/plugins
Length of output: 40
🏁 Script executed:
# Check the module.ts file more thoroughly to understand store usage
cat -n packages/i18n/src/module.ts | head -100Repository: routup/plugins
Length of output: 2654
🏁 Script executed:
# List all TypeScript source files in packages/i18n/src
find packages/i18n/src -type f -name "*.ts" -o -name "*.tsx" | sortRepository: routup/plugins
Length of output: 206
🏁 Script executed:
# Check for any imports of Store type across the entire packages/i18n directory
rg -n "import.*Store" packages/i18n/Repository: routup/plugins
Length of output: 201
Document the ilingo v5.0.0 upgrade in the CHANGELOG.
The bump from ^3.2.0 to ^5.0.0 is a major version jump that introduces breaking changes in ilingo (ESM-only requirement and Store→IStore rename). While the @routup/i18n package source code is compatible with ilingo v5, downstream consumers should be notified about this dependency upgrade. Add a CHANGELOG entry documenting this breaking change for consumers who use ilingo v3 directly or have transitive dependencies on it.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/i18n/package.json` at line 50, Add a CHANGELOG entry documenting the
dependency bump of "ilingo" to ^5.0.0: note this is a major, breaking change
(ESM-only requirement and the API rename Store → IStore), state that
`@routup/i18n` itself is compatible but downstream consumers who depend on ilingo
v3 or use transitive v3 should be warned, and include migration guidance (update
imports to ESM and rename Store to IStore) and the package.json change
("ilingo": "^5.0.0") as the trigger for the entry.
| "test": "vitest run --config ./test/vitest.config.ts", | ||
| "test:coverage": "vitest run --config ./test/vitest.config.ts --coverage", |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify the vitest config file exists and check vitest version in package files
# Check if the vitest config file exists
fd -t f "vitest.config.ts" packages/rate-limit-redis/test/
# Check vitest version in package.json files
rg -g "package*.json" '"vitest":\s*"[^"]+"' packages/rate-limit-redis/Repository: routup/plugins
Length of output: 105
🏁 Script executed:
cat -n packages/rate-limit-redis/package.json | head -40Repository: routup/plugins
Length of output: 1480
🏁 Script executed:
cat -n packages/rate-limit-redis/package.json | tail -30Repository: routup/plugins
Length of output: 1081
Add vitest to devDependencies.
The test scripts reference vitest as a command, but the package is not declared in devDependencies. Add vitest with an appropriate version to the devDependencies section so the test scripts can execute.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/rate-limit-redis/package.json` around lines 21 - 22, The
package.json scripts "test" and "test:coverage" invoke the vitest CLI but vitest
is not declared in devDependencies; add "vitest" (choose a current compatible
semver, e.g. "^1.0.0" or your repo's standard version) to the devDependencies
object in packages/rate-limit-redis/package.json so the scripts can run, then
run npm/yarn/pnpm install to update lockfiles; ensure the version aligns with
other workspace packages to avoid mismatches.
Summary by CodeRabbit
Breaking Changes
Bug Fixes
Documentation
Tests