mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-08 01:41:18 +12:00
build: multi-config build and dep update
This commit is contained in:
parent
75fc7f2454
commit
8f432400d8
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -86,7 +86,7 @@
|
||||||
"hastscript": "^8.0.0",
|
"hastscript": "^8.0.0",
|
||||||
"html-escaper": "^3.0.3",
|
"html-escaper": "^3.0.3",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"unocss": "^0.57.3",
|
"unocss": "^0.57.3",
|
||||||
|
|
2
apps/website/.lintstagedrc.cjs
Normal file
2
apps/website/.lintstagedrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
|
module.exports = require('../../.lintstagedrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.lintstagedrc.json' assert { type: 'json' };
|
|
2
apps/website/.prettierrc.cjs
Normal file
2
apps/website/.prettierrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
|
module.exports = require('../../.prettierrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.prettierrc.json' assert { type: 'json' };
|
|
|
@ -92,7 +92,7 @@
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"happy-dom": "^12.10.3",
|
"happy-dom": "^12.10.3",
|
||||||
"postcss": "^8.4.31",
|
"postcss": "^8.4.31",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vercel": "^32.5.3",
|
"vercel": "^32.5.3",
|
||||||
|
|
|
@ -27,7 +27,7 @@ export const generateStaticParams = async () => {
|
||||||
const params: VersionRouteParams[] = [];
|
const params: VersionRouteParams[] = [];
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PACKAGES.slice(1).map(async (packageName) => {
|
PACKAGES.map(async (packageName) => {
|
||||||
const versions = (await fetchVersions(packageName)).slice(0, N_RECENT_VERSIONS);
|
const versions = (await fetchVersions(packageName)).slice(0, N_RECENT_VERSIONS);
|
||||||
|
|
||||||
params.push(...versions.map((version) => ({ package: packageName, version })));
|
params.push(...versions.map((version) => ({ package: packageName, version })));
|
||||||
|
|
|
@ -17,7 +17,10 @@ export function InstallButton() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={buttonVariants({ variant: 'secondary', className: 'cursor-copy font-mono' })}
|
className={buttonVariants({
|
||||||
|
variant: 'secondary',
|
||||||
|
className: 'cursor-copy font-mono',
|
||||||
|
})}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setInteracted(true);
|
setInteracted(true);
|
||||||
copyToClipboard('npm install discord.js');
|
copyToClipboard('npm install discord.js');
|
||||||
|
|
|
@ -15,7 +15,10 @@ export default function OverloadSwitcher({
|
||||||
methodName,
|
methodName,
|
||||||
overloads,
|
overloads,
|
||||||
children,
|
children,
|
||||||
}: PropsWithChildren<{ readonly methodName: string; readonly overloads: ReactNode[] }>) {
|
}: PropsWithChildren<{
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly overloads: ReactNode[];
|
||||||
|
}>) {
|
||||||
const [hash, setHash] = useState(() => (typeof window === 'undefined' ? '' : window.location.hash));
|
const [hash, setHash] = useState(() => (typeof window === 'undefined' ? '' : window.location.hash));
|
||||||
const hashChangeHandler = useCallback(() => {
|
const hashChangeHandler = useCallback(() => {
|
||||||
setHash(window.location.hash);
|
setHash(window.location.hash);
|
||||||
|
|
|
@ -12,7 +12,11 @@ export default function PackageSelect() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const packageName = pathname?.split('/').slice(3, 4)[0];
|
const packageName = pathname?.split('/').slice(3, 4)[0];
|
||||||
|
|
||||||
const packageMenu = useMenuState({ gutter: 8, sameWidth: true, fitViewport: true });
|
const packageMenu = useMenuState({
|
||||||
|
gutter: 8,
|
||||||
|
sameWidth: true,
|
||||||
|
fitViewport: true,
|
||||||
|
});
|
||||||
|
|
||||||
const packageMenuItems = useMemo(
|
const packageMenuItems = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|
|
@ -14,7 +14,11 @@ export default function VersionSelect({ versions }: { readonly versions: string[
|
||||||
const packageName = pathname?.split('/').slice(3, 4)[0];
|
const packageName = pathname?.split('/').slice(3, 4)[0];
|
||||||
const branchName = pathname?.split('/').slice(4, 5)[0];
|
const branchName = pathname?.split('/').slice(4, 5)[0];
|
||||||
|
|
||||||
const versionMenu = useMenuState({ gutter: 8, sameWidth: true, fitViewport: true });
|
const versionMenu = useMenuState({
|
||||||
|
gutter: 8,
|
||||||
|
sameWidth: true,
|
||||||
|
fitViewport: true,
|
||||||
|
});
|
||||||
|
|
||||||
const versionMenuItems = useMemo(
|
const versionMenuItems = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|
|
@ -13,7 +13,9 @@ export function Block({ children, title }: PropsWithChildren<{ readonly title: s
|
||||||
export function ExampleBlock({
|
export function ExampleBlock({
|
||||||
children,
|
children,
|
||||||
exampleIndex,
|
exampleIndex,
|
||||||
}: PropsWithChildren<{ readonly exampleIndex?: number | undefined }>): JSX.Element {
|
}: PropsWithChildren<{
|
||||||
|
readonly exampleIndex?: number | undefined;
|
||||||
|
}>): JSX.Element {
|
||||||
return <Block title={`Example ${exampleIndex ? exampleIndex : ''}`}>{children}</Block>;
|
return <Block title={`Example ${exampleIndex ? exampleIndex : ''}`}>{children}</Block>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,10 @@ import {
|
||||||
useMemo,
|
useMemo,
|
||||||
} from 'react';
|
} from 'react';
|
||||||
|
|
||||||
export const NavContext = createContext<{ opened: boolean; setOpened: Dispatch<SetStateAction<boolean>> }>({
|
export const NavContext = createContext<{
|
||||||
|
opened: boolean;
|
||||||
|
setOpened: Dispatch<SetStateAction<boolean>>;
|
||||||
|
}>({
|
||||||
opened: false,
|
opened: false,
|
||||||
setOpened: (_) => {},
|
setOpened: (_) => {},
|
||||||
});
|
});
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^18.4.0",
|
"@commitlint/cli": "^18.4.1",
|
||||||
"@commitlint/config-angular": "^18.4.0",
|
"@commitlint/config-angular": "^18.4.0",
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@favware/npm-deprecate": "^1.0.7",
|
"@favware/npm-deprecate": "^1.0.7",
|
||||||
|
@ -63,6 +63,7 @@
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"lint-staged": "^15.1.0",
|
"lint-staged": "^15.1.0",
|
||||||
"lodash.merge": "^4.6.2",
|
"lodash.merge": "^4.6.2",
|
||||||
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
2
packages/actions/.lintstagedrc.cjs
Normal file
2
packages/actions/.lintstagedrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
|
module.exports = require('../../.lintstagedrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.lintstagedrc.json' assert { type: 'json' };
|
|
2
packages/actions/.prettierrc.cjs
Normal file
2
packages/actions/.prettierrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
|
module.exports = require('../../.prettierrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.prettierrc.json' assert { type: 'json' };
|
|
|
@ -3,24 +3,44 @@ import { formatTag } from '../src/index.js';
|
||||||
|
|
||||||
describe('Format Tag', () => {
|
describe('Format Tag', () => {
|
||||||
test('GIVEN tag with a prefix THEN format tag to not contain the prefix', () => {
|
test('GIVEN tag with a prefix THEN format tag to not contain the prefix', () => {
|
||||||
expect(formatTag('@discordjs/rest@0.4.0')).toEqual({ isSubpackage: true, package: 'rest', semver: '0.4.0' });
|
expect(formatTag('@discordjs/rest@0.4.0')).toEqual({
|
||||||
|
isSubpackage: true,
|
||||||
|
package: 'rest',
|
||||||
|
semver: '0.4.0',
|
||||||
|
});
|
||||||
expect(formatTag('@discordjs/collection@0.6.0')).toEqual({
|
expect(formatTag('@discordjs/collection@0.6.0')).toEqual({
|
||||||
isSubpackage: true,
|
isSubpackage: true,
|
||||||
package: 'collection',
|
package: 'collection',
|
||||||
semver: '0.6.0',
|
semver: '0.6.0',
|
||||||
});
|
});
|
||||||
expect(formatTag('@discordjs/proxy@0.1.0')).toEqual({ isSubpackage: true, package: 'proxy', semver: '0.1.0' });
|
expect(formatTag('@discordjs/proxy@0.1.0')).toEqual({
|
||||||
|
isSubpackage: true,
|
||||||
|
package: 'proxy',
|
||||||
|
semver: '0.1.0',
|
||||||
|
});
|
||||||
expect(formatTag('@discordjs/builders@0.13.0')).toEqual({
|
expect(formatTag('@discordjs/builders@0.13.0')).toEqual({
|
||||||
isSubpackage: true,
|
isSubpackage: true,
|
||||||
package: 'builders',
|
package: 'builders',
|
||||||
semver: '0.13.0',
|
semver: '0.13.0',
|
||||||
});
|
});
|
||||||
expect(formatTag('@discordjs/voice@0.9.0')).toEqual({ isSubpackage: true, package: 'voice', semver: '0.9.0' });
|
expect(formatTag('@discordjs/voice@0.9.0')).toEqual({
|
||||||
|
isSubpackage: true,
|
||||||
|
package: 'voice',
|
||||||
|
semver: '0.9.0',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('GIVEN tag with no prefix THEN return tag', () => {
|
test('GIVEN tag with no prefix THEN return tag', () => {
|
||||||
expect(formatTag('13.5.1')).toEqual({ isSubpackage: false, package: 'discord.js', semver: '13.5.1' });
|
expect(formatTag('13.5.1')).toEqual({
|
||||||
expect(formatTag('13.7.0')).toEqual({ isSubpackage: false, package: 'discord.js', semver: '13.7.0' });
|
isSubpackage: false,
|
||||||
|
package: 'discord.js',
|
||||||
|
semver: '13.5.1',
|
||||||
|
});
|
||||||
|
expect(formatTag('13.7.0')).toEqual({
|
||||||
|
isSubpackage: false,
|
||||||
|
package: 'discord.js',
|
||||||
|
semver: '13.7.0',
|
||||||
|
});
|
||||||
expect(formatTag('create-discord-bot@1.0.0')).toEqual({
|
expect(formatTag('create-discord-bot@1.0.0')).toEqual({
|
||||||
isSubpackage: false,
|
isSubpackage: false,
|
||||||
package: 'create-discord-bot',
|
package: 'create-discord-bot',
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0"
|
"turbo": "^1.10.17-canary.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig();
|
export default createTsupConfig({
|
||||||
|
minify: 'terser',
|
||||||
|
});
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0"
|
"turbo": "^1.10.17-canary.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1206,8 +1206,8 @@ export class ApiModelGenerator {
|
||||||
const isStatic: boolean = astDeclaration
|
const isStatic: boolean = astDeclaration
|
||||||
? (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0
|
? (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0
|
||||||
: parentApiItem.kind === ApiItemKind.Class || parentApiItem.kind === ApiItemKind.Interface
|
: parentApiItem.kind === ApiItemKind.Class || parentApiItem.kind === ApiItemKind.Interface
|
||||||
? (jsDoc as DocgenPropertyJson).scope === 'static'
|
? (jsDoc as DocgenPropertyJson).scope === 'static'
|
||||||
: false;
|
: false;
|
||||||
const containerKey: string = ApiProperty.getContainerKey(name, isStatic);
|
const containerKey: string = ApiProperty.getContainerKey(name, isStatic);
|
||||||
|
|
||||||
let apiProperty: ApiProperty | undefined = parentApiItem.tryGetMemberByKey(containerKey) as ApiProperty;
|
let apiProperty: ApiProperty | undefined = parentApiItem.tryGetMemberByKey(containerKey) as ApiProperty;
|
||||||
|
|
|
@ -2,6 +2,7 @@ import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig({
|
export default createTsupConfig({
|
||||||
entry: ['src/**/*.ts'],
|
entry: ['src/**/*.ts'],
|
||||||
|
minify: 'terser',
|
||||||
cjsInterop: true,
|
cjsInterop: true,
|
||||||
noExternal: ['@microsoft/tsdoc*'],
|
noExternal: ['@microsoft/tsdoc*'],
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -71,15 +71,16 @@
|
||||||
"ioredis": "^5.3.2"
|
"ioredis": "^5.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.18.8",
|
"@types/node": "18.18.8",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"esbuild-plugin-version-injector": "^1.2.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -3,3 +3,11 @@ export * from './brokers/redis/PubSubRedis.js';
|
||||||
export * from './brokers/redis/RPCRedis.js';
|
export * from './brokers/redis/RPCRedis.js';
|
||||||
|
|
||||||
export * from './brokers/Broker.js';
|
export * from './brokers/Broker.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/brokers#readme | @discordjs/brokers} version
|
||||||
|
* that you are currently using.
|
||||||
|
*
|
||||||
|
* @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
|
||||||
|
*/
|
||||||
|
export const version = '[VI]{{inject}}[/VI]' as string;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig();
|
export default createTsupConfig({
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
});
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -73,8 +73,8 @@
|
||||||
"tslib": "^2.6.2"
|
"tslib": "^2.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "16.18.60",
|
"@types/node": "16.18.60",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -60,8 +60,8 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.18.8",
|
"@types/node": "18.18.8",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
export * from './collection.js';
|
export * from './collection.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/collection/#readme | @discordjs/collection} version
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/collection#readme | @discordjs/collection} version
|
||||||
* that you are currently using.
|
* 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
|
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -72,8 +72,8 @@
|
||||||
"discord-api-types": "0.37.61"
|
"discord-api-types": "0.37.61"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.18.8",
|
"@types/node": "18.18.8",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -4,7 +4,7 @@ export * from '../util/index.js';
|
||||||
export * from 'discord-api-types/v10';
|
export * from 'discord-api-types/v10';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core#readme | @discordjs/core} version
|
||||||
* that you are currently using.
|
* 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
|
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
||||||
|
|
|
@ -5,7 +5,7 @@ export * from './util/index.js';
|
||||||
export * from 'discord-api-types/v10';
|
export * from 'discord-api-types/v10';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/core#readme | @discordjs/core} version
|
||||||
* that you are currently using.
|
* 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
|
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig({
|
export default [
|
||||||
entry: {
|
createTsupConfig({
|
||||||
index: 'src/index.ts',
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
'http-only': 'src/http-only/index.ts',
|
}),
|
||||||
},
|
createTsupConfig({
|
||||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
entry: {
|
||||||
});
|
'http-only': 'src/http-only/index.ts',
|
||||||
|
},
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
2
packages/create-discord-bot/.lintstagedrc.cjs
Normal file
2
packages/create-discord-bot/.lintstagedrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
|
module.exports = require('../../.lintstagedrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.lintstagedrc.json' assert { type: 'json' };
|
|
2
packages/create-discord-bot/.prettierrc.cjs
Normal file
2
packages/create-discord-bot/.prettierrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
|
module.exports = require('../../.prettierrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.prettierrc.json' assert { type: 'json' };
|
|
|
@ -101,4 +101,9 @@ if (!deno && typescript === undefined && javascript === undefined) {
|
||||||
typescript = useTypescript;
|
typescript = useTypescript;
|
||||||
}
|
}
|
||||||
|
|
||||||
await createDiscordBot({ typescript, directory: projectDirectory, packageManager, installPackages });
|
await createDiscordBot({
|
||||||
|
typescript,
|
||||||
|
directory: projectDirectory,
|
||||||
|
packageManager,
|
||||||
|
installPackages,
|
||||||
|
});
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"terser": "^5.24.0",
|
"terser": "^5.24.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -67,7 +67,9 @@ export async function createDiscordBot({ directory, installPackages, typescript,
|
||||||
|
|
||||||
process.chdir(root);
|
process.chdir(root);
|
||||||
|
|
||||||
const newVSCodeSettings = await readFile('./.vscode/settings.json', { encoding: 'utf8' }).then((str) => {
|
const newVSCodeSettings = await readFile('./.vscode/settings.json', {
|
||||||
|
encoding: 'utf8',
|
||||||
|
}).then((str) => {
|
||||||
let newStr = str.replace('[REPLACE_ME]', deno || bun ? 'auto' : packageManager);
|
let newStr = str.replace('[REPLACE_ME]', deno || bun ? 'auto' : packageManager);
|
||||||
if (deno) {
|
if (deno) {
|
||||||
// @ts-expect-error: This is fine
|
// @ts-expect-error: This is fine
|
||||||
|
@ -87,7 +89,9 @@ export async function createDiscordBot({ directory, installPackages, typescript,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!deno) {
|
if (!deno) {
|
||||||
const newPackageJSON = await readFile('./package.json', { encoding: 'utf8' }).then((str) => {
|
const newPackageJSON = await readFile('./package.json', {
|
||||||
|
encoding: 'utf8',
|
||||||
|
}).then((str) => {
|
||||||
let newStr = str.replace('[REPLACE_ME]', directoryName);
|
let newStr = str.replace('[REPLACE_ME]', directoryName);
|
||||||
newStr = newStr.replaceAll('[REPLACE_IMPORT_EXT]', typescript ? 'ts' : 'js');
|
newStr = newStr.replaceAll('[REPLACE_IMPORT_EXT]', typescript ? 'ts' : 'js');
|
||||||
return newStr;
|
return newStr;
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3"
|
"prettier": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,6 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3"
|
"prettier": "^3.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,14 +72,14 @@
|
||||||
"@discordjs/docgen": "workspace:^",
|
"@discordjs/docgen": "workspace:^",
|
||||||
"@favware/cliff-jumper": "2.2.1",
|
"@favware/cliff-jumper": "2.2.1",
|
||||||
"@types/node": "16.18.60",
|
"@types/node": "16.18.60",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
||||||
"@typescript-eslint/parser": "^6.10.0",
|
"@typescript-eslint/parser": "^6.11.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"dtslint": "4.2.1",
|
"dtslint": "4.2.1",
|
||||||
"eslint": "8.53.0",
|
"eslint": "8.53.0",
|
||||||
"eslint-formatter-pretty": "5.0.0",
|
"eslint-formatter-pretty": "5.0.0",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"prettier": "3.0.3",
|
"prettier": "3.1.0",
|
||||||
"tsd": "0.29.0",
|
"tsd": "0.29.0",
|
||||||
"tslint": "6.1.3",
|
"tslint": "6.1.3",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
|
|
|
@ -167,8 +167,8 @@ class ClientApplication extends Application {
|
||||||
this.owner = data.team
|
this.owner = data.team
|
||||||
? new Team(this.client, data.team)
|
? new Team(this.client, data.team)
|
||||||
: data.owner
|
: data.owner
|
||||||
? this.client.users._add(data.owner)
|
? this.client.users._add(data.owner)
|
||||||
: this.owner ?? null;
|
: this.owner ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -242,8 +242,8 @@ class VoiceState extends Base {
|
||||||
request_to_speak_timestamp: options.requestToSpeak
|
request_to_speak_timestamp: options.requestToSpeak
|
||||||
? new Date().toISOString()
|
? new Date().toISOString()
|
||||||
: options.requestToSpeak === false
|
: options.requestToSpeak === false
|
||||||
? null
|
? null
|
||||||
: undefined,
|
: undefined,
|
||||||
suppress: options.suppressed,
|
suppress: options.suppressed,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
40
packages/discord.js/typings/index.d.ts
vendored
40
packages/discord.js/typings/index.d.ts
vendored
|
@ -955,8 +955,8 @@ export abstract class BaseChannel extends Base {
|
||||||
export type If<Value extends boolean, TrueResult, FalseResult = null> = Value extends true
|
export type If<Value extends boolean, TrueResult, FalseResult = null> = Value extends true
|
||||||
? TrueResult
|
? TrueResult
|
||||||
: Value extends false
|
: Value extends false
|
||||||
? FalseResult
|
? FalseResult
|
||||||
: TrueResult | FalseResult;
|
: TrueResult | FalseResult;
|
||||||
|
|
||||||
export class Client<Ready extends boolean = boolean> extends BaseClient {
|
export class Client<Ready extends boolean = boolean> extends BaseClient {
|
||||||
public constructor(options: ClientOptions);
|
public constructor(options: ClientOptions);
|
||||||
|
@ -1812,10 +1812,10 @@ export type CacheTypeReducer<
|
||||||
> = [State] extends ['cached']
|
> = [State] extends ['cached']
|
||||||
? CachedType
|
? CachedType
|
||||||
: [State] extends ['raw']
|
: [State] extends ['raw']
|
||||||
? RawType
|
? RawType
|
||||||
: [State] extends ['raw' | 'cached']
|
: [State] extends ['raw' | 'cached']
|
||||||
? PresentType
|
? PresentType
|
||||||
: Fallback;
|
: Fallback;
|
||||||
|
|
||||||
export type Interaction<Cached extends CacheType = CacheType> =
|
export type Interaction<Cached extends CacheType = CacheType> =
|
||||||
| ChatInputCommandInteraction<Cached>
|
| ChatInputCommandInteraction<Cached>
|
||||||
|
@ -5834,8 +5834,8 @@ export type GuildScheduledEventSetStatusArg<Status extends GuildScheduledEventSt
|
||||||
Status extends GuildScheduledEventStatus.Scheduled
|
Status extends GuildScheduledEventStatus.Scheduled
|
||||||
? GuildScheduledEventStatus.Active | GuildScheduledEventStatus.Canceled
|
? GuildScheduledEventStatus.Active | GuildScheduledEventStatus.Canceled
|
||||||
: Status extends GuildScheduledEventStatus.Active
|
: Status extends GuildScheduledEventStatus.Active
|
||||||
? GuildScheduledEventStatus.Completed
|
? GuildScheduledEventStatus.Completed
|
||||||
: never;
|
: never;
|
||||||
|
|
||||||
export interface GuildScheduledEventUser<WithMember> {
|
export interface GuildScheduledEventUser<WithMember> {
|
||||||
guildScheduledEventId: Snowflake;
|
guildScheduledEventId: Snowflake;
|
||||||
|
@ -6265,10 +6265,10 @@ export type Partialize<
|
||||||
[K in keyof Omit<PartialType, OverridableKeys>]: K extends 'partial'
|
[K in keyof Omit<PartialType, OverridableKeys>]: K extends 'partial'
|
||||||
? true
|
? true
|
||||||
: K extends NulledKeys
|
: K extends NulledKeys
|
||||||
? null
|
? null
|
||||||
: K extends NullableKeys
|
: K extends NullableKeys
|
||||||
? PartialType[K] | null
|
? PartialType[K] | null
|
||||||
: PartialType[K];
|
: PartialType[K];
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'lastMessageId'> {
|
export interface PartialDMChannel extends Partialize<DMChannel, null, null, 'lastMessageId'> {
|
||||||
|
@ -6648,14 +6648,14 @@ export interface ClientApplicationInstallParams {
|
||||||
export type Serialized<Value> = Value extends symbol | bigint | (() => any)
|
export type Serialized<Value> = Value extends symbol | bigint | (() => any)
|
||||||
? never
|
? never
|
||||||
: Value extends number | string | boolean | undefined
|
: Value extends number | string | boolean | undefined
|
||||||
? Value
|
? Value
|
||||||
: Value extends JSONEncodable<infer JSONResult>
|
: Value extends JSONEncodable<infer JSONResult>
|
||||||
? JSONResult
|
? JSONResult
|
||||||
: Value extends ReadonlyArray<infer ItemType>
|
: Value extends ReadonlyArray<infer ItemType>
|
||||||
? Serialized<ItemType>[]
|
? Serialized<ItemType>[]
|
||||||
: Value extends ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
: Value extends ReadonlyMap<unknown, unknown> | ReadonlySet<unknown>
|
||||||
? {}
|
? {}
|
||||||
: { [K in keyof Value]: Serialized<Value[K]> };
|
: { [K in keyof Value]: Serialized<Value[K]> };
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -71,7 +71,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
|
|
|
@ -30,7 +30,7 @@ export async function build({ input, custom: customDocs, root, output, newOutput
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('Parsing JSDocs in source files...');
|
console.log('Parsing JSDocs in source files...');
|
||||||
// eslint-disable-next-line n/no-sync
|
|
||||||
data = jsdoc2md.getTemplateDataSync({ files: input }) as (ChildTypes & RootTypes)[];
|
data = jsdoc2md.getTemplateDataSync({ files: input }) as (ChildTypes & RootTypes)[];
|
||||||
console.log(`${data.length} JSDoc items parsed.`);
|
console.log(`${data.length} JSDoc items parsed.`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,23 +99,23 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||||
type: child.type
|
type: child.type
|
||||||
? new DocumentedVarType({ names: [parseType(child.type)] }, this.config).serialize()
|
? new DocumentedVarType({ names: [parseType(child.type)] }, this.config).serialize()
|
||||||
: child.kindString === 'Method'
|
: child.kindString === 'Method'
|
||||||
? new DocumentedVarType(
|
? new DocumentedVarType(
|
||||||
{
|
{
|
||||||
names: [
|
names: [
|
||||||
parseType({
|
parseType({
|
||||||
type: 'reflection',
|
type: 'reflection',
|
||||||
declaration: child,
|
declaration: child,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
description: child.signatures?.[0]?.comment?.blockTags
|
description: child.signatures?.[0]?.comment?.blockTags
|
||||||
?.find((block) => block.tag === '@returns')
|
?.find((block) => block.tag === '@returns')
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
?.content.reduce((prev, curr) => (prev += curr.text), '')
|
?.content.reduce((prev, curr) => (prev += curr.text), '')
|
||||||
.trim(),
|
.trim(),
|
||||||
},
|
},
|
||||||
this.config,
|
this.config,
|
||||||
).serialize()
|
).serialize()
|
||||||
: undefined,
|
: undefined,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -57,15 +57,16 @@
|
||||||
"discord-api-types": "0.37.61"
|
"discord-api-types": "0.37.61"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "16.18.60",
|
"@types/node": "16.18.60",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"esbuild-plugin-version-injector": "^1.2.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1,2 +1,10 @@
|
||||||
export * from './escapers.js';
|
export * from './escapers.js';
|
||||||
export * from './formatters.js';
|
export * from './formatters.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version
|
||||||
|
* that you are currently using.
|
||||||
|
*
|
||||||
|
* @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
|
||||||
|
*/
|
||||||
|
export const version = '[VI]{{inject}}[/VI]' as string;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig({});
|
export default createTsupConfig({
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
});
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -74,8 +74,8 @@
|
||||||
"discord-api-types": "0.37.61"
|
"discord-api-types": "0.37.61"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.18.8",
|
"@types/node": "18.18.8",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/next/#readme | @discordjs/next} version
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/next#readme | @discordjs/next} version
|
||||||
* that you are currently using.
|
* 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
|
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
||||||
|
|
2
packages/proxy-container/.lintstagedrc.cjs
Normal file
2
packages/proxy-container/.lintstagedrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
|
module.exports = require('../../.lintstagedrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.lintstagedrc.json' assert { type: 'json' };
|
|
2
packages/proxy-container/.prettierrc.cjs
Normal file
2
packages/proxy-container/.prettierrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
|
module.exports = require('../../.prettierrc.json');
|
|
@ -1 +0,0 @@
|
||||||
export * from '../../.prettierrc.json' assert { type: 'json' };
|
|
|
@ -54,7 +54,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.2.2"
|
||||||
|
|
|
@ -4,5 +4,4 @@ export default createTsupConfig({
|
||||||
dts: false,
|
dts: false,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
minify: 'terser',
|
minify: 'terser',
|
||||||
keepNames: false,
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -76,10 +76,11 @@
|
||||||
"@types/supertest": "^2.0.16",
|
"@types/supertest": "^2.0.16",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"esbuild-plugin-version-injector": "^1.2.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"supertest": "^6.3.3",
|
"supertest": "^6.3.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
export * from './handlers/proxyRequests.js';
|
export * from './handlers/proxyRequests.js';
|
||||||
export * from './util/responseHelpers.js';
|
export * from './util/responseHelpers.js';
|
||||||
export type { RequestHandler } from './util/util.js';
|
export type { RequestHandler } from './util/util.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/proxy#readme | @discordjs/proxy} version
|
||||||
|
* that you are currently using.
|
||||||
|
*
|
||||||
|
* @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
|
||||||
|
*/
|
||||||
|
export const version = '[VI]{{inject}}[/VI]' as string;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig();
|
export default createTsupConfig({
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
});
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
...require('../../.lintstagedrc.json'),
|
...require('../../.lintstagedrc.json'),
|
||||||
'src/**.ts': 'vitest related --run --config ./vitest.config.ts',
|
'src/**.ts': 'vitest related --run --config ./vitest.config.ts',
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('prettier').Config} */
|
||||||
module.exports = require('../../.prettierrc.json');
|
module.exports = require('../../.prettierrc.json');
|
||||||
|
|
|
@ -93,8 +93,8 @@
|
||||||
"undici": "5.27.2"
|
"undici": "5.27.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.17.9",
|
"@types/node": "18.17.9",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
@ -102,7 +102,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -93,10 +93,10 @@ export class DiscordAPIError extends Error {
|
||||||
const nextKey = otherKey.startsWith('_')
|
const nextKey = otherKey.startsWith('_')
|
||||||
? key
|
? key
|
||||||
: key
|
: key
|
||||||
? Number.isNaN(Number(otherKey))
|
? Number.isNaN(Number(otherKey))
|
||||||
? `${key}.${otherKey}`
|
? `${key}.${otherKey}`
|
||||||
: `${key}[${otherKey}]`
|
: `${key}[${otherKey}]`
|
||||||
: otherKey;
|
: otherKey;
|
||||||
|
|
||||||
if (typeof val === 'string') {
|
if (typeof val === 'string') {
|
||||||
yield val;
|
yield val;
|
||||||
|
|
|
@ -8,7 +8,7 @@ export * from './lib/utils/types.js';
|
||||||
export { calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse } from './lib/utils/utils.js';
|
export { calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse } from './lib/utils/utils.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/rest/#readme | @discordjs/rest} version
|
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/rest#readme | @discordjs/rest} version
|
||||||
* that you are currently using.
|
* 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
|
// This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig({
|
export default [
|
||||||
entry: ['src/index.ts', 'src/web.ts', 'src/strategies/*.ts'],
|
createTsupConfig({
|
||||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
entry: ['src/index.ts'],
|
||||||
});
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
}),
|
||||||
|
createTsupConfig({
|
||||||
|
entry: ['src/web.ts'],
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
}),
|
||||||
|
createTsupConfig({
|
||||||
|
entry: ['src/strategies/*.ts'],
|
||||||
|
outDir: 'dist/strategies',
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
module.exports = require('../../.lintstagedrc.json');
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"turbo": "^1.10.17-canary.0",
|
"turbo": "^1.10.17-canary.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||||
import { createTsupConfig } from '../../tsup.config.js';
|
import { createTsupConfig } from '../../tsup.config.js';
|
||||||
|
|
||||||
export default createTsupConfig();
|
export default createTsupConfig({
|
||||||
|
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||||
|
});
|
||||||
|
|
|
@ -52,15 +52,16 @@
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@favware/cliff-jumper": "^2.2.1",
|
|
||||||
"@discordjs/api-extractor": "workspace:^",
|
"@discordjs/api-extractor": "workspace:^",
|
||||||
|
"@favware/cliff-jumper": "^2.2.1",
|
||||||
"@types/node": "18.18.8",
|
"@types/node": "18.18.8",
|
||||||
"@vitest/coverage-v8": "^0.34.6",
|
"@vitest/coverage-v8": "^0.34.6",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"esbuild-plugin-version-injector": "^1.2.1",
|
||||||
"eslint": "^8.53.0",
|
"eslint": "^8.53.0",
|
||||||
"eslint-config-neon": "^0.1.57",
|
"eslint-config-neon": "^0.1.57",
|
||||||
"eslint-formatter-pretty": "^5.0.0",
|
"eslint-formatter-pretty": "^5.0.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.1.0",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"vitest": "^0.34.6"
|
"vitest": "^0.34.6"
|
||||||
|
|
2
packages/ui/.lintstagedrc.cjs
Normal file
2
packages/ui/.lintstagedrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/** @type {import('lint-staged').Config} */
|
||||||
|
module.exports = require('../../.lintstagedrc.json');
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue