From 58440ffbf5384dba501bf04b05ea1b9339d69e3f Mon Sep 17 00:00:00 2001 From: H01001000 Date: Tue, 6 Dec 2022 00:36:56 +0800 Subject: [PATCH] fix: change deps from bot to dd --- apps/site/docs/generated/modules.md | 3 +- package.json | 6 +-- packages/embeds/src/index.ts | 8 +-- packages/plugins/cache/package.json | 2 +- .../plugins/cache/src/addCacheCollections.ts | 4 +- .../plugins/cache/src/dispatchRequirements.ts | 2 +- packages/plugins/cache/src/index.ts | 4 +- packages/plugins/cache/src/setupCacheEdits.ts | 2 +- .../plugins/cache/src/setupCacheRemovals.ts | 7 ++- packages/plugins/cache/src/sweepers.ts | 2 +- packages/plugins/fileloader/package.json | 2 +- packages/plugins/fileloader/src/index.ts | 2 +- packages/plugins/utils/index.ts | 8 +-- packages/plugins/utils/package.json | 2 +- packages/plugins/utils/src/channels.ts | 4 +- .../plugins/utils/src/disconnectMember.ts | 2 +- .../utils/src/fetchAndRetrieveMembers.ts | 2 +- .../plugins/utils/src/getMembersPaginated.ts | 4 +- packages/plugins/utils/src/moveMember.ts | 2 +- .../utils/src/sendAutoCompleteChoices.ts | 4 +- .../plugins/utils/src/sendDirectMessage.ts | 4 +- .../src/sendPrivateInteractionResponse.ts | 2 +- packages/plugins/utils/src/sendTextMessage.ts | 2 +- packages/plugins/utils/src/suppressEmbeds.ts | 2 +- packages/plugins/utils/src/threads.ts | 2 +- typedoc.json | 2 +- yarn.lock | 53 ++----------------- 27 files changed, 45 insertions(+), 94 deletions(-) diff --git a/apps/site/docs/generated/modules.md b/apps/site/docs/generated/modules.md index 67ae2209a..7ed710cf2 100644 --- a/apps/site/docs/generated/modules.md +++ b/apps/site/docs/generated/modules.md @@ -6,11 +6,10 @@ ### Modules -- [@discordeno/bot](modules/discordeno_bot.md) - [@discordeno/gateway](modules/discordeno_gateway.md) - [@discordeno/logger](modules/discordeno_logger.md) - [@discordeno/rest](modules/discordeno_rest.md) - [@discordeno/types](modules/discordeno_types.md) - [@discordeno/utils](modules/discordeno_utils.md) -- [bot](modules/bot.md) +- [@discordeno/client](modules/discordeno_client.md) - [discordeno](modules/discordeno.md) diff --git a/package.json b/package.json index 86b357c44..b81526f27 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,7 @@ "private": true, "type": "module", "workspaces": [ - "packages/*", - "packages/plugins/cache", - "packages/plugins/utils" + "packages/*" ], "scripts": { "build": "turbo run build", @@ -44,4 +42,4 @@ ] }, "packageManager": "yarn@3.3.0" -} +} \ No newline at end of file diff --git a/packages/embeds/src/index.ts b/packages/embeds/src/index.ts index 0463932f5..7f652b973 100644 --- a/packages/embeds/src/index.ts +++ b/packages/embeds/src/index.ts @@ -1,13 +1,15 @@ // The order of the import is important -import { +import type { DiscordEmbed, Embed, - formatImageURL, - iconBigintToHash, ImageFormat, ImageSize, User } from './deps.js' +import { + formatImageURL, + iconBigintToHash +} from './deps.js' import { routes } from '@discordeno/utils' diff --git a/packages/plugins/cache/package.json b/packages/plugins/cache/package.json index 5132790ec..5d0f796f4 100644 --- a/packages/plugins/cache/package.json +++ b/packages/plugins/cache/package.json @@ -22,7 +22,6 @@ "test:test-type": "tsc --project tsconfig.test.json" }, "devDependencies": { - "@discordeno/bot": "18.0.0-alpha.1", "@discordeno/gateway": "18.0.0-alpha.1", "@swc/cli": "^0.1.57", "@swc/core": "^1.3.21", @@ -32,6 +31,7 @@ "@types/sinon": "^10.0.13", "c8": "^7.12.0", "chai": "^4.3.7", + "discordeno": "18.0.0-alpha.1", "eslint": "^8.0.1", "eslint-config-discordeno": "*", "mocha": "^10.1.0", diff --git a/packages/plugins/cache/src/addCacheCollections.ts b/packages/plugins/cache/src/addCacheCollections.ts index 1219f5d85..1b860b190 100644 --- a/packages/plugins/cache/src/addCacheCollections.ts +++ b/packages/plugins/cache/src/addCacheCollections.ts @@ -9,8 +9,8 @@ import type { PresenceUpdate, User, Webhook -} from '@discordeno/bot' -import { Collection } from '@discordeno/bot' +} from 'discordeno' +import { Collection } from 'discordeno' export type BotWithCache = Omit & CacheProps & { diff --git a/packages/plugins/cache/src/dispatchRequirements.ts b/packages/plugins/cache/src/dispatchRequirements.ts index b7d725981..3b7447ff2 100644 --- a/packages/plugins/cache/src/dispatchRequirements.ts +++ b/packages/plugins/cache/src/dispatchRequirements.ts @@ -1,5 +1,5 @@ -import type { Bot, DiscordGatewayPayload, Guild } from '@discordeno/bot' import type { Shard } from '@discordeno/gateway' +import type { Bot, DiscordGatewayPayload, Guild } from 'discordeno' import type { BotWithCache } from './addCacheCollections.js' const processing = new Set() diff --git a/packages/plugins/cache/src/index.ts b/packages/plugins/cache/src/index.ts index 51b854567..06df6d100 100644 --- a/packages/plugins/cache/src/index.ts +++ b/packages/plugins/cache/src/index.ts @@ -1,5 +1,5 @@ -import type { Bot, DiscordGuildEmojisUpdate } from '@discordeno/bot' -import { Collection } from '@discordeno/bot' +import type { Bot, DiscordGuildEmojisUpdate } from 'discordeno' +import { Collection } from 'discordeno' import type { BotWithCache } from './addCacheCollections.js' import { addCacheCollections } from './addCacheCollections.js' import { setupCacheEdits } from './setupCacheEdits.js' diff --git a/packages/plugins/cache/src/setupCacheEdits.ts b/packages/plugins/cache/src/setupCacheEdits.ts index 7b4f75ef8..b40f1eefe 100644 --- a/packages/plugins/cache/src/setupCacheEdits.ts +++ b/packages/plugins/cache/src/setupCacheEdits.ts @@ -6,7 +6,7 @@ import type { DiscordMessageReactionRemove, DiscordMessageReactionRemoveAll, DiscordVoiceState -} from '@discordeno/bot' +} from 'discordeno' import type { BotWithCache } from './addCacheCollections.js' export function setupCacheEdits (bot: BotWithCache): void { diff --git a/packages/plugins/cache/src/setupCacheRemovals.ts b/packages/plugins/cache/src/setupCacheRemovals.ts index 8951d0856..3b62cf41f 100644 --- a/packages/plugins/cache/src/setupCacheRemovals.ts +++ b/packages/plugins/cache/src/setupCacheRemovals.ts @@ -1,5 +1,4 @@ import type { - Emoji, Bot, DiscordChannel, DiscordGuildBanAddRemove, @@ -9,9 +8,9 @@ import type { DiscordMessageDelete, DiscordMessageDeleteBulk, DiscordUnavailableGuild, - DiscordVoiceState -} from '@discordeno/bot' -import { Collection } from '@discordeno/bot' + DiscordVoiceState, Emoji +} from 'discordeno' +import { Collection } from 'discordeno' import type { BotWithCache } from './addCacheCollections.js' export function setupCacheRemovals (bot: BotWithCache): void { diff --git a/packages/plugins/cache/src/sweepers.ts b/packages/plugins/cache/src/sweepers.ts index 453f830fa..d5a2e85af 100644 --- a/packages/plugins/cache/src/sweepers.ts +++ b/packages/plugins/cache/src/sweepers.ts @@ -1,4 +1,4 @@ -import type { Bot, Member } from '@discordeno/bot' +import type { Bot, Member } from 'discordeno' import type { BotWithCache } from './addCacheCollections.js' import { dispatchRequirements } from './dispatchRequirements.js' diff --git a/packages/plugins/fileloader/package.json b/packages/plugins/fileloader/package.json index 21d529855..635f873a6 100644 --- a/packages/plugins/fileloader/package.json +++ b/packages/plugins/fileloader/package.json @@ -27,7 +27,7 @@ "eslint": "^8.0.1", "eslint-config-discordeno": "*", "tsconfig": "*", - "@discordeno/bot": "18.0.0-alpha.1", + "discordeno": "18.0.0-alpha.1", "typescript": "^4.9.3" }, "dependencies": { diff --git a/packages/plugins/fileloader/src/index.ts b/packages/plugins/fileloader/src/index.ts index 3f947e0f6..ceb9a1237 100644 --- a/packages/plugins/fileloader/src/index.ts +++ b/packages/plugins/fileloader/src/index.ts @@ -1,4 +1,4 @@ -import { Bot } from '@discordeno/bot' +import type { Bot } from 'discordeno' // iMpOrTaNt to make sure files can be reloaded properly! export let uniqueFilePathCounter = 0 diff --git a/packages/plugins/utils/index.ts b/packages/plugins/utils/index.ts index f3a363284..b851b1ef8 100644 --- a/packages/plugins/utils/index.ts +++ b/packages/plugins/utils/index.ts @@ -1,4 +1,4 @@ -import { +import type { ApplicationCommandOptionChoice, BigString, Bot, @@ -10,8 +10,8 @@ import { ListGuildMembers, Member, Message -} from '@discordeno/bot' -import { BotWithCache } from '../cache/src/addCacheCollections.js' +} from 'discordeno' +import type { BotWithCache } from '../cache/src/addCacheCollections.js' import { cloneChannel } from './src/channels.js' import { disconnectMember } from './src/disconnectMember.js' import { fetchAndRetrieveMembers } from './src/fetchAndRetrieveMembers.js' @@ -22,11 +22,11 @@ import { sendDirectMessage } from './src/sendDirectMessage.js' import { sendPrivateInteractionResponse } from './src/sendPrivateInteractionResponse.js' import { sendTextMessage } from './src/sendTextMessage.js' import { suppressEmbeds } from './src/suppressEmbeds.js' +import type { ModifyThread } from './src/threads.js' import { archiveThread, editThread, lockThread, - ModifyThread, unarchiveThread, unlockThread } from './src/threads.js' diff --git a/packages/plugins/utils/package.json b/packages/plugins/utils/package.json index 06f0a9c2f..c1f0e82d5 100644 --- a/packages/plugins/utils/package.json +++ b/packages/plugins/utils/package.json @@ -22,7 +22,6 @@ "test:test-type": "tsc --project tsconfig.test.json" }, "devDependencies": { - "@discordeno/bot": "18.0.0-alpha.1", "@swc/cli": "^0.1.57", "@swc/core": "^1.3.21", "@types/chai": "^4", @@ -31,6 +30,7 @@ "@types/sinon": "^10.0.13", "c8": "^7.12.0", "chai": "^4.3.7", + "discordeno": "18.0.0-alpha.1", "eslint": "^8.0.1", "eslint-config-discordeno": "*", "mocha": "^10.1.0", diff --git a/packages/plugins/utils/src/channels.ts b/packages/plugins/utils/src/channels.ts index ac1ef38e6..16e8ee9d9 100644 --- a/packages/plugins/utils/src/channels.ts +++ b/packages/plugins/utils/src/channels.ts @@ -1,5 +1,5 @@ -import type { Bot, Channel, CreateGuildChannel } from '@discordeno/bot' -import { separateOverwrites } from '@discordeno/bot' +import type { Bot, Channel, CreateGuildChannel } from 'discordeno' +import { separateOverwrites } from 'discordeno' /** Create a copy of a channel */ export async function cloneChannel ( diff --git a/packages/plugins/utils/src/disconnectMember.ts b/packages/plugins/utils/src/disconnectMember.ts index 464c994c6..e7d22c910 100644 --- a/packages/plugins/utils/src/disconnectMember.ts +++ b/packages/plugins/utils/src/disconnectMember.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, Member } from '@discordeno/bot' +import type { BigString, Bot, Member } from 'discordeno' /** Kicks a member from a voice channel */ export async function disconnectMember ( diff --git a/packages/plugins/utils/src/fetchAndRetrieveMembers.ts b/packages/plugins/utils/src/fetchAndRetrieveMembers.ts index 0c8135df8..1a0ed4996 100644 --- a/packages/plugins/utils/src/fetchAndRetrieveMembers.ts +++ b/packages/plugins/utils/src/fetchAndRetrieveMembers.ts @@ -1,4 +1,4 @@ -import type { BigString, Collection, Member } from '@discordeno/bot' +import type { BigString, Collection, Member } from 'discordeno' import type { BotWithCache } from '../../cache/src/addCacheCollections.js' /** Fetch members for an entire guild then return the entire guilds cached members. */ diff --git a/packages/plugins/utils/src/getMembersPaginated.ts b/packages/plugins/utils/src/getMembersPaginated.ts index ecbdb5bb8..5fa613d6f 100644 --- a/packages/plugins/utils/src/getMembersPaginated.ts +++ b/packages/plugins/utils/src/getMembersPaginated.ts @@ -4,8 +4,8 @@ import type { DiscordMemberWithUser, ListGuildMembers, Member -} from '@discordeno/bot' -import { Collection } from '@discordeno/bot' +} from 'discordeno' +import { Collection } from 'discordeno' /** * Highly recommended to **NOT** use this function to get members instead use fetchMembers(). diff --git a/packages/plugins/utils/src/moveMember.ts b/packages/plugins/utils/src/moveMember.ts index 99be400fe..c67ad817c 100644 --- a/packages/plugins/utils/src/moveMember.ts +++ b/packages/plugins/utils/src/moveMember.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, Member } from '@discordeno/bot' +import type { BigString, Bot, Member } from 'discordeno' /** * Move a member from a voice channel to another. diff --git a/packages/plugins/utils/src/sendAutoCompleteChoices.ts b/packages/plugins/utils/src/sendAutoCompleteChoices.ts index a297f3d5f..1254f3919 100644 --- a/packages/plugins/utils/src/sendAutoCompleteChoices.ts +++ b/packages/plugins/utils/src/sendAutoCompleteChoices.ts @@ -2,8 +2,8 @@ import type { ApplicationCommandOptionChoice, BigString, Bot -} from '@discordeno/bot' -import { InteractionResponseTypes } from '@discordeno/bot' +} from 'discordeno' +import { InteractionResponseTypes } from 'discordeno' export async function sendAutocompleteChoices ( bot: Bot, diff --git a/packages/plugins/utils/src/sendDirectMessage.ts b/packages/plugins/utils/src/sendDirectMessage.ts index 6c15145b8..ad80f0569 100644 --- a/packages/plugins/utils/src/sendDirectMessage.ts +++ b/packages/plugins/utils/src/sendDirectMessage.ts @@ -1,5 +1,5 @@ -import type { BigString, Bot, CreateMessage, Message } from '@discordeno/bot' -import { Collection } from '@discordeno/bot' +import type { BigString, Bot, CreateMessage, Message } from 'discordeno' +import { Collection } from 'discordeno' /** Maps the for dm channels */ export const dmChannelIds = new Collection() diff --git a/packages/plugins/utils/src/sendPrivateInteractionResponse.ts b/packages/plugins/utils/src/sendPrivateInteractionResponse.ts index a085209a0..6bee376c5 100644 --- a/packages/plugins/utils/src/sendPrivateInteractionResponse.ts +++ b/packages/plugins/utils/src/sendPrivateInteractionResponse.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, InteractionResponse } from '@discordeno/bot' +import type { BigString, Bot, InteractionResponse } from 'discordeno' /** sendInteractionResponse with ephemeral reply */ export async function sendPrivateInteractionResponse ( diff --git a/packages/plugins/utils/src/sendTextMessage.ts b/packages/plugins/utils/src/sendTextMessage.ts index e542e5579..5f660ac8b 100644 --- a/packages/plugins/utils/src/sendTextMessage.ts +++ b/packages/plugins/utils/src/sendTextMessage.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, CreateMessage, Message } from '@discordeno/bot' +import type { BigString, Bot, CreateMessage, Message } from 'discordeno' /** Sends a text message. */ export async function sendTextMessage ( diff --git a/packages/plugins/utils/src/suppressEmbeds.ts b/packages/plugins/utils/src/suppressEmbeds.ts index 015e1047f..c55d4be49 100644 --- a/packages/plugins/utils/src/suppressEmbeds.ts +++ b/packages/plugins/utils/src/suppressEmbeds.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, DiscordMessage, Message } from '@discordeno/bot' +import type { BigString, Bot, DiscordMessage, Message } from 'discordeno' /** Suppress all the embeds in this message */ export async function suppressEmbeds ( diff --git a/packages/plugins/utils/src/threads.ts b/packages/plugins/utils/src/threads.ts index d0b554915..e9ebd87e6 100644 --- a/packages/plugins/utils/src/threads.ts +++ b/packages/plugins/utils/src/threads.ts @@ -1,4 +1,4 @@ -import type { BigString, Bot, Channel, DiscordChannel } from '@discordeno/bot' +import type { BigString, Bot, Channel, DiscordChannel } from 'discordeno' /** Sets a thread channel to be archived. */ export async function archiveThread ( diff --git a/typedoc.json b/typedoc.json index ebf6f46b3..37ae35ab2 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,7 +1,7 @@ { "entryPointStrategy": "packages", "entryPoints": [ - "packages/bot", + "packages/client", "packages/discordeno", "packages/gateway", "packages/logger", diff --git a/yarn.lock b/yarn.lock index 937cd01c9..a8d6d3150 100644 --- a/yarn.lock +++ b/yarn.lock @@ -21,37 +21,10 @@ __metadata: languageName: node linkType: hard -"@discordeno/bot@18.0.0-alpha.1, @discordeno/bot@workspace:packages/bot": - version: 0.0.0-use.local - resolution: "@discordeno/bot@workspace:packages/bot" - dependencies: - "@discordeno/gateway": 18.0.0-alpha.1 - "@discordeno/rest": 18.0.0-alpha.1 - "@discordeno/types": 18.0.0-alpha.1 - "@discordeno/utils": 18.0.0-alpha.1 - "@swc/cli": ^0.1.57 - "@swc/core": ^1.3.21 - "@types/chai": ^4 - "@types/mocha": ^10 - "@types/node": ^18.11.9 - "@types/sinon": ^10.0.13 - c8: ^7.12.0 - chai: ^4.3.7 - eslint: ^8.0.1 - eslint-config-discordeno: "*" - mocha: ^10.1.0 - shx: ^0.3.4 - sinon: ^15.0.0 - tsconfig: "*" - typescript: ^4.9.3 - languageName: unknown - linkType: soft - "@discordeno/cache-plugin@workspace:packages/plugins/cache": version: 0.0.0-use.local resolution: "@discordeno/cache-plugin@workspace:packages/plugins/cache" dependencies: - "@discordeno/bot": 18.0.0-alpha.1 "@discordeno/gateway": 18.0.0-alpha.1 "@swc/cli": ^0.1.57 "@swc/core": ^1.3.21 @@ -61,6 +34,7 @@ __metadata: "@types/sinon": ^10.0.13 c8: ^7.12.0 chai: ^4.3.7 + discordeno: 18.0.0-alpha.1 eslint: ^8.0.1 eslint-config-discordeno: "*" mocha: ^10.1.0 @@ -141,7 +115,7 @@ __metadata: languageName: unknown linkType: soft -"@discordeno/logger@18.0.0-alpha.1, @discordeno/logger@workspace:packages/logger": +"@discordeno/logger@workspace:packages/logger": version: 0.0.0-use.local resolution: "@discordeno/logger@workspace:packages/logger" dependencies: @@ -208,7 +182,6 @@ __metadata: version: 0.0.0-use.local resolution: "@discordeno/utils-plugin@workspace:packages/plugins/utils" dependencies: - "@discordeno/bot": 18.0.0-alpha.1 "@swc/cli": ^0.1.57 "@swc/core": ^1.3.21 "@types/chai": ^4 @@ -217,6 +190,7 @@ __metadata: "@types/sinon": ^10.0.13 c8: ^7.12.0 chai: ^4.3.7 + discordeno: 18.0.0-alpha.1 eslint: ^8.0.1 eslint-config-discordeno: "*" mocha: ^10.1.0 @@ -4034,27 +4008,6 @@ __metadata: languageName: node linkType: hard -"tester@workspace:packages/tester": - version: 0.0.0-use.local - resolution: "tester@workspace:packages/tester" - dependencies: - "@discordeno/logger": 18.0.0-alpha.1 - "@swc/cli": ^0.1.57 - "@swc/core": ^1.3.21 - "@types/chai": ^4 - "@types/mocha": ^10 - "@types/node": ^18.11.9 - "@types/sinon": ^10.0.13 - chalk: ^5.1.2 - discordeno: 18.0.0-alpha.1 - eslint: ^8.0.1 - eslint-config-discordeno: "*" - ts-node: ^10.9.1 - tsconfig: "*" - typescript: ^4.9.3 - languageName: unknown - linkType: soft - "text-table@npm:^0.2.0": version: 0.2.0 resolution: "text-table@npm:0.2.0"