Skip to content

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

Open
ItsRayanM wants to merge 9 commits intoneplextech:mainfrom
ItsRayanM:feat/ratelimit-plugin
Open

feat(ratelimit): add plugin package, docs, and test-bot demos#621
ItsRayanM wants to merge 9 commits intoneplextech:mainfrom
ItsRayanM:feat/ratelimit-plugin

Conversation

@ItsRayanM
Copy link
Contributor

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

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

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 14, 2026 3:16am

Copy link
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
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
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

SlidingWindowConsumeResult,
} from '../types';

const FIXED_WINDOW_SCRIPT = `
Copy link
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 */ `

return {count, ttl}
`;

const SLIDING_WINDOW_SCRIPT = `
Copy link
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
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
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,
}),
],
)

- [@commandkit/queue](./packages/queue)
- [@commandkit/redis](./packages/redis)
- [@commandkit/tasks](./packages/tasks)
- [@commandkit/ratelimit](./packages/ratelimit)
Copy link
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?

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

I got everything done @twlite

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