feat(ratelimit): add plugin package, docs, and test-bot demos#621
feat(ratelimit): add plugin package, docs, and test-bot demos#621ItsRayanM wants to merge 9 commits intoneplextech:mainfrom
Conversation
|
@ItsRayanM is attempting to deploy a commit to the Neplex Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
twlite
left a comment
There was a problem hiding this comment.
This is not a full review; I haven't gone through each code files yet. These are some suggestions for now
| @@ -0,0 +1,643 @@ | |||
| --- | |||
| title: '@commandkit/ratelimit' | |||
| title: '@commandkit/ratelimit' | ||
| --- | ||
|
|
||
| `@commandkit/ratelimit` is the official CommandKit plugin for advanced |
There was a problem hiding this comment.
improve this guide, it lacks explanations in many places
| SlidingWindowConsumeResult, | ||
| } from '../types'; | ||
|
|
||
| const FIXED_WINDOW_SCRIPT = ` |
There was a problem hiding this comment.
| const FIXED_WINDOW_SCRIPT = ` | |
| const FIXED_WINDOW_SCRIPT = /* lua */ ` |
| return {count, ttl} | ||
| `; | ||
|
|
||
| const SLIDING_WINDOW_SCRIPT = ` |
There was a problem hiding this comment.
| const SLIDING_WINDOW_SCRIPT = ` | |
| const SLIDING_WINDOW_SCRIPT = /* lua */ ` |
| }, | ||
| "homepage": "https://commandkit.dev", | ||
| "dependencies": { | ||
| "ioredis": "^5.10.0", |
There was a problem hiding this comment.
should this be a hard dependency? we should rethink this since ioredis is also used by other plugins
| import { defineConfig } from 'vitest/config'; | ||
| import { join } from 'path'; | ||
|
|
||
| export default defineConfig({ |
There was a problem hiding this comment.
lets also add test for the directive, although it will require directive transformer (see
commandkit/packages/commandkit/vitest.config.ts
Lines 19 to 26 in 09ec621
| - [@commandkit/queue](./packages/queue) | ||
| - [@commandkit/redis](./packages/redis) | ||
| - [@commandkit/tasks](./packages/tasks) | ||
| - [@commandkit/ratelimit](./packages/ratelimit) |
There was a problem hiding this comment.
looks like you created the package manually (otherwise it would have added the new package to github action as well). Could you include this to the github action?
4f97f04 to
f8b654a
Compare
f8b654a to
cf99c08
Compare
|
I got everything done @twlite |
Summary