Skip to content

Commit ca7e127

Browse files
committed
feat: Restructure docs commands - add baseline command
- delete old providers file - extract proviers to seperate files - add baseline command
1 parent cfb5c03 commit ca7e127

5 files changed

Lines changed: 326 additions & 307 deletions

File tree

src/commands/docs/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { ApplicationCommandOptionType } from 'discord.js';
22
import { createCommands } from '../../util/commands.js';
3-
import { type DocProvider, docProviders, executeDocCommand } from './providers.js';
3+
import { baselineProvider } from './providers/baseline.js';
4+
import { mdnProvider } from './providers/mdn.js';
5+
import { npmProvider } from './providers/npm.js';
6+
import type { ProviderConfig } from './types.js';
7+
import { executeDocCommand } from './utils.js';
8+
9+
const docProviders = {
10+
mdn: mdnProvider,
11+
npm: npmProvider,
12+
baseline: baselineProvider,
13+
};
414

515
export const docsCommands = createCommands(
616
Object.entries(docProviders).map(([providerKey, providerConfig]) => ({
@@ -22,6 +32,7 @@ export const docsCommands = createCommands(
2232
},
2333
],
2434
},
25-
execute: async (interaction) => executeDocCommand(providerKey as DocProvider, interaction),
35+
execute: async (interaction) =>
36+
executeDocCommand(providerConfig as ProviderConfig, interaction),
2637
}))
2738
);

src/commands/docs/providers.ts

Lines changed: 0 additions & 305 deletions
This file was deleted.

0 commit comments

Comments
 (0)