Skip to content

Commit

Permalink
docs: fix version export (#9049)
Browse files Browse the repository at this point in the history
* docs: fix version export

* types: assert `[VI]{{inject}}[/VI]` as string

* types: typo

* Revert "types: typo"

This reverts commit ba983f0.

* types: typo

I hate my local repo. It can't install deps with `--immutable` and a have weird error on `yarn test`, but the CI passes
  • Loading branch information
Syjalo committed Jan 19, 2023
1 parent 56ef3ad commit 8b70f49
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
3 changes: 1 addition & 2 deletions packages/builders/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ export * from '@discordjs/util';
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
3 changes: 1 addition & 2 deletions packages/collection/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ export * from './collection.js';
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
5 changes: 2 additions & 3 deletions packages/next/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/discord.js-next/#readme | @discordjs/discord.js-next} version
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/next/#readme | @discordjs/next} version
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
3 changes: 1 addition & 2 deletions packages/rest/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ export { makeURLSearchParams, parseResponse } from './lib/utils/utils.js';
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
3 changes: 2 additions & 1 deletion packages/rest/src/lib/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { APIVersion } from 'discord-api-types/v10';
import { Agent } from 'undici';
import type { RESTOptions } from '../REST.js';

export const DefaultUserAgent = `DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])`;
export const DefaultUserAgent =
`DiscordBot (https://discord.js.org, [VI]{{inject}}[/VI])` as `DiscordBot (https://discord.js.org, ${string})`;

export const DefaultRestOptions = {
get agent() {
Expand Down
3 changes: 1 addition & 2 deletions packages/voice/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ export { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } f
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
3 changes: 1 addition & 2 deletions packages/ws/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ export * from './ws/WebSocketShard.js';
* that you are currently using.
*/
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
export const version: string = '[VI]{{inject}}[/VI]';
export const version = '[VI]{{inject}}[/VI]' as string;
2 changes: 1 addition & 1 deletion packages/ws/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export enum CompressionMethod {
ZlibStream = 'zlib-stream',
}

export const DefaultDeviceProperty = `@discordjs/ws [VI]{{inject}}[/VI]`;
export const DefaultDeviceProperty = `@discordjs/ws [VI]{{inject}}[/VI]` as `@discordjs/ws ${string}`;

const getDefaultSessionStore = lazy(() => new Collection<number, SessionInfo | null>());

Expand Down

2 comments on commit 8b70f49

@vercel
Copy link

@vercel vercel bot commented on 8b70f49 Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8b70f49 Jan 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.