mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 12:04:42 +12:00
build: refactor build system (#8324)
This commit is contained in:
parent
d1245418f9
commit
3b0197bd8e
27 changed files with 1120 additions and 338 deletions
|
@ -0,0 +1,36 @@
|
||||||
|
diff --git a/dist/rollup-plugin-typescript2.cjs.js b/dist/rollup-plugin-typescript2.cjs.js
|
||||||
|
index 9ab972b041cc76f8f786d6a20f3efb53c364cad6..13e056a3c0971eb18b307d91fad096a9f3b9de79 100644
|
||||||
|
--- a/dist/rollup-plugin-typescript2.cjs.js
|
||||||
|
+++ b/dist/rollup-plugin-typescript2.cjs.js
|
||||||
|
@@ -29799,6 +29799,13 @@ const typescript = (options) => {
|
||||||
|
declarations[key] = { type: result.dts, map: result.dtsmap };
|
||||||
|
context.debug(() => `${safe.exports.blue("generated declarations")} for '${key}'`);
|
||||||
|
}
|
||||||
|
+ // if a user sets this compilerOption, they probably want another plugin (e.g. Babel, ESBuild) to transform their TS instead, while rpt2 just type-checks and/or outputs declarations
|
||||||
|
+ // note that result.code is non-existent if emitDeclarationOnly per https://github.com/ezolenko/rollup-plugin-typescript2/issues/268
|
||||||
|
+ if (parsedConfig.options.emitDeclarationOnly)
|
||||||
|
+ {
|
||||||
|
+ context.debug(() => `${blue("emitDeclarationOnly")} enabled, not transforming TS'`);
|
||||||
|
+ return undefined;
|
||||||
|
+ }
|
||||||
|
const transformResult = { code: result.code, map: { mappings: "" } };
|
||||||
|
if (result.map) {
|
||||||
|
if (pluginOptions.sourceMapCallback)
|
||||||
|
diff --git a/dist/rollup-plugin-typescript2.es.js b/dist/rollup-plugin-typescript2.es.js
|
||||||
|
index e43bf8f03bc6792b61d8352e04bb6466712426c2..420e8f0d0d109076bc72e9d60240077235a9ba11 100644
|
||||||
|
--- a/dist/rollup-plugin-typescript2.es.js
|
||||||
|
+++ b/dist/rollup-plugin-typescript2.es.js
|
||||||
|
@@ -29770,6 +29770,13 @@ const typescript = (options) => {
|
||||||
|
declarations[key] = { type: result.dts, map: result.dtsmap };
|
||||||
|
context.debug(() => `${safe.exports.blue("generated declarations")} for '${key}'`);
|
||||||
|
}
|
||||||
|
+ // if a user sets this compilerOption, they probably want another plugin (e.g. Babel, ESBuild) to transform their TS instead, while rpt2 just type-checks and/or outputs declarations
|
||||||
|
+ // note that result.code is non-existent if emitDeclarationOnly per https://github.com/ezolenko/rollup-plugin-typescript2/issues/268
|
||||||
|
+ if (parsedConfig.options.emitDeclarationOnly)
|
||||||
|
+ {
|
||||||
|
+ context.debug(() => `${blue("emitDeclarationOnly")} enabled, not transforming TS'`);
|
||||||
|
+ return undefined;
|
||||||
|
+ }
|
||||||
|
const transformResult = { code: result.code, map: { mappings: "" } };
|
||||||
|
if (result.map) {
|
||||||
|
if (pluginOptions.sourceMapCallback)
|
93
build.config.ts
Normal file
93
build.config.ts
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
import { relative, resolve } from 'node:path';
|
||||||
|
import glob from 'fast-glob';
|
||||||
|
import typescript from 'rollup-plugin-typescript2';
|
||||||
|
import { defineBuildConfig, BuildEntry } from 'unbuild';
|
||||||
|
|
||||||
|
interface ConfigOptions {
|
||||||
|
entries: (BuildEntry | string)[];
|
||||||
|
minify: boolean;
|
||||||
|
emitCJS: boolean;
|
||||||
|
externals: string[];
|
||||||
|
cjsBridge: boolean;
|
||||||
|
sourcemap: boolean;
|
||||||
|
preserveModules: boolean;
|
||||||
|
preserveModulesRoot: string;
|
||||||
|
declaration: boolean;
|
||||||
|
typeCheck: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function createUnbuildConfig({
|
||||||
|
entries = [{ builder: 'rollup', input: 'src/index' }],
|
||||||
|
minify = false,
|
||||||
|
emitCJS = true,
|
||||||
|
cjsBridge = true,
|
||||||
|
externals = [],
|
||||||
|
sourcemap = true,
|
||||||
|
preserveModules = true,
|
||||||
|
preserveModulesRoot = 'src',
|
||||||
|
declaration = true,
|
||||||
|
typeCheck = false,
|
||||||
|
}: Partial<ConfigOptions> = {}) {
|
||||||
|
const files = glob
|
||||||
|
.sync('**', { cwd: 'src' })
|
||||||
|
.map((file) => [`${file.slice(0, -2)}cjs`, `${file.slice(0, -2)}mjs`])
|
||||||
|
.flat();
|
||||||
|
|
||||||
|
return defineBuildConfig({
|
||||||
|
entries,
|
||||||
|
clean: true,
|
||||||
|
rollup: {
|
||||||
|
esbuild: {
|
||||||
|
minify,
|
||||||
|
minifyIdentifiers: false,
|
||||||
|
},
|
||||||
|
emitCJS,
|
||||||
|
cjsBridge,
|
||||||
|
json: {
|
||||||
|
namedExports: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
externals: [...files, ...externals],
|
||||||
|
|
||||||
|
hooks: {
|
||||||
|
'rollup:options': (_, options) => {
|
||||||
|
// @ts-expect-error: This will always be an array
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
|
options.output![0] = {
|
||||||
|
// @ts-expect-error: This will always be an array
|
||||||
|
...options.output![0],
|
||||||
|
sourcemap,
|
||||||
|
preserveModules,
|
||||||
|
preserveModulesRoot,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (emitCJS) {
|
||||||
|
// @ts-expect-error: This will always be an array
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||||
|
options.output![1] = {
|
||||||
|
// @ts-expect-error: This will always be an array
|
||||||
|
...options.output![1],
|
||||||
|
sourcemap,
|
||||||
|
preserveModules,
|
||||||
|
preserveModulesRoot,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (declaration) {
|
||||||
|
options.plugins?.unshift(
|
||||||
|
typescript({
|
||||||
|
check: typeCheck,
|
||||||
|
tsconfig: relative(__dirname, resolve(process.cwd(), 'tsconfig.json')),
|
||||||
|
tsconfigOverride: {
|
||||||
|
compilerOptions: {
|
||||||
|
emitDeclarationOnly: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
10
package.json
10
package.json
|
@ -41,19 +41,23 @@
|
||||||
"@commitlint/config-angular": "^17.0.3",
|
"@commitlint/config-angular": "^17.0.3",
|
||||||
"@favware/cliff-jumper": "^1.8.5",
|
"@favware/cliff-jumper": "^1.8.5",
|
||||||
"@favware/npm-deprecate": "^1.0.4",
|
"@favware/npm-deprecate": "^1.0.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||||
"@typescript-eslint/parser": "^5.30.6",
|
"@typescript-eslint/parser": "^5.30.7",
|
||||||
"conventional-changelog-cli": "^2.2.2",
|
"conventional-changelog-cli": "^2.2.2",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"eslint-config-marine": "^9.4.1",
|
"eslint-config-marine": "^9.4.1",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"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-import": "^2.26.0",
|
||||||
|
"fast-glob": "^3.2.11",
|
||||||
"husky": "^8.0.1",
|
"husky": "^8.0.1",
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
|
"resolutions": {
|
||||||
|
"rollup-plugin-typescript2@0.32.1": "patch:rollup-plugin-typescript2@npm:0.32.1#.yarn/patches/rollup-plugin-typescript2-npm-0.32.1-b5887420f2.patch"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.9.0"
|
"node": ">=16.9.0"
|
||||||
},
|
},
|
||||||
|
|
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,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format"
|
"fmt": "yarn format"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -50,11 +50,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"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",
|
"description": "A set of builders that you can use when creating your bot",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
|
@ -13,12 +13,12 @@
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/builders/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -65,11 +65,13 @@
|
||||||
"@favware/cliff-jumper": "^1.8.5",
|
"@favware/cliff-jumper": "^1.8.5",
|
||||||
"@microsoft/api-extractor": "^7.28.4",
|
"@microsoft/api-extractor": "^7.28.4",
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"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",
|
"description": "Utility data structure used in discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
|
@ -13,12 +13,12 @@
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/collection/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -54,11 +54,13 @@
|
||||||
"@favware/cliff-jumper": "^1.8.5",
|
"@favware/cliff-jumper": "^1.8.5",
|
||||||
"@microsoft/api-extractor": "^7.28.4",
|
"@microsoft/api-extractor": "^7.28.4",
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"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",
|
"version": "0.12.0",
|
||||||
"description": "The docs.json generator for discord.js and its related projects",
|
"description": "The docs.json generator for discord.js and its related projects",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
|
@ -11,15 +11,7 @@
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/docgen/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/docgen/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"bin": "./dist/index.js",
|
"bin": "./dist/index.cjs",
|
||||||
"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"
|
|
||||||
},
|
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "src"
|
"lib": "src"
|
||||||
},
|
},
|
||||||
|
@ -62,8 +54,10 @@
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.9.0"
|
"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",
|
"version": "0.1.0",
|
||||||
"description": "Lightweight HTTP proxy for Discord's API, brought to you as a container 📦",
|
"description": "Lightweight HTTP proxy for Discord's API, brought to you as a container 📦",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
"prepack": "yarn build && yarn lint",
|
"prepack": "yarn build && yarn lint",
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy-container/*'"
|
"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",
|
"type": "module",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "src"
|
"lib": "src"
|
||||||
|
@ -52,8 +52,10 @@
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.9.0"
|
"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",
|
"description": "Tools for running an HTTP proxy for Discord's API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
|
@ -13,12 +13,12 @@
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/proxy/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"typings": "./dist/index.d.ts",
|
"typings": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -64,12 +64,14 @@
|
||||||
"@microsoft/api-extractor": "^7.28.4",
|
"@microsoft/api-extractor": "^7.28.4",
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"@types/supertest": "^2.0.12",
|
"@types/supertest": "^2.0.12",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"supertest": "^6.2.4",
|
"supertest": "^6.2.4",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
export * from './handlers/proxyRequests';
|
export * from './handlers/proxyRequests';
|
||||||
export * from './util/responseHelpers';
|
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",
|
"description": "The REST API for discord.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format",
|
"fmt": "yarn format",
|
||||||
|
@ -13,12 +13,12 @@
|
||||||
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/rest/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"typings": "./dist/index.d.ts",
|
"typings": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
"homepage": "https://discord.js.org",
|
"homepage": "https://discord.js.org",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/collection": "workspace:^",
|
"@discordjs/collection": "workspace:^",
|
||||||
"@sapphire/async-queue": "^1.3.1",
|
"@sapphire/async-queue": "^1.3.2",
|
||||||
"@sapphire/snowflake": "^3.2.2",
|
"@sapphire/snowflake": "^3.2.2",
|
||||||
"discord-api-types": "^0.36.2",
|
"discord-api-types": "^0.36.2",
|
||||||
"file-type": "^17.1.2",
|
"file-type": "^17.1.2",
|
||||||
|
@ -65,11 +65,13 @@
|
||||||
"@favware/cliff-jumper": "^1.8.5",
|
"@favware/cliff-jumper": "^1.8.5",
|
||||||
"@microsoft/api-extractor": "^7.28.4",
|
"@microsoft/api-extractor": "^7.28.4",
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"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,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"build": "tsup",
|
"build": "unbuild",
|
||||||
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix",
|
||||||
"fmt": "yarn format"
|
"fmt": "yarn format"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -49,11 +49,13 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.45",
|
"@types/node": "^16.11.45",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"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",
|
"version": "0.12.0",
|
||||||
"description": "Implementation of the Discord Voice API for node.js",
|
"description": "Implementation of the Discord Voice API for node.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup && node scripts/postbuild.mjs",
|
"build": "unbuild",
|
||||||
"test": "jest --coverage",
|
"test": "jest --coverage",
|
||||||
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
"lint": "prettier --check . && eslint src __tests__ --ext mjs,js,ts",
|
||||||
"format": "prettier --write . && eslint src __tests__ --ext mjs,js,ts --fix",
|
"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/*'",
|
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/voice/*'",
|
||||||
"release": "cliff-jumper"
|
"release": "cliff-jumper"
|
||||||
},
|
},
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.cjs",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"typings": "./dist/index.d.ts",
|
"typings": "./dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
"import": "./dist/index.mjs",
|
"import": "./dist/index.mjs",
|
||||||
"require": "./dist/index.js",
|
"require": "./dist/index.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
|
@ -73,9 +73,11 @@
|
||||||
"jest-websocket-mock": "^2.3.0",
|
"jest-websocket-mock": "^2.3.0",
|
||||||
"mock-socket": "^9.1.5",
|
"mock-socket": "^9.1.5",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
|
"rollup-plugin-typescript2": "0.32.1",
|
||||||
"tsup": "^6.1.3",
|
"tsup": "^6.1.3",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"typescript": "^4.7.4"
|
"typescript": "^4.7.4",
|
||||||
|
"unbuild": "^0.7.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.9.0"
|
"node": ">=16.9.0"
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
export {
|
export {
|
||||||
AudioPlayer,
|
AudioPlayer,
|
||||||
AudioPlayerStatus,
|
AudioPlayerStatus,
|
||||||
AudioPlayerState,
|
type AudioPlayerState,
|
||||||
NoSubscriberBehavior,
|
NoSubscriberBehavior,
|
||||||
createAudioPlayer,
|
createAudioPlayer,
|
||||||
AudioPlayerBufferingState,
|
type AudioPlayerBufferingState,
|
||||||
AudioPlayerIdleState,
|
type AudioPlayerIdleState,
|
||||||
AudioPlayerPausedState,
|
type AudioPlayerPausedState,
|
||||||
AudioPlayerPlayingState,
|
type AudioPlayerPlayingState,
|
||||||
CreateAudioPlayerOptions,
|
type CreateAudioPlayerOptions,
|
||||||
} from './AudioPlayer';
|
} from './AudioPlayer';
|
||||||
|
|
||||||
export { AudioPlayerError } from './AudioPlayerError';
|
export { AudioPlayerError } from './AudioPlayerError';
|
||||||
|
|
||||||
export { AudioResource, CreateAudioResourceOptions, createAudioResource } from './AudioResource';
|
export { AudioResource, type CreateAudioResourceOptions, createAudioResource } from './AudioResource';
|
||||||
|
|
||||||
export { PlayerSubscription } from './PlayerSubscription';
|
export { PlayerSubscription } from './PlayerSubscription';
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,17 @@ export * from './receive';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
VoiceConnection,
|
VoiceConnection,
|
||||||
VoiceConnectionState,
|
type VoiceConnectionState,
|
||||||
VoiceConnectionStatus,
|
VoiceConnectionStatus,
|
||||||
VoiceConnectionConnectingState,
|
type VoiceConnectionConnectingState,
|
||||||
VoiceConnectionDestroyedState,
|
type VoiceConnectionDestroyedState,
|
||||||
VoiceConnectionDisconnectedState,
|
type VoiceConnectionDisconnectedState,
|
||||||
VoiceConnectionDisconnectedBaseState,
|
type VoiceConnectionDisconnectedBaseState,
|
||||||
VoiceConnectionDisconnectedOtherState,
|
type VoiceConnectionDisconnectedOtherState,
|
||||||
VoiceConnectionDisconnectedWebSocketState,
|
type VoiceConnectionDisconnectedWebSocketState,
|
||||||
VoiceConnectionDisconnectReason,
|
VoiceConnectionDisconnectReason,
|
||||||
VoiceConnectionReadyState,
|
type VoiceConnectionReadyState,
|
||||||
VoiceConnectionSignallingState,
|
type VoiceConnectionSignallingState,
|
||||||
} from './VoiceConnection';
|
} 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/dom": "^8.16.0",
|
||||||
"@testing-library/jest-dom": "^5.16.4",
|
"@testing-library/jest-dom": "^5.16.4",
|
||||||
"@testing-library/react": "^13.3.0",
|
"@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/node": "^16.11.45",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@types/react-syntax-highlighter": "^15.5.3",
|
"@types/react-syntax-highlighter": "^15.5.3",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.30.6",
|
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||||
"@typescript-eslint/parser": "^5.30.6",
|
"@typescript-eslint/parser": "^5.30.7",
|
||||||
"@unocss/cli": "^0.44.3",
|
"@unocss/cli": "^0.44.5",
|
||||||
"@unocss/preset-web-fonts": "^0.44.3",
|
"@unocss/preset-web-fonts": "^0.44.5",
|
||||||
"@unocss/reset": "^0.44.3",
|
"@unocss/reset": "^0.44.5",
|
||||||
"@vitejs/plugin-react": "^2.0.0",
|
"@vitejs/plugin-react": "^2.0.0",
|
||||||
"c8": "^7.11.3",
|
"c8": "^7.12.0",
|
||||||
"concurrently": "^7.2.2",
|
"concurrently": "^7.3.0",
|
||||||
"cypress": "^10.3.0",
|
"cypress": "^10.3.1",
|
||||||
"eslint": "^8.20.0",
|
"eslint": "^8.20.0",
|
||||||
"eslint-config-marine": "^9.4.1",
|
"eslint-config-marine": "^9.4.1",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"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-import": "^2.26.0",
|
||||||
"eslint-plugin-react": "^7.30.1",
|
"eslint-plugin-react": "^7.30.1",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"happy-dom": "^6.0.4",
|
"happy-dom": "^6.0.4",
|
||||||
"msw": "^0.44.1",
|
"msw": "^0.44.2",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.7.1",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
"unocss": "^0.44.3",
|
"unocss": "^0.44.5",
|
||||||
"vitest": "^0.18.1"
|
"vitest": "^0.18.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -15,12 +15,13 @@
|
||||||
"noUncheckedIndexedAccess": true,
|
"noUncheckedIndexedAccess": true,
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
"module": "CommonJS",
|
"module": "ESNext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
|
||||||
// Emit
|
// Emit
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
"importHelpers": true,
|
"importHelpers": true,
|
||||||
"importsNotUsedAsValues": "error",
|
"importsNotUsedAsValues": "error",
|
||||||
"inlineSources": true,
|
"inlineSources": true,
|
||||||
|
|
Loading…
Reference in a new issue