mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
build: refactor build system (#8324)
This commit is contained in:
3
packages/actions/build.config.ts
Normal file
3
packages/actions/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig({ minify: true });
|
||||
@@ -5,17 +5,17 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -50,11 +50,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.45",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
3
packages/builders/build.config.ts
Normal file
3
packages/builders/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig();
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "A set of builders that you can use when creating your bot",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
@@ -13,12 +13,12 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -65,11 +65,13 @@
|
||||
"@favware/cliff-jumper": "^1.8.5",
|
||||
"@microsoft/api-extractor": "^7.28.4",
|
||||
"@types/node": "^16.11.45",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
3
packages/collection/build.config.ts
Normal file
3
packages/collection/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig();
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Utility data structure used in discord.js",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
@@ -13,12 +13,12 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -54,11 +54,13 @@
|
||||
"@favware/cliff-jumper": "^1.8.5",
|
||||
"@microsoft/api-extractor": "^7.28.4",
|
||||
"@types/node": "^16.11.45",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
3
packages/docgen/build.config.ts
Normal file
3
packages/docgen/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig({ minify: true, externals: ['package.cjs', 'package.mjs'] });
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.12.0",
|
||||
"description": "The docs.json generator for discord.js and its related projects",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
@@ -11,15 +11,7 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/docgen/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"bin": "./dist/index.js",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"bin": "./dist/index.cjs",
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
},
|
||||
@@ -62,8 +54,10 @@
|
||||
"@types/node": "^16.11.45",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4"
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
||||
3
packages/proxy-container/build.config.ts
Normal file
3
packages/proxy-container/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig({ emitCJS: false, cjsBridge: false });
|
||||
@@ -3,14 +3,14 @@
|
||||
"version": "0.1.0",
|
||||
"description": "Lightweight HTTP proxy for Discord's API, brought to you as a container 📦",
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
"prepack": "yarn build && yarn lint",
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy-container/*'"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.mjs",
|
||||
"type": "module",
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
@@ -52,8 +52,10 @@
|
||||
"@types/node": "^16.11.45",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4"
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
||||
3
packages/proxy/build.config.ts
Normal file
3
packages/proxy/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig();
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "Tools for running an HTTP proxy for Discord's API",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
@@ -13,12 +13,12 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -64,12 +64,14 @@
|
||||
"@microsoft/api-extractor": "^7.28.4",
|
||||
"@types/node": "^16.11.45",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"supertest": "^6.2.4",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export * from './handlers/proxyRequests';
|
||||
export * from './util/responseHelpers';
|
||||
export { RequestHandler } from './util/util';
|
||||
export type { RequestHandler } from './util/util';
|
||||
|
||||
3
packages/rest/build.config.ts
Normal file
3
packages/rest/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig();
|
||||
@@ -4,7 +4,7 @@
|
||||
"description": "The REST API for discord.js",
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format",
|
||||
@@ -13,12 +13,12 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -53,7 +53,7 @@
|
||||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {
|
||||
"@discordjs/collection": "workspace:^",
|
||||
"@sapphire/async-queue": "^1.3.1",
|
||||
"@sapphire/async-queue": "^1.3.2",
|
||||
"@sapphire/snowflake": "^3.2.2",
|
||||
"discord-api-types": "^0.36.2",
|
||||
"file-type": "^17.1.2",
|
||||
@@ -65,11 +65,13 @@
|
||||
"@favware/cliff-jumper": "^1.8.5",
|
||||
"@microsoft/api-extractor": "^7.28.4",
|
||||
"@types/node": "^16.11.45",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
3
packages/scripts/build.config.ts
Normal file
3
packages/scripts/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig({ minify: true });
|
||||
@@ -5,17 +5,17 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
"build": "tsup",
|
||||
"build": "unbuild",
|
||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||
"fmt": "yarn format"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -49,11 +49,13 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.45",
|
||||
"c8": "^7.11.3",
|
||||
"c8": "^7.12.0",
|
||||
"eslint": "^8.20.0",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
3
packages/voice/build.config.ts
Normal file
3
packages/voice/build.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { createUnbuildConfig } from '../../build.config';
|
||||
|
||||
export default createUnbuildConfig();
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "0.12.0",
|
||||
"description": "Implementation of the Discord Voice API for node.js",
|
||||
"scripts": {
|
||||
"build": "tsup && node scripts/postbuild.mjs",
|
||||
"build": "unbuild",
|
||||
"test": "jest --coverage",
|
||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||
@@ -13,12 +13,12 @@
|
||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/voice/*'",
|
||||
"release": "cliff-jumper"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"main": "./dist/index.cjs",
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"require": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts"
|
||||
},
|
||||
"directories": {
|
||||
@@ -73,9 +73,11 @@
|
||||
"jest-websocket-mock": "^2.3.0",
|
||||
"mock-socket": "^9.1.5",
|
||||
"prettier": "^2.7.1",
|
||||
"rollup-plugin-typescript2": "0.32.1",
|
||||
"tsup": "^6.1.3",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"typescript": "^4.7.4"
|
||||
"typescript": "^4.7.4",
|
||||
"unbuild": "^0.7.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
export {
|
||||
AudioPlayer,
|
||||
AudioPlayerStatus,
|
||||
AudioPlayerState,
|
||||
type AudioPlayerState,
|
||||
NoSubscriberBehavior,
|
||||
createAudioPlayer,
|
||||
AudioPlayerBufferingState,
|
||||
AudioPlayerIdleState,
|
||||
AudioPlayerPausedState,
|
||||
AudioPlayerPlayingState,
|
||||
CreateAudioPlayerOptions,
|
||||
type AudioPlayerBufferingState,
|
||||
type AudioPlayerIdleState,
|
||||
type AudioPlayerPausedState,
|
||||
type AudioPlayerPlayingState,
|
||||
type CreateAudioPlayerOptions,
|
||||
} from './AudioPlayer';
|
||||
|
||||
export { AudioPlayerError } from './AudioPlayerError';
|
||||
|
||||
export { AudioResource, CreateAudioResourceOptions, createAudioResource } from './AudioResource';
|
||||
export { AudioResource, type CreateAudioResourceOptions, createAudioResource } from './AudioResource';
|
||||
|
||||
export { PlayerSubscription } from './PlayerSubscription';
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@ export * from './receive';
|
||||
|
||||
export {
|
||||
VoiceConnection,
|
||||
VoiceConnectionState,
|
||||
type VoiceConnectionState,
|
||||
VoiceConnectionStatus,
|
||||
VoiceConnectionConnectingState,
|
||||
VoiceConnectionDestroyedState,
|
||||
VoiceConnectionDisconnectedState,
|
||||
VoiceConnectionDisconnectedBaseState,
|
||||
VoiceConnectionDisconnectedOtherState,
|
||||
VoiceConnectionDisconnectedWebSocketState,
|
||||
type VoiceConnectionConnectingState,
|
||||
type VoiceConnectionDestroyedState,
|
||||
type VoiceConnectionDisconnectedState,
|
||||
type VoiceConnectionDisconnectedBaseState,
|
||||
type VoiceConnectionDisconnectedOtherState,
|
||||
type VoiceConnectionDisconnectedWebSocketState,
|
||||
VoiceConnectionDisconnectReason,
|
||||
VoiceConnectionReadyState,
|
||||
VoiceConnectionSignallingState,
|
||||
type VoiceConnectionReadyState,
|
||||
type VoiceConnectionSignallingState,
|
||||
} from './VoiceConnection';
|
||||
|
||||
export { JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';
|
||||
export { type JoinConfig, getVoiceConnection, getVoiceConnections, getGroups } from './DataStore';
|
||||
|
||||
@@ -67,31 +67,31 @@
|
||||
"@testing-library/dom": "^8.16.0",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^14.2.5",
|
||||
"@testing-library/user-event": "^14.3.0",
|
||||
"@types/node": "^16.11.45",
|
||||
"@types/react-dom": "^18.0.6",
|
||||
"@types/react-syntax-highlighter": "^15.5.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
||||
"@typescript-eslint/parser": "^5.30.6",
|
||||
"@unocss/cli": "^0.44.3",
|
||||
"@unocss/preset-web-fonts": "^0.44.3",
|
||||
"@unocss/reset": "^0.44.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||
"@typescript-eslint/parser": "^5.30.7",
|
||||
"@unocss/cli": "^0.44.5",
|
||||
"@unocss/preset-web-fonts": "^0.44.5",
|
||||
"@unocss/reset": "^0.44.5",
|
||||
"@vitejs/plugin-react": "^2.0.0",
|
||||
"c8": "^7.11.3",
|
||||
"concurrently": "^7.2.2",
|
||||
"cypress": "^10.3.0",
|
||||
"c8": "^7.12.0",
|
||||
"concurrently": "^7.3.0",
|
||||
"cypress": "^10.3.1",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-import-resolver-typescript": "^3.2.7",
|
||||
"eslint-import-resolver-typescript": "^3.3.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-react": "^7.30.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"happy-dom": "^6.0.4",
|
||||
"msw": "^0.44.1",
|
||||
"msw": "^0.44.2",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.7.4",
|
||||
"unocss": "^0.44.3",
|
||||
"unocss": "^0.44.5",
|
||||
"vitest": "^0.18.1"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
Reference in New Issue
Block a user