underctrl-io / commandkit

Only focus on what matters - Let CommandKit handle your commands and events in your Discord.js projects!
https://commandkit.js.org
MIT License
82 stars 9 forks source link

feat: cli v1 init #56

Closed twlite closed 5 months ago

twlite commented 5 months ago

🎉 CLI is now written in TypeScript.

This PR also changes the way projects are bootstrapped. A client.{js,ts} file is required for this to work, which will be the entrypoint file. This is not ready yet, so for now it can be tested with the following code:

// src/client.js
import { client, CommandKit } from 'commandkit';

new CommandKit({
    client: client(),
    commandsPath: `${__dirname}/commands`,
    eventsPath: `${__dirname}/events`,
    validationsPath: `${__dirname}/validations`,
    bulkRegister: true
});

client instance is created by commandkit itself internally before executing the code. The client options have to be provided through commandkit.js (commandkit config file).

This is experimental and we will keep improving this as the project iterates. Watch mode is currently not supported and production build is also not supported for now.

The new CommandKit part can be omitted entirely once new command handler lands. This should not break existing code but it will definitely break for CLI users.

cc @notunderctrl

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
commandkit-docs ❌ Failed (Inspect) Jan 31, 2024 5:44pm