Skip to content

Commit

Permalink
build: multi-config build and dep update
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Nov 14, 2023
1 parent 75fc7f2 commit 8f43240
Show file tree
Hide file tree
Showing 124 changed files with 566 additions and 252 deletions.
1 change: 1 addition & 0 deletions apps/guide/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
2 changes: 1 addition & 1 deletion apps/guide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions apps/website/.lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 0 additions & 1 deletion apps/website/.lintstagedrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions apps/website/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
1 change: 0 additions & 1 deletion apps/website/.prettierrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 })));
Expand Down
5 changes: 4 additions & 1 deletion apps/website/src/components/InstallButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
5 changes: 4 additions & 1 deletion apps/website/src/components/OverloadSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion apps/website/src/components/PackageSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
() =>
Expand Down
6 changes: 5 additions & 1 deletion apps/website/src/components/VersionSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
}

Expand Down
5 changes: 4 additions & 1 deletion apps/website/src/contexts/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: (_) => {},
});
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions packages/actions/.lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 0 additions & 1 deletion packages/actions/.lintstagedrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions packages/actions/.prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
1 change: 0 additions & 1 deletion packages/actions/.prettierrc.js

This file was deleted.

30 changes: 25 additions & 5 deletions packages/actions/__tests__/formatTag.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]')).toEqual({ isSubpackage: true, package: 'rest', semver: '0.4.0' });
expect(formatTag('@discordjs/[email protected]')).toEqual({
isSubpackage: true,
package: 'rest',
semver: '0.4.0',
});
expect(formatTag('@discordjs/[email protected]')).toEqual({
isSubpackage: true,
package: 'collection',
semver: '0.6.0',
});
expect(formatTag('@discordjs/[email protected]')).toEqual({ isSubpackage: true, package: 'proxy', semver: '0.1.0' });
expect(formatTag('@discordjs/[email protected]')).toEqual({
isSubpackage: true,
package: 'proxy',
semver: '0.1.0',
});
expect(formatTag('@discordjs/[email protected]')).toEqual({
isSubpackage: true,
package: 'builders',
semver: '0.13.0',
});
expect(formatTag('@discordjs/[email protected]')).toEqual({ isSubpackage: true, package: 'voice', semver: '0.9.0' });
expect(formatTag('@discordjs/[email protected]')).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('[email protected]')).toEqual({
isSubpackage: false,
package: 'create-discord-bot',
Expand Down
2 changes: 1 addition & 1 deletion packages/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/api-extractor-model/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/api-extractor-model/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
2 changes: 1 addition & 1 deletion packages/api-extractor-model/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/api-extractor-model/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { createTsupConfig } from '../../tsup.config.js';

export default createTsupConfig();
export default createTsupConfig({
minify: 'terser',
});
1 change: 1 addition & 0 deletions packages/api-extractor-utils/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/api-extractor-utils/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
2 changes: 1 addition & 1 deletion packages/api-extractor-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/api-extractor/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/api-extractor/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
2 changes: 1 addition & 1 deletion packages/api-extractor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/api-extractor/src/generators/ApiModelGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1206,8 +1206,8 @@ export class ApiModelGenerator {
const isStatic: boolean = astDeclaration
? (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0
: parentApiItem.kind === ApiItemKind.Class || parentApiItem.kind === ApiItemKind.Interface
? (jsDoc as DocgenPropertyJson).scope === 'static'
: false;
? (jsDoc as DocgenPropertyJson).scope === 'static'
: false;
const containerKey: string = ApiProperty.getContainerKey(name, isStatic);

let apiProperty: ApiProperty | undefined = parentApiItem.tryGetMemberByKey(containerKey) as ApiProperty;
Expand Down
1 change: 1 addition & 0 deletions packages/api-extractor/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createTsupConfig } from '../../tsup.config.js';

export default createTsupConfig({
entry: ['src/**/*.ts'],
minify: 'terser',
cjsInterop: true,
noExternal: ['@microsoft/tsdoc*'],
});
1 change: 1 addition & 0 deletions packages/brokers/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
5 changes: 3 additions & 2 deletions packages/brokers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/brokers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 4 additions & 1 deletion packages/brokers/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions packages/builders/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/builders/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
4 changes: 2 additions & 2 deletions packages/builders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/collection/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/collection/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
4 changes: 2 additions & 2 deletions packages/collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@
},
"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",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/collection/src/index.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/core/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
1 change: 1 addition & 0 deletions packages/core/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,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": "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",
Expand Down
Loading

1 comment on commit 8f43240

@vercel
Copy link

@vercel vercel bot commented on 8f43240 Nov 14, 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.