Skip to content

Commit 9a74913

Browse files
committed
website: version docs
1 parent b44628b commit 9a74913

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2100
-22
lines changed

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ node_modules
22

33
**/docs/.next/
44
**/website/docs/api-reference
5+
**/website/versioned_docs
6+
**/website/versioned_sidebars
7+
.docusaurus
58
.astro
69
dist
710
.commandkit

apps/website/docs/guide/01-installation.mdx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,26 @@ import TabItem from '@theme/TabItem';
88

99
# Installation
1010

11-
<div align="center" className="my-8">
11+
<div
12+
align="center"
13+
style={{
14+
margin: '2rem 0',
15+
}}
16+
>
1217
<img src="/img/ckit_logo.svg" width="60%" />
1318
<br />
14-
<div className="flex items-center justify-center gap-2">
19+
<div
20+
style={{
21+
display: 'flex',
22+
alignItems: 'center',
23+
justifyContent: 'center',
24+
gap: '0.5rem',
25+
}}
26+
>
1527
<a href="https://ctrl.lol/discord">
1628
<img
1729
src="https://img.shields.io/discord/1055188344188973066?color=5865F2&logo=discord&logoColor=white"
18-
alt="support server"
30+
alt="support discord server"
1931
/>
2032
</a>
2133
<a href="https://www.npmjs.com/package/commandkit">

apps/website/docs/guide/03-commandkit-setup.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import TabItem from '@theme/TabItem';
88

99
# CommandKit Setup
1010

11-
This is a simple overview of how to set up CommandKit with all the available options. Youd usually set this up in your entry file (e.g. `index.js`) where you have access to your Discord.js client object.
11+
This is a simple overview of how to set up CommandKit with all the available options. You'd usually set this up in your entry file (e.g. `src/index.js`) where you have access to your Discord.js client object.
1212

1313
<Tabs>
1414
<TabItem value='cjs' label='CommonJS' default>
15-
```js title="src/index.js" {2, 13-23}
15+
```js title="src/index.js" {13-23}
1616
const { Client, GatewayIntentBits } = require('discord.js');
1717
const { CommandKit } = require('commandkit');
1818
const path = require('path');
@@ -41,7 +41,7 @@ This is a simple overview of how to set up CommandKit with all the available opt
4141
```
4242
</TabItem>
4343
<TabItem value='esm' label='ESM'>
44-
```js title="src/index.js" {2, 16-26}
44+
```js title="src/index.js" {16-26}
4545
import { Client, GatewayIntentBits } from 'discord.js';
4646
import { CommandKit } from 'commandkit';
4747
import { fileURLToPath } from 'url';
@@ -73,7 +73,7 @@ This is a simple overview of how to set up CommandKit with all the available opt
7373
```
7474
</TabItem>
7575
<TabItem value='ts' label='TypeScript'>
76-
```ts title="src/index.ts" {2, 13-23}
76+
```ts title="src/index.ts" {13-23}
7777
import { Client, GatewayIntentBits } from 'discord.js';
7878
import { CommandKit } from 'commandkit';
7979
import path from 'path';
@@ -112,7 +112,7 @@ Some Discord.js properties are only accessible using the correct intents.
112112
113113
### `client`
114114
115-
- Type: [`Client`](https://old.discordjs.dev/#/docs/discord.js/main/class/Client)
115+
- Type: [`Client`](https://discord.js.org/docs/packages/discord.js/14.16.3/Client:Class)
116116
117117
This is your Discord.js client object. This is required to register and handle application commands and events.
118118
@@ -170,4 +170,4 @@ This is used to disable CommandKit's built-in validation functions. Setting this
170170
- Type: `boolean`
171171
- Default: `false`
172172
173-
This is used to change the behaviour of how CommandKit loads application commands. By default it's one-by-one while comparing changes. Setting this option to `true` will load application commands all at once on every restart, and when [`reloadCommands()`](/docs/api-reference/classes/CommandKit#reloadcommands) is called.
173+
This is used to change the behaviour of how CommandKit loads application commands. By default it's one-by-one while comparing changes. Setting this option to `true` will load application commands all at once on every restart, and when [`reloadCommands()`](/docs/api-reference/classes/CommandKit#public-reloadcommandstype-promisevoid) is called.

apps/website/docs/guide/04-command-file-setup.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,27 +284,27 @@ Here's an example of how to use the `autocomplete` function:
284284

285285
### `data`
286286

287-
- Type: [`CommandData`](/docs/types/CommandData) | [`SlashCommandBuilder`](https://discord.js.org/docs/packages/builders/main/SlashCommandBuilder:Class) | [`ContextMenuCommandBuilder`](https://discord.js.org/docs/packages/builders/main/ContextMenuCommandBuilder:Class)
287+
- Type: [`CommandData`](/docs/api-reference/types/CommandData) | [`SlashCommandBuilder`](https://discord.js.org/docs/packages/builders/1.9.0/SlashCommandBuilder:Class) | [`ContextMenuCommandBuilder`](https://discord.js.org/docs/packages/builders/1.9.0/ContextMenuCommandBuilder:Class)
288288

289289
This property contains the command's structural information, and is required to register and handle commands.
290290

291291
### `run`
292292

293293
- Type: `void`
294294

295-
- Props Type: [`SlashCommandProps`](/docs/types/SlashCommandProps) | [`ContextMenuCommandProps`](/docs/types/ContextMenuCommandProps)
295+
- Props Type: [`SlashCommandProps`](/docs/api-reference/types/SlashCommandProps) | [`ContextMenuCommandProps`](/docs/api-reference/types/ContextMenuCommandProps)
296296

297297
This function will be called when the command is executed.
298298

299299
### `autocomplete`
300300

301301
- Type: `void`
302-
- Props Type: [`AutocompleteProps`](/docs/types/AutocompleteProps)
302+
- Props Type: [`AutocompleteProps`](/docs/api-reference/types/AutocompleteProps)
303303

304304
This function will be called when an autocomplete interaction event is triggered for any option set as autocomplete in this command's `data` object.
305305

306306
### `options` (optional)
307307

308-
- Type: [`CommandOptions`](/docs/types/CommandOptions)
308+
- Type: [`CommandOptions`](/docs/api-reference/types/CommandOptions)
309309

310310
This property contains the command's registration/handling behaviour.

apps/website/docs/guide/07-buttonkit.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import TabItem from '@theme/TabItem';
88

99
# Using ButtonKit
1010

11-
ButtonKit is an enhanced version of the native Discord.js [`ButtonBuilder`](https://old.discordjs.dev/#/docs/discord.js/main/class/ButtonBuilder), designed to simplify the process of creating and handling button interactions in your Discord bot.
11+
ButtonKit is an enhanced version of the native Discord.js [`ButtonBuilder`](https://discord.js.org/docs/packages/builders/1.9.0/ButtonBuilder:Class), designed to simplify the process of creating and handling button interactions in your Discord bot.
1212

1313
It is not recommended to use this to listen for button clicks forever since it creates collectors. For that purpose, it's recommended to use a regular "interactionCreate" event listener.
1414

@@ -160,7 +160,7 @@ myButton.onClick(
160160

161161
### `message`
162162

163-
- Type: [`Message`](https://old.discordjs.dev/#/docs/discord.js/main/class/Message)
163+
- Type: [`Message`](https://discord.js.org/docs/packages/discord.js/14.16.3/Message:Class)
164164

165165
The message object that ButtonKit uses to listen for button clicks (interactions).
166166

@@ -179,13 +179,13 @@ Whether or not the collector should automatically reset the timer when a button
179179

180180
### Additional optional options
181181

182-
- Type: [`InteractionCollectorOptions`](https://old.discordjs.dev/#/docs/discord.js/main/typedef/InteractionCollectorOptions)
182+
- Type: [`InteractionCollectorOptions`](https://discord.js.org/docs/packages/discord.js/14.16.3/InteractionCollectorOptions:Interface)
183183

184184
## Handle collector end
185185

186186
When setting up an `onClick()` method using ButtonKit, you may also want to run some code after the collector ends running. The default timeout is 1 day, but you can modify this in [`onClickOptions#time`](#time-optional). To handle when the collector ends, you can setup an `onEnd()` method like this:
187187

188-
```js {16-21}
188+
```js {19-24}
189189
const myButton = new ButtonKit()
190190
.setCustomId('custom_button')
191191
.setLabel('Click me!')

apps/website/docusaurus.config.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,28 @@ const config: Config = {
7373
},
7474
footer: {
7575
style: 'light',
76-
copyright: `Copyright © ${new Date().getFullYear()} CommandKit`,
76+
copyright: `MIT © ${new Date().getFullYear()} CommandKit`,
7777
},
7878
prism: {
7979
theme: prismThemes.github,
8080
darkTheme: prismThemes.dracula,
8181
},
8282
} satisfies Preset.ThemeConfig,
83+
plugins: [
84+
function tailwindPlugin(context, options) {
85+
return {
86+
name: 'tailwind-plugin',
87+
configurePostCss(postcssOptions) {
88+
postcssOptions.plugins = [
89+
require('postcss-import'),
90+
require('tailwindcss'),
91+
require('autoprefixer'),
92+
];
93+
return postcssOptions;
94+
},
95+
};
96+
},
97+
],
8398
};
8499

85100
export default config;

apps/website/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929
"@docusaurus/remark-plugin-npm2yarn": "^3.6.3",
3030
"@docusaurus/tsconfig": "3.6.3",
3131
"@docusaurus/types": "3.6.3",
32+
"autoprefixer": "^10.4.20",
3233
"micro-docgen": "^0.3.5",
34+
"postcss": "^8.4.49",
35+
"tailwindcss": "^3.4.16",
3336
"typescript": "~5.6.2"
3437
},
3538
"browserslist": {

apps/website/src/css/custom.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
15
/**
26
* Any CSS included here will be global. The classic template
37
* bundles Infima by default. Infima is a CSS framework designed to
@@ -26,5 +30,5 @@
2630
--ifm-color-primary-light: #7e33f6;
2731
--ifm-color-primary-lighter: #9a60f7;
2832
--ifm-color-primary-lightest: #a46ef8;
29-
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
33+
--docusaurus-highlighted-code-line-bg: rgba(137, 137, 137, 0.3);
3034
}

apps/website/src/pages/index.tsx

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,54 @@
11
import Layout from '@theme/Layout';
2+
import Link from '@docusaurus/Link';
23

34
export default function Home(): React.JSX.Element {
45
return (
56
<Layout>
6-
<main>
7-
<div>Home page</div>
8-
</main>
7+
<section className="w-72 h-96 mx-auto text-center mt-32 mb-28 md:mb-16 flex items-center justify-center flex-col md:flex-row-reverse md:gap-2 md:text-left md:mt-12 md:w-[700px] lg:w-[850px]">
8+
<img
9+
src="/img/logo.png"
10+
alt="CommandKit logo"
11+
className="md:w-[230px] lg:w-[280px] mb-10 md:mb-0"
12+
width={250}
13+
height={250}
14+
/>
15+
16+
<div>
17+
<p className="text-4xl font-bold mb-5 md:text-5xl lg:text-6xl">
18+
Let{' '}
19+
<span className="text-transparent bg-clip-text bg-gradient-to-r from-[#ffbc6f] to-[#b079fc]">
20+
CommandKit
21+
</span>{' '}
22+
handle it for you!
23+
</p>
24+
<p className="font-semibold lg:text-xl">
25+
A Discord.js handler for commands and events.
26+
</p>
27+
28+
<div className="flex items-center justify-center gap-3 mt-10 md:justify-start [&>a]:text-white [&>a]:hover:text-white">
29+
<Link
30+
to="/docs/guide/installation"
31+
className="font-semibold bg-[#b079fc] py-2 px-4 rounded-full"
32+
>
33+
Guide
34+
</Link>
35+
<Link
36+
to="/docs/api-reference/classes/ButtonKit"
37+
className="font-semibold bg-blue-500 py-2 px-4 rounded-full"
38+
>
39+
API Reference
40+
</Link>
41+
<Link
42+
href="https://github.com/underctrl-io/commandkit"
43+
className="font-semibold bg-[#fc7993] py-2 px-4 rounded-full"
44+
// target="_blank"
45+
// rel="noopener noreferrer"
46+
>
47+
GitHub
48+
</Link>
49+
</div>
50+
</div>
51+
</section>
952
</Layout>
1053
);
1154
}

apps/website/tailwind.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { fontFamily } = require('tailwindcss/defaultTheme');
2+
3+
/** @type {import('tailwindcss').Config} */
4+
module.exports = {
5+
corePlugins: {
6+
preflight: false,
7+
container: false,
8+
},
9+
darkMode: ['class', '[data-theme="dark"]'],
10+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
11+
theme: {},
12+
plugins: [],
13+
};

0 commit comments

Comments
 (0)