build: multi-config build and dep update

This commit is contained in:
iCrawl
2023-11-14 01:26:22 +01:00
parent 75fc7f2454
commit 8f432400d8
124 changed files with 566 additions and 252 deletions

View File

@@ -1,3 +1,4 @@
/** @type {import('lint-staged').Config} */
module.exports = {
...require('../../.lintstagedrc.json'),
'src/**.ts': 'vitest related --run --config ./vitest.config.ts',

View File

@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');

View File

@@ -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",

View File

@@ -93,10 +93,10 @@ export class DiscordAPIError extends Error {
const nextKey = otherKey.startsWith('_')
? key
: key
? Number.isNaN(Number(otherKey))
? `${key}.${otherKey}`
: `${key}[${otherKey}]`
: otherKey;
? Number.isNaN(Number(otherKey))
? `${key}.${otherKey}`
: `${key}[${otherKey}]`
: otherKey;
if (typeof val === 'string') {
yield val;

View File

@@ -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

View File

@@ -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'],
esbuildPlugins: [esbuildPluginVersionInjector()],
});
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()],
}),
];