From 26910a3b176279a970868d6c26f92295e42c6eca Mon Sep 17 00:00:00 2001 From: Peter-MJ-Parker <34216187+Peter-MJ-Parker@users.noreply.github.com> Date: Sat, 12 Apr 2025 10:33:31 -0500 Subject: [PATCH 1/2] Add tip for multiple commands dirs After a recent patch, we can now use an array of folders to tell seen where to look for commands. Using an array, we can keep our commands separate from our components (ie: Select Menus, Buttons, Modals). Additionally, patched the cautionary statement at the bottom of the page to signify we don't support CJS anymore. --- src/content/docs/v4/reference/config.mdx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/content/docs/v4/reference/config.mdx b/src/content/docs/v4/reference/config.mdx index 0bbc1fdb8..303b02f33 100644 --- a/src/content/docs/v4/reference/config.mdx +++ b/src/content/docs/v4/reference/config.mdx @@ -32,7 +32,12 @@ import { FileTree } from '@astrojs/starlight/components'; ```js title='src/config.js' export const commands = './dist/commands' ``` - +:::tip `commands` also supports an array of folders! +```js title='src/config.js' +export const commands = ['./dist/commands', './dist/components'] +``` +This allows you to input your buttons, select menus, and modals separate from commands! +::: We will pass this file so sern can start properly. ```js title='src/index.js' @@ -68,10 +73,12 @@ export const OWNERS = ['182326315813306368'] :::caution -If you use javascript + common.js, star imports do not work. Please export an object default and put your configuration there. -```js -exports.default = { - commands : "./dist/commands", -} +Javascript + common.js is no longer supported! The following method will not work! +We use import/export context! +```diff +-exports.default = { +- commands : "./dist/commands", +-} ++export const commands = './dist/commands'; ``` ::: From 05b5961c16b6597ecf426400059a17f805bd38b1 Mon Sep 17 00:00:00 2001 From: Peter-MJ-Parker <34216187+Peter-MJ-Parker@users.noreply.github.com> Date: Sat, 12 Apr 2025 10:52:01 -0500 Subject: [PATCH 2/2] fix tip --- src/content/docs/v4/reference/config.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/content/docs/v4/reference/config.mdx b/src/content/docs/v4/reference/config.mdx index 303b02f33..97758f764 100644 --- a/src/content/docs/v4/reference/config.mdx +++ b/src/content/docs/v4/reference/config.mdx @@ -32,7 +32,8 @@ import { FileTree } from '@astrojs/starlight/components'; ```js title='src/config.js' export const commands = './dist/commands' ``` -:::tip `commands` also supports an array of folders! +:::tip +`commands` also supports an array of folders! ```js title='src/config.js' export const commands = ['./dist/commands', './dist/components'] ```