Skip to content

feat(ratelimit): add plugin package, docs, and test-bot demos#621

Merged
twlite merged 10 commits intoneplextech:mainfrom
CallRay:feat/ratelimit-plugin
Mar 17, 2026
Merged

feat(ratelimit): add plugin package, docs, and test-bot demos#621
twlite merged 10 commits intoneplextech:mainfrom
CallRay:feat/ratelimit-plugin

Conversation

@CallRay
Copy link
Copy Markdown
Contributor

@CallRay CallRay commented Mar 13, 2026

Summary

  • Add the @commandkit/ratelimit package with compiler/runtime plugins, storage drivers, algorithms, and tests.
  • Add website docs and API reference for ratelimit, plus docgen config.
  • Add test-bot ratelimit config, demo commands, and event logging.
  • Update root README package list and pnpm lockfile.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 13, 2026

@ItsRayanM is attempting to deploy a commit to the Neplex Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
commandkit Ready Ready Preview, Comment Mar 15, 2026 2:31pm

Copy link
Copy Markdown
Member

@twlite twlite left a comment

Choose a reason for hiding this comment

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

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'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

description missing

title: '@commandkit/ratelimit'
---

`@commandkit/ratelimit` is the official CommandKit plugin for advanced
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

improve this guide, it lacks explanations in many places

Comment thread packages/ratelimit/src/storage/redis.ts Outdated
SlidingWindowConsumeResult,
} from '../types';

const FIXED_WINDOW_SCRIPT = `
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const FIXED_WINDOW_SCRIPT = `
const FIXED_WINDOW_SCRIPT = /* lua */ `

Comment thread packages/ratelimit/src/storage/redis.ts Outdated
return {count, ttl}
`;

const SLIDING_WINDOW_SCRIPT = `
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
const SLIDING_WINDOW_SCRIPT = `
const SLIDING_WINDOW_SCRIPT = /* lua */ `

},
"homepage": "https://commandkit.dev",
"dependencies": {
"ioredis": "^5.10.0",
Copy link
Copy Markdown
Member

@twlite twlite Mar 14, 2026

Choose a reason for hiding this comment

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

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({
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lets also add test for the directive, although it will require directive transformer (see

plugins: [
cacheDirectivePlugin({
directive: 'use cache',
importPath: 'commandkit',
importName: '$ckitiucw',
asyncOnly: true,
}),
],
)

Comment thread README.md
- [@commandkit/queue](./packages/queue)
- [@commandkit/redis](./packages/redis)
- [@commandkit/tasks](./packages/tasks)
- [@commandkit/ratelimit](./packages/ratelimit)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

@CallRay CallRay force-pushed the feat/ratelimit-plugin branch from 4f97f04 to f8b654a Compare March 14, 2026 14:01
@CallRay CallRay force-pushed the feat/ratelimit-plugin branch from f8b654a to cf99c08 Compare March 14, 2026 14:18
@CallRay
Copy link
Copy Markdown
Contributor Author

CallRay commented Mar 14, 2026

I got everything done @twlite

@twlite
Copy link
Copy Markdown
Member

twlite commented Mar 15, 2026

@ItsRayanM please regenerate the pnpm lockfile

@CallRay
Copy link
Copy Markdown
Contributor Author

CallRay commented Mar 15, 2026

@ItsRayanM please regenerate the pnpm lockfile

done

@AboMeezO
Copy link
Copy Markdown
Contributor

nice work bud, keep going

@twlite twlite merged commit f519cf6 into neplextech:main Mar 17, 2026
2 checks passed
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.

3 participants