Skip to content

Commit 58d82e3

Browse files
committed
docs: add cli warning for cjs projects
1 parent 1831996 commit 58d82e3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

apps/docs/pages/guide/commandkit-config.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ export default defineConfig({
2626
});
2727
```
2828

29+
<Callout type="warning">
30+
For CommandKit CLI on version `0.1.7` it's recommended to use an ESM project instead of CommonJS
31+
due to the behavior of `require()`. If you're using CommonJS you'll have to use dynamic
32+
`import()`. However, this is not an issue for TypeScript CommonJS projects.
33+
</Callout>
34+
2935
## Options
3036

3137
### `src`

apps/docs/pages/guide/using-cli.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import { Callout } from 'nextra/components';
44

55
CommandKit CLI allows you to start, build, and manage your bot application. It also includes features such as anti-crash so you can be rest assured your bot won't crash and go offline during production.
66

7+
<Callout type="warning">
8+
For CommandKit CLI on version `0.1.7` it's recommended to use an ESM project instead of CommonJS
9+
due to the behavior of `require()`. If you're using CommonJS you'll have to use dynamic
10+
`import()`. However, this is not an issue for TypeScript CommonJS projects.
11+
</Callout>
12+
713
To get a list of the available CLI commands, run the following command inside your project directory:
814

915
```sh
@@ -26,8 +32,8 @@ Commands:
2632
```
2733

2834
<Callout type="info">
29-
CommandKit does not perform type checking on your code. You need to do that yourself using{' '}
30-
<code>tsc --noEmit</code> command or any other tool of your choice.
35+
CommandKit does not perform type checking on your code. You need to do that yourself using `tsc
36+
--noEmit` command or any other tool of your choice.
3137
</Callout>
3238

3339
## Available commands

0 commit comments

Comments
 (0)