mirror of
https://github.com/discordjs/discord.js.git
synced 2024-07-08 02:21: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');
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
"hastscript": "^8.0.0",
|
||||
"html-escaper": "^3.0.3",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
"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",
|
||||
"happy-dom": "^12.10.3",
|
||||
"postcss": "^8.4.31",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
"vercel": "^32.5.3",
|
||||
|
|
|
@ -27,7 +27,7 @@ export const generateStaticParams = async () => {
|
|||
const params: VersionRouteParams[] = [];
|
||||
|
||||
await Promise.all(
|
||||
PACKAGES.slice(1).map(async (packageName) => {
|
||||
PACKAGES.map(async (packageName) => {
|
||||
const versions = (await fetchVersions(packageName)).slice(0, N_RECENT_VERSIONS);
|
||||
|
||||
params.push(...versions.map((version) => ({ package: packageName, version })));
|
||||
|
|
|
@ -17,7 +17,10 @@ export function InstallButton() {
|
|||
|
||||
return (
|
||||
<button
|
||||
className={buttonVariants({ variant: 'secondary', className: 'cursor-copy font-mono' })}
|
||||
className={buttonVariants({
|
||||
variant: 'secondary',
|
||||
className: 'cursor-copy font-mono',
|
||||
})}
|
||||
onClick={() => {
|
||||
setInteracted(true);
|
||||
copyToClipboard('npm install discord.js');
|
||||
|
|
|
@ -15,7 +15,10 @@ export default function OverloadSwitcher({
|
|||
methodName,
|
||||
overloads,
|
||||
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 hashChangeHandler = useCallback(() => {
|
||||
setHash(window.location.hash);
|
||||
|
|
|
@ -12,7 +12,11 @@ export default function PackageSelect() {
|
|||
const pathname = usePathname();
|
||||
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(
|
||||
() =>
|
||||
|
|
|
@ -14,7 +14,11 @@ export default function VersionSelect({ versions }: { readonly versions: string[
|
|||
const packageName = pathname?.split('/').slice(3, 4)[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(
|
||||
() =>
|
||||
|
|
|
@ -13,7 +13,9 @@ export function Block({ children, title }: PropsWithChildren<{ readonly title: s
|
|||
export function ExampleBlock({
|
||||
children,
|
||||
exampleIndex,
|
||||
}: PropsWithChildren<{ readonly exampleIndex?: number | undefined }>): JSX.Element {
|
||||
}: PropsWithChildren<{
|
||||
readonly exampleIndex?: number | undefined;
|
||||
}>): JSX.Element {
|
||||
return <Block title={`Example ${exampleIndex ? exampleIndex : ''}`}>{children}</Block>;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,10 @@ import {
|
|||
useMemo,
|
||||
} from 'react';
|
||||
|
||||
export const NavContext = createContext<{ opened: boolean; setOpened: Dispatch<SetStateAction<boolean>> }>({
|
||||
export const NavContext = createContext<{
|
||||
opened: boolean;
|
||||
setOpened: Dispatch<SetStateAction<boolean>>;
|
||||
}>({
|
||||
opened: false,
|
||||
setOpened: (_) => {},
|
||||
});
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^18.4.0",
|
||||
"@commitlint/cli": "^18.4.1",
|
||||
"@commitlint/config-angular": "^18.4.0",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@favware/npm-deprecate": "^1.0.7",
|
||||
|
@ -63,6 +63,7 @@
|
|||
"is-ci": "^3.0.1",
|
||||
"lint-staged": "^15.1.0",
|
||||
"lodash.merge": "^4.6.2",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"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', () => {
|
||||
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({
|
||||
isSubpackage: true,
|
||||
package: 'collection',
|
||||
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({
|
||||
isSubpackage: true,
|
||||
package: 'builders',
|
||||
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', () => {
|
||||
expect(formatTag('13.5.1')).toEqual({ 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('13.5.1')).toEqual({
|
||||
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({
|
||||
isSubpackage: false,
|
||||
package: 'create-discord-bot',
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0"
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
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');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2"
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"jest": "^29.7.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0"
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ import { createTsupConfig } from '../../tsup.config.js';
|
|||
|
||||
export default createTsupConfig({
|
||||
entry: ['src/**/*.ts'],
|
||||
minify: 'terser',
|
||||
cjsInterop: true,
|
||||
noExternal: ['@microsoft/tsdoc*'],
|
||||
});
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -71,15 +71,16 @@
|
|||
"ioredis": "^5.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.18.8",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-plugin-version-injector": "^1.2.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -3,3 +3,11 @@ export * from './brokers/redis/PubSubRedis.js';
|
|||
export * from './brokers/redis/RPCRedis.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';
|
||||
|
||||
export default createTsupConfig();
|
||||
export default createTsupConfig({
|
||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||
});
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
"tslib": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "16.18.60",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
|
@ -83,7 +83,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -60,8 +60,8 @@
|
|||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.18.8",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
|
@ -69,7 +69,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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.
|
||||
*/
|
||||
// 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');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
"discord-api-types": "0.37.61"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.18.8",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
|
@ -81,7 +81,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -4,7 +4,7 @@ export * from '../util/index.js';
|
|||
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.
|
||||
*/
|
||||
// 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';
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
// 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 { createTsupConfig } from '../../tsup.config.js';
|
||||
|
||||
export default createTsupConfig({
|
||||
export default [
|
||||
createTsupConfig({
|
||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||
}),
|
||||
createTsupConfig({
|
||||
entry: {
|
||||
index: 'src/index.ts',
|
||||
'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;
|
||||
}
|
||||
|
||||
await createDiscordBot({ typescript, directory: projectDirectory, packageManager, installPackages });
|
||||
await createDiscordBot({
|
||||
typescript,
|
||||
directory: projectDirectory,
|
||||
packageManager,
|
||||
installPackages,
|
||||
});
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"terser": "^5.24.0",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -67,7 +67,9 @@ export async function createDiscordBot({ directory, installPackages, typescript,
|
|||
|
||||
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);
|
||||
if (deno) {
|
||||
// @ts-expect-error: This is fine
|
||||
|
@ -87,7 +89,9 @@ export async function createDiscordBot({ directory, installPackages, typescript,
|
|||
}
|
||||
|
||||
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);
|
||||
newStr = newStr.replaceAll('[REPLACE_IMPORT_EXT]', typescript ? 'ts' : 'js');
|
||||
return newStr;
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3"
|
||||
"prettier": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,6 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3"
|
||||
"prettier": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,14 +72,14 @@
|
|||
"@discordjs/docgen": "workspace:^",
|
||||
"@favware/cliff-jumper": "2.2.1",
|
||||
"@types/node": "16.18.60",
|
||||
"@typescript-eslint/eslint-plugin": "^6.10.0",
|
||||
"@typescript-eslint/parser": "^6.10.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.11.0",
|
||||
"@typescript-eslint/parser": "^6.11.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"dtslint": "4.2.1",
|
||||
"eslint": "8.53.0",
|
||||
"eslint-formatter-pretty": "5.0.0",
|
||||
"jest": "29.7.0",
|
||||
"prettier": "3.0.3",
|
||||
"prettier": "3.1.0",
|
||||
"tsd": "0.29.0",
|
||||
"tslint": "6.1.3",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2"
|
||||
|
|
|
@ -30,7 +30,7 @@ export async function build({ input, custom: customDocs, root, output, newOutput
|
|||
}
|
||||
} else {
|
||||
console.log('Parsing JSDocs in source files...');
|
||||
// eslint-disable-next-line n/no-sync
|
||||
|
||||
data = jsdoc2md.getTemplateDataSync({ files: input }) as (ChildTypes & RootTypes)[];
|
||||
console.log(`${data.length} JSDoc items parsed.`);
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -57,15 +57,16 @@
|
|||
"discord-api-types": "0.37.61"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "16.18.60",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-plugin-version-injector": "^1.2.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -1,2 +1,10 @@
|
|||
export * from './escapers.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';
|
||||
|
||||
export default createTsupConfig({});
|
||||
export default createTsupConfig({
|
||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||
});
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
"discord-api-types": "0.37.61"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.18.8",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
|
@ -83,7 +83,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"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.
|
||||
*/
|
||||
// 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-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2"
|
||||
|
|
|
@ -4,5 +4,4 @@ export default createTsupConfig({
|
|||
dts: false,
|
||||
format: 'esm',
|
||||
minify: 'terser',
|
||||
keepNames: false,
|
||||
});
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = require('../../.lintstagedrc.json');
|
||||
|
|
|
@ -76,10 +76,11 @@
|
|||
"@types/supertest": "^2.0.16",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-plugin-version-injector": "^1.2.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"supertest": "^6.3.3",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
export * from './handlers/proxyRequests.js';
|
||||
export * from './util/responseHelpers.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';
|
||||
|
||||
export default createTsupConfig();
|
||||
export default createTsupConfig({
|
||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||
});
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
/** @type {import('lint-staged').Config} */
|
||||
module.exports = {
|
||||
...require('../../.lintstagedrc.json'),
|
||||
'src/**.ts': 'vitest related --run --config ./vitest.config.ts',
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
||||
|
|
|
@ -93,8 +93,8 @@
|
|||
"undici": "5.27.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.17.9",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
|
@ -102,7 +102,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -8,7 +8,7 @@ export * from './lib/utils/types.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.
|
||||
*/
|
||||
// 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 { createTsupConfig } from '../../tsup.config.js';
|
||||
|
||||
export default createTsupConfig({
|
||||
entry: ['src/index.ts', 'src/web.ts', 'src/strategies/*.ts'],
|
||||
export default [
|
||||
createTsupConfig({
|
||||
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');
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
"typescript": "^5.2.2",
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import { esbuildPluginVersionInjector } from 'esbuild-plugin-version-injector';
|
||||
import { createTsupConfig } from '../../tsup.config.js';
|
||||
|
||||
export default createTsupConfig();
|
||||
export default createTsupConfig({
|
||||
esbuildPlugins: [esbuildPluginVersionInjector()],
|
||||
});
|
||||
|
|
|
@ -52,15 +52,16 @@
|
|||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@discordjs/api-extractor": "workspace:^",
|
||||
"@favware/cliff-jumper": "^2.2.1",
|
||||
"@types/node": "18.18.8",
|
||||
"@vitest/coverage-v8": "^0.34.6",
|
||||
"cross-env": "^7.0.3",
|
||||
"esbuild-plugin-version-injector": "^1.2.1",
|
||||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"tsup": "^7.2.0",
|
||||
"typescript": "^5.2.2",
|
||||
"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');
|
|
@ -1 +0,0 @@
|
|||
export * from '../../.lintstagedrc.json' assert { type: 'json' };
|
2
packages/ui/.prettierrc.cjs
Normal file
2
packages/ui/.prettierrc.cjs
Normal file
|
@ -0,0 +1,2 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
module.exports = require('../../.prettierrc.json');
|
|
@ -1,2 +0,0 @@
|
|||
/** @type {import('prettier').Config} */
|
||||
export * from '../../.prettierrc.json' assert { type: 'json' };
|
|
@ -79,7 +79,7 @@
|
|||
"eslint": "^8.53.0",
|
||||
"eslint-config-neon": "^0.1.57",
|
||||
"eslint-formatter-pretty": "^5.0.0",
|
||||
"prettier": "^3.0.3",
|
||||
"prettier": "^3.1.0",
|
||||
"prop-types": "^15.8.1",
|
||||
"storybook": "^7.5.3",
|
||||
"turbo": "^1.10.17-canary.0",
|
||||
|
|
|
@ -74,7 +74,10 @@ export const Default = {
|
|||
username: 'Guide Bot',
|
||||
}}
|
||||
footer={{ content: "When one amazing title just wasn't enough." }}
|
||||
thumbnail={{ alt: 'discord.js logo', image: '/assets/discordjs.png' }}
|
||||
thumbnail={{
|
||||
alt: 'discord.js logo',
|
||||
image: '/assets/discordjs.png',
|
||||
}}
|
||||
title={{ title: 'Another amazing title' }}
|
||||
>
|
||||
Multiple embeds!
|
||||
|
@ -112,7 +115,10 @@ export const Default = {
|
|||
width: 300,
|
||||
height: 300,
|
||||
}}
|
||||
thumbnail={{ alt: 'discord.js logo', image: '/assets/discordjs.png' }}
|
||||
thumbnail={{
|
||||
alt: 'discord.js logo',
|
||||
image: '/assets/discordjs.png',
|
||||
}}
|
||||
title={{ title: 'Fields are also supported!' }}
|
||||
/>
|
||||
</>
|
||||
|
|
|
@ -7,7 +7,10 @@ export default defineConfig({
|
|||
plugins: [
|
||||
dts(),
|
||||
react(),
|
||||
Unocss({ content: { pipeline: { include: ['.storybook/preview.ts'] } }, configFile: '../../unocss.config.ts' }),
|
||||
Unocss({
|
||||
content: { pipeline: { include: ['.storybook/preview.ts'] } },
|
||||
configFile: '../../unocss.config.ts',
|
||||
}),
|
||||
],
|
||||
build: {
|
||||
lib: {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue