build: Properly add typecheck tests (#10722)

* build: exclude type tests from running

* refactor: use `tsc`

* test: fix broker test

* test: fix voice test

* test: fix builders test

* test: use vitest typecheck

remove unused test scripts
skip lib check
rm vitest.d.ts

* fix: remove tsd from core and ws

* fix: extend local tsconfig

---------

Co-authored-by: almeidx <github@almeidx.dev>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2025-01-26 14:28:45 +00:00
committed by GitHub
parent b820daadd4
commit 9b8b0f828c
44 changed files with 443 additions and 479 deletions

View File

@@ -5,7 +5,6 @@
"description": "Imagine a guide... that explores the many possibilities for your discord.js bot",
"private": true,
"scripts": {
"test": "vitest run",
"build:check": "tsc --noEmit",
"build:local": "pnpm run build:prod",
"build:prod": "next build",
@@ -66,8 +65,6 @@
"sharp": "^0.33.5"
},
"devDependencies": {
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/html-escaper": "^3.0.2",
"@types/node": "^18.19.68",
"@types/react": "^18.3.18",
@@ -76,7 +73,6 @@
"@unocss/postcss": "^0.60.4",
"@unocss/reset": "^0.60.4",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"cross-env": "^7.0.3",
"eslint": "^8.57.1",
"eslint-config-neon": "^0.1.62",
@@ -90,8 +86,7 @@
"turbo": "^2.3.3",
"typescript": "~5.5.4",
"unocss": "^0.60.4",
"vercel": "^37.14.0",
"vitest": "^2.1.8"
"vercel": "^37.14.0"
},
"engines": {
"node": ">=18"

View File

@@ -5,7 +5,6 @@
"description": "Imagine a bot... the most popular way to build discord bots",
"private": true,
"scripts": {
"test": "vitest run",
"build:copy_readme": "cpy \"../../packages/(discord.js|brokers|builders|collection|core|formatters|next|proxy|rest|util|voice|ws)/README.md\" \"src/assets/readme\" --rename='home-{{basename}}'",
"build:check": "tsc --noEmit",
"build:local": "cross-env NEXT_PUBLIC_LOCAL_DEV=true pnpm run build:prod",
@@ -73,13 +72,10 @@
"devDependencies": {
"@shikijs/rehype": "^1.24.4",
"@tailwindcss/typography": "^0.5.15",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.17.10",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"autoprefixer": "^10.4.20",
"babel-plugin-react-compiler": "0.0.0-experimental-592953e-20240517",
"cpy-cli": "^5.0.0",
@@ -97,8 +93,7 @@
"tailwindcss": "^3.4.17",
"turbo": "^2.3.3",
"typescript": "~5.5.4",
"vercel": "^37.14.0",
"vitest": "^2.1.8"
"vercel": "^37.14.0"
},
"engines": {
"node": ">=20"

View File

@@ -5,7 +5,7 @@
"description": "A set of actions that we use for our workflows",
"private": true,
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -17,7 +17,7 @@ const mockRedisClient = {
test('pubsub with custom encoding', async () => {
const encode = vi.fn((data) => data);
const broker = new PubSubRedisBroker(mockRedisClient, { encode });
const broker = new PubSubRedisBroker(mockRedisClient, { encode, group: 'group' });
await broker.publish('test', 'test');
expect(encode).toHaveBeenCalledWith('test');
});

View File

@@ -4,7 +4,7 @@
"version": "1.0.0",
"description": "Powerful set of message brokers",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"build:docs": "tsc -p tsconfig.docs.json --lib ESNext,DOM",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -4,7 +4,7 @@
"version": "1.9.0",
"description": "A set of builders that you can use when creating your bot",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -5,6 +5,6 @@
"emitDecoratorMetadata": true,
"exactOptionalPropertyTypes": false
},
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "bin", "__tests__", "../../vitest.d.ts"],
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "bin"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -4,7 +4,7 @@
"version": "2.1.1",
"description": "Utility data structure used in discord.js",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,160 @@
import { REST } from '@discordjs/rest';
import type {
APIActionRowComponent,
APIModalActionRowComponent,
RESTPostAPIInteractionCallbackWithResponseResult,
} from 'discord-api-types/v10';
import { expectTypeOf, describe, test } from 'vitest';
import { API } from '../src/index.js';
const rest = new REST();
const api = new API(rest);
const SNOWFLAKE = '123456789012345678' as const;
const TOKEN = 'token' as const;
const MODAL_COMPONENTS: APIActionRowComponent<APIModalActionRowComponent>[] = [] as const;
const boolValue = true as boolean;
describe('Interaction with_response overloads.', () => {
test('Replying returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Replying returns undefined.', () => {
expectTypeOf(api.interactions.reply(SNOWFLAKE, TOKEN, {})).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
});
test('Replying returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: boolValue })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>
>();
});
test('Defer returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Defer returns undefined.', () => {
expectTypeOf(api.interactions.defer(SNOWFLAKE, TOKEN)).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
});
test('Defer returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: boolValue })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>
>();
});
test('Defer message update returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Defer message update returns undefined.', () => {
expectTypeOf(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN)).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
});
test('Defer message update returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: boolValue })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>
>();
});
test('Update message returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Update message returns undefined.', () => {
expectTypeOf(api.interactions.updateMessage(SNOWFLAKE, TOKEN, {})).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
});
test('Update message returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: boolValue })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>
>();
});
test('Create autocomplete response returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Create autocomplete response returns undefined.', () => {
expectTypeOf(api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, {})).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
});
test('Create autocomplete response returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(
api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: boolValue }),
).toEqualTypeOf<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>();
});
test('Create modal returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: true,
}),
).toEqualTypeOf<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>());
test('Create modal returns undefined.', () => {
expectTypeOf(
api.interactions.createModal(SNOWFLAKE, TOKEN, { title: '', custom_id: '', components: MODAL_COMPONENTS }),
).toEqualTypeOf<Promise<undefined>>();
expectTypeOf(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: false,
}),
).toEqualTypeOf<Promise<undefined>>();
});
test('Create modal returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
expectTypeOf(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: boolValue,
}),
).toEqualTypeOf<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>();
});
test('Launch activity returns undefined.', () => {
expectTypeOf(api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: false })).toEqualTypeOf<
Promise<undefined>
>();
expectTypeOf(api.interactions.launchActivity(SNOWFLAKE, TOKEN)).toEqualTypeOf<Promise<undefined>>();
});
test('Launch activity returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
expectTypeOf(api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: true })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult>
>());
test('Launch activity returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () =>
expectTypeOf(api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: boolValue })).toEqualTypeOf<
Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>
>());
});

View File

@@ -1,149 +0,0 @@
import { REST } from '@discordjs/rest';
import type {
APIActionRowComponent,
APIModalActionRowComponent,
RESTPostAPIInteractionCallbackWithResponseResult,
} from 'discord-api-types/v10';
import { assertType, describe, test } from 'vitest';
import { API } from '../src/index.js';
const rest = new REST();
const api = new API(rest);
const SNOWFLAKE = '123456789012345678' as const;
const TOKEN = 'token' as const;
const MODAL_COMPONENTS: APIActionRowComponent<APIModalActionRowComponent>[] = [] as const;
const boolValue = true as boolean;
describe('Interaction with_response overloads.', () => {
test('Replying returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Replying returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.reply(SNOWFLAKE, TOKEN, {}));
assertType<Promise<undefined>>(api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: false }));
});
test('Replying returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.reply(SNOWFLAKE, TOKEN, { with_response: boolValue }),
);
});
test('Defer returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Defer returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.defer(SNOWFLAKE, TOKEN));
assertType<Promise<undefined>>(api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: false }));
});
test('Defer returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.defer(SNOWFLAKE, TOKEN, { with_response: boolValue }),
);
});
test('Defer message update returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Defer message update returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN));
assertType<Promise<undefined>>(api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: false }));
});
test('Defer message update returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.deferMessageUpdate(SNOWFLAKE, TOKEN, { with_response: boolValue }),
);
});
test('Update message returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Update message returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.updateMessage(SNOWFLAKE, TOKEN, {}));
assertType<Promise<undefined>>(api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: false }));
});
test('Update message returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.updateMessage(SNOWFLAKE, TOKEN, { with_response: boolValue }),
);
});
test('Create autocomplete response returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Create autocomplete response returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, {}));
assertType<Promise<undefined>>(
api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: false }),
);
});
test('Create autocomplete response returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.createAutocompleteResponse(SNOWFLAKE, TOKEN, { with_response: boolValue }),
);
});
test('Create modal returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: true,
}),
));
test('Create modal returns undefined.', () => {
assertType<Promise<undefined>>(
api.interactions.createModal(SNOWFLAKE, TOKEN, { title: '', custom_id: '', components: MODAL_COMPONENTS }),
);
assertType<Promise<undefined>>(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: false,
}),
);
});
test('Create modal returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () => {
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.createModal(SNOWFLAKE, TOKEN, {
title: '',
custom_id: '',
components: MODAL_COMPONENTS,
with_response: boolValue,
}),
);
});
test('Launch activity returns undefined.', () => {
assertType<Promise<undefined>>(api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: false }));
assertType<Promise<undefined>>(api.interactions.launchActivity(SNOWFLAKE, TOKEN));
});
test('Launch activity returns RESTPostAPIInteractionCallbackWithResponseResult.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult>>(
api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: true }),
));
test('Launch activity returns either RESTPostAPIInteractionCallbackWithResponseResult or undefined.', () =>
assertType<Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>>(
api.interactions.launchActivity(SNOWFLAKE, TOKEN, { with_response: boolValue }),
));
});

View File

@@ -4,7 +4,7 @@
"version": "2.0.0",
"description": "A thinly abstracted wrapper around the rest API, and gateway.",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",

View File

@@ -1,6 +1,6 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "../../tsconfig.json",
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "bin", "__tests__", "../../vitest.d.ts"],
"include": ["src/**/*.ts", "src/**/*.js", "src/**/*.cjs", "src/**/*.mjs", "bin"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -61,7 +61,6 @@
"@types/node": "^20.17.10",
"@types/prompts": "^2.4.9",
"@types/validate-npm-package-name": "^4.0.2",
"@vitest/coverage-v8": "^2.1.8",
"cross-env": "^7.0.3",
"eslint": "^8.57.1",
"eslint-config-neon": "^0.1.62",
@@ -69,8 +68,7 @@
"prettier": "^3.4.2",
"terser": "^5.37.0",
"tsup": "^8.3.5",
"typescript": "~5.5.4",
"vitest": "^2.1.8"
"typescript": "~5.5.4"
},
"engines": {
"node": ">=20"

View File

@@ -4,7 +4,7 @@
"version": "0.5.0",
"description": "A set of functions to format strings for Discord.",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -4,7 +4,7 @@
"version": "0.1.0",
"description": "A powerful TypeScript library for interacting with the Discord API",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -4,7 +4,7 @@
"version": "2.1.1",
"description": "Tools for running an HTTP proxy for Discord's API",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -75,7 +75,6 @@
"devDependencies": {
"@turbo/gen": "^2.3.3",
"@types/node": "^20.17.10",
"@vitest/coverage-v8": "^2.1.8",
"cross-env": "^7.0.3",
"env-cmd": "^10.1.0",
"eslint": "^8.57.1",
@@ -84,8 +83,7 @@
"prettier": "^3.4.2",
"tsup": "^8.3.5",
"turbo": "^2.3.3",
"typescript": "~5.5.4",
"vitest": "^2.1.8"
"typescript": "~5.5.4"
},
"engines": {
"node": ">=20"

View File

@@ -6,7 +6,7 @@
"scripts": {
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "pnpm run format",

View File

@@ -0,0 +1,9 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -4,7 +4,6 @@
"version": "0.1.0",
"description": "",
"scripts": {
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && vite build",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
@@ -67,14 +66,12 @@
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@storybook/testing-library": "^0.2.2",
"@types/node": "^20.17.10",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@unocss/eslint-plugin": "^0.60.4",
"@unocss/reset": "^0.60.4",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"chromatic": "^11.20.2",
"cross-env": "^7.0.3",
"eslint": "^8.57.1",
@@ -87,8 +84,7 @@
"typescript": "~5.5.4",
"unocss": "^0.60.4",
"vite": "^5.4.11",
"vite-plugin-dts": "^3.9.1",
"vitest": "^2.1.8"
"vite-plugin-dts": "^3.9.1"
},
"engines": {
"node": ">=20"

View File

@@ -1,9 +1,9 @@
import { expectType } from 'tsd';
import { expectTypeOf } from 'vitest';
import { isEquatable, type Equatable } from '../../src/index.js';
declare const unknownObj: unknown;
if (isEquatable(unknownObj)) {
expectType<Equatable<unknown>>(unknownObj);
expectType<boolean>(unknownObj.equals(unknownObj));
expectTypeOf(unknownObj).toEqualTypeOf<Equatable<unknown>>();
expectTypeOf(unknownObj.equals(unknownObj)).toEqualTypeOf<boolean>();
}

View File

@@ -1,9 +1,9 @@
import { expectType } from 'tsd';
import { expectTypeOf } from 'vitest';
import { isJSONEncodable, type JSONEncodable } from '../../src/index.js';
declare const unknownObj: unknown;
if (isJSONEncodable(unknownObj)) {
expectType<JSONEncodable<unknown>>(unknownObj);
expectType<unknown>(unknownObj.toJSON());
expectTypeOf(unknownObj).toEqualTypeOf<JSONEncodable<unknown>>();
expectTypeOf(unknownObj.toJSON()).toEqualTypeOf<unknown>();
}

View File

@@ -6,7 +6,7 @@
"scripts": {
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"test": "vitest run && tsd",
"test": "vitest run --config ../../vitest.config.ts",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "pnpm run format",
@@ -73,7 +73,6 @@
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.4.2",
"tsd": "^0.31.2",
"tsup": "^8.3.5",
"turbo": "^2.3.3",
"typescript": "~5.5.4",
@@ -85,8 +84,5 @@
"publishConfig": {
"access": "public",
"provenance": true
},
"tsd": {
"directory": "__tests__/types"
}
}

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -256,12 +256,9 @@ describe('State transitions', () => {
expect(connection.dispatchAudio).toHaveBeenCalledTimes(6);
await wait();
player['_stepPrepare']();
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<
[Buffer],
typeof connection.prepareAudioPacket
>;
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<typeof connection.prepareAudioPacket>;
expect(prepareAudioPacket).toHaveBeenCalledTimes(6);
expect(prepareAudioPacket.mock.calls[5][0]).toEqual(silence().next().value);
expect(prepareAudioPacket.mock.calls[5]![0]).toEqual(silence().next().value);
player.stop(true);
expect(player.state.status).toEqual(AudioPlayerStatus.Idle);
@@ -314,10 +311,7 @@ describe('State transitions', () => {
await wait();
expect(player.checkPlayable()).toEqual(false);
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<
[Buffer],
typeof connection.prepareAudioPacket
>;
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<typeof connection.prepareAudioPacket>;
expect(prepareAudioPacket).toHaveBeenCalledTimes(5);
expect(player.state.status).toEqual(AudioPlayerStatus.Idle);
@@ -348,10 +342,7 @@ describe('State transitions', () => {
expect(addAudioPlayer).toBeCalledTimes(1);
expect(player.checkPlayable()).toEqual(true);
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<
[Buffer],
typeof connection.prepareAudioPacket
>;
const prepareAudioPacket = connection.prepareAudioPacket as unknown as Mock<typeof connection.prepareAudioPacket>;
// Run through a few packet cycles
for (let index = 1; index <= 5; index++) {
@@ -363,7 +354,7 @@ describe('State transitions', () => {
expect(connection.dispatchAudio).toHaveBeenCalledTimes(index);
player['_stepPrepare']();
expect(prepareAudioPacket).toHaveBeenCalledTimes(index);
expect(prepareAudioPacket.mock.calls[index - 1][0]).toEqual(silence().next().value);
expect(prepareAudioPacket.mock.calls[index - 1]![0]).toEqual(silence().next().value);
}
expect(player.state.status).toEqual(AudioPlayerStatus.Idle);

View File

@@ -8,5 +8,12 @@ test.skip('Does not throw error with a package installed', async () => {
// The async loop in Secretbox will not have finished importing unless we wait
await secretboxLoadPromise;
expect(() => methods.crypto_aead_xchacha20poly1305_ietf_decrypt()).not.toThrowError();
expect(() =>
methods.crypto_aead_xchacha20poly1305_ietf_decrypt(
Buffer.from(''),
Buffer.from(''),
Buffer.from(''),
Buffer.from(''),
),
).not.toThrowError();
});

View File

@@ -6,7 +6,7 @@
"scripts": {
"build": "tsc --noEmit && tsup && node scripts/postbuild.mjs",
"build:docs": "tsc -p tsconfig.docs.json",
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"fmt": "pnpm run format",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

View File

@@ -1,15 +1,13 @@
import type { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
import { expectType, expectAssignable } from 'tsd';
import { expectTypeOf } from 'vitest';
import type { ManagerShardEventsMap, WebSocketShardEventsMap, WebSocketManager } from '../../src/index.js';
declare const manager: WebSocketManager;
declare const eventMap: ManagerShardEventsMap;
type AugmentedShardEventsMap = {
[K in keyof WebSocketShardEventsMap]: [
WebSocketShardEventsMap[K] extends [] ? { shardId: number } : WebSocketShardEventsMap[K][0] & { shardId: number },
];
[K in keyof WebSocketShardEventsMap]: [...WebSocketShardEventsMap[K], shardId: number];
};
expectType<AugmentedShardEventsMap>(eventMap);
expectAssignable<AsyncEventEmitter<AugmentedShardEventsMap>>(manager);
expectTypeOf(eventMap).toEqualTypeOf<AugmentedShardEventsMap>();
expectTypeOf(manager).toMatchTypeOf<AsyncEventEmitter<AugmentedShardEventsMap>>();

View File

@@ -4,7 +4,7 @@
"version": "2.0.0",
"description": "Wrapper around Discord's gateway",
"scripts": {
"test": "vitest run",
"test": "vitest run --config ../../vitest.config.ts",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
@@ -96,7 +96,6 @@
"eslint-formatter-pretty": "^6.0.1",
"mock-socket": "^9.3.1",
"prettier": "^3.4.2",
"tsd": "^0.31.2",
"tsup": "^8.3.5",
"turbo": "^2.3.3",
"typescript": "~5.5.4",

View File

@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": true,
"skipLibCheck": true
},
"include": ["__tests__/**/*.ts"],
"exclude": ["node_modules"]
}

361
pnpm-lock.yaml generated
View File

@@ -148,12 +148,6 @@ importers:
specifier: ^0.33.5
version: 0.33.5
devDependencies:
'@testing-library/react':
specifier: ^15.0.7
version: 15.0.7(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@testing-library/user-event':
specifier: ^14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
'@types/html-escaper':
specifier: ^3.0.2
version: 3.0.2
@@ -178,9 +172,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.4
version: 4.3.4(vite@5.4.11(@types/node@18.19.68)(terser@5.37.0))
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@18.19.68)(happy-dom@14.12.3)(terser@5.37.0))
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -223,9 +214,6 @@ importers:
vercel:
specifier: ^37.14.0
version: 37.14.0(encoding@0.1.13)
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@18.19.68)(happy-dom@14.12.3)(terser@5.37.0)
apps/website:
dependencies:
@@ -302,12 +290,6 @@ importers:
'@tailwindcss/typography':
specifier: ^0.5.15
version: 0.5.15(tailwindcss@3.4.17(ts-node@10.9.2(@types/node@20.17.10)(typescript@5.5.4)))
'@testing-library/react':
specifier: ^15.0.7
version: 15.0.7(@types/react@18.3.18)(react-dom@19.0.0-rc-f994737d14-20240522(react@19.0.0-rc-f994737d14-20240522))(react@19.0.0-rc-f994737d14-20240522)
'@testing-library/user-event':
specifier: ^14.5.2
version: 14.5.2(@testing-library/dom@10.4.0)
'@types/node':
specifier: ^20.17.10
version: 20.17.10
@@ -320,9 +302,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.4
version: 4.3.4(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
autoprefixer:
specifier: ^10.4.20
version: 10.4.20(postcss@8.4.49)
@@ -377,9 +356,6 @@ importers:
vercel:
specifier: ^37.14.0
version: 37.14.0(encoding@0.1.13)
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
packages/actions:
dependencies:
@@ -886,9 +862,6 @@ importers:
'@types/validate-npm-package-name':
specifier: ^4.0.2
version: 4.0.2
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -913,9 +886,6 @@ importers:
typescript:
specifier: ~5.5.4
version: 5.5.4
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
packages/discord.js:
dependencies:
@@ -1413,9 +1383,6 @@ importers:
'@types/node':
specifier: ^20.17.10
version: 20.17.10
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -1443,9 +1410,6 @@ importers:
typescript:
specifier: ~5.5.4
version: 5.5.4
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
packages/ui:
dependencies:
@@ -1486,9 +1450,6 @@ importers:
'@storybook/react-vite':
specifier: ^8.4.7
version: 8.4.7(@storybook/test@8.4.7(storybook@8.4.7(bufferutil@4.0.9)(prettier@3.4.2)(utf-8-validate@6.0.5)))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rollup@4.29.1)(storybook@8.4.7(bufferutil@4.0.9)(prettier@3.4.2)(utf-8-validate@6.0.5))(typescript@5.5.4)(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))
'@storybook/testing-library':
specifier: ^0.2.2
version: 0.2.2
'@types/node':
specifier: ^20.17.10
version: 20.17.10
@@ -1507,9 +1468,6 @@ importers:
'@vitejs/plugin-react':
specifier: ^4.3.4
version: 4.3.4(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
chromatic:
specifier: ^11.20.2
version: 11.20.2
@@ -1549,9 +1507,6 @@ importers:
vite-plugin-dts:
specifier: ^3.9.1
version: 3.9.1(@types/node@20.17.10)(rollup@4.29.1)(typescript@5.5.4)(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
packages/util:
devDependencies:
@@ -1569,7 +1524,7 @@ importers:
version: 20.17.10
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
version: 2.1.8(vitest@2.1.8(@types/node@20.17.10))
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -1588,12 +1543,9 @@ importers:
prettier:
specifier: ^3.4.2
version: 3.4.2
tsd:
specifier: ^0.31.2
version: 0.31.2
tsup:
specifier: ^8.3.5
version: 8.3.5(@microsoft/api-extractor@7.43.0(@types/node@20.17.10))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.7.0)
version: 8.3.5(postcss@8.4.49)(typescript@5.5.4)(yaml@2.7.0)
turbo:
specifier: ^2.3.3
version: 2.3.3
@@ -1602,7 +1554,7 @@ importers:
version: 5.5.4
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
version: 2.1.8(@types/node@20.17.10)
packages/voice:
dependencies:
@@ -1705,7 +1657,7 @@ importers:
version: 2.8.1
ws:
specifier: ^8.18.0
version: 8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
version: 8.18.0
devDependencies:
'@discordjs/api-extractor':
specifier: workspace:^
@@ -1721,7 +1673,7 @@ importers:
version: 20.17.10
'@vitest/coverage-v8':
specifier: ^2.1.8
version: 2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))
version: 2.1.8(vitest@2.1.8(@types/node@20.17.10))
cross-env:
specifier: ^7.0.3
version: 7.0.3
@@ -1743,12 +1695,9 @@ importers:
prettier:
specifier: ^3.4.2
version: 3.4.2
tsd:
specifier: ^0.31.2
version: 0.31.2
tsup:
specifier: ^8.3.5
version: 8.3.5(@microsoft/api-extractor@7.43.0(@types/node@20.17.10))(jiti@2.4.2)(postcss@8.4.49)(tsx@4.19.2)(typescript@5.5.4)(yaml@2.7.0)
version: 8.3.5(postcss@8.4.49)(typescript@5.5.4)(yaml@2.7.0)
turbo:
specifier: ^2.3.3
version: 2.3.3
@@ -1760,7 +1709,7 @@ importers:
version: 6.21.0
vitest:
specifier: ^2.1.8
version: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0)
version: 2.1.8(@types/node@20.17.10)
zlib-sync:
specifier: ^0.1.9
version: 0.1.9
@@ -5104,10 +5053,6 @@ packages:
peerDependencies:
storybook: ^8.4.7
'@storybook/testing-library@0.2.2':
resolution: {integrity: sha512-L8sXFJUHmrlyU2BsWWZGuAjv39Jl1uAqUHdxmN42JY15M4+XCMjGlArdCCjDe1wpTSW6USYISA9axjZojgtvnw==}
deprecated: In Storybook 8, this package functionality has been integrated to a new package called @storybook/test, which uses Vitest APIs for an improved experience. When upgrading to Storybook 8 with 'npx storybook@latest upgrade', you will get prompted and will get an automigration for the new package. Please migrate when you can.
'@storybook/theming@7.6.17':
resolution: {integrity: sha512-ZbaBt3KAbmBtfjNqgMY7wPMBshhSJlhodyMNQypv+95xLD/R+Az6aBYbpVAOygLaUQaQk4ar7H/Ww6lFIoiFbA==}
peerDependencies:
@@ -5152,25 +5097,10 @@ packages:
resolution: {integrity: sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==}
engines: {node: '>=18'}
'@testing-library/dom@9.3.4':
resolution: {integrity: sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==}
engines: {node: '>=14'}
'@testing-library/jest-dom@6.5.0':
resolution: {integrity: sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA==}
engines: {node: '>=14', npm: '>=6', yarn: '>=1'}
'@testing-library/react@15.0.7':
resolution: {integrity: sha512-cg0RvEdD1TIhhkm1IeYMQxrzy0MtUNfa3minv4MjbgcYzJAZ7yD0i0lwoPOTPr+INtiXFezt2o8xMSnyHhEn2Q==}
engines: {node: '>=18'}
peerDependencies:
'@types/react': ^18.0.0
react: ^18.0.0
react-dom: ^18.0.0
peerDependenciesMeta:
'@types/react':
optional: true
'@testing-library/user-event@14.5.2':
resolution: {integrity: sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==}
engines: {node: '>=12', npm: '>=6'}
@@ -6206,9 +6136,6 @@ packages:
resolution: {integrity: sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==}
engines: {node: '>=10'}
aria-query@5.1.3:
resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==}
aria-query@5.3.0:
resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==}
@@ -7259,10 +7186,6 @@ packages:
resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==}
engines: {node: '>=6'}
deep-equal@2.2.3:
resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==}
engines: {node: '>= 0.4'}
deep-extend@0.6.0:
resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==}
engines: {node: '>=4.0.0'}
@@ -7510,9 +7433,6 @@ packages:
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
engines: {node: '>= 0.4'}
es-get-iterator@1.1.3:
resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==}
es-iterator-helpers@1.2.1:
resolution: {integrity: sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==}
engines: {node: '>= 0.4'}
@@ -10503,10 +10423,6 @@ packages:
resolution: {integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==}
engines: {node: '>= 0.4'}
object-is@1.1.6:
resolution: {integrity: sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==}
engines: {node: '>= 0.4'}
object-keys@1.1.1:
resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==}
engines: {node: '>= 0.4'}
@@ -11910,10 +11826,6 @@ packages:
std-env@3.8.0:
resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==}
stop-iteration-iterator@1.1.0:
resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
engines: {node: '>= 0.4'}
store2@2.14.4:
resolution: {integrity: sha512-srTItn1GOvyvOycgxjAnPA63FZNwy0PTyUBFMHRM+hVFltAeoh0LmNBz9SZqUS9mMqGk8rfyWyXn3GH5ReJ8Zw==}
@@ -17581,12 +17493,6 @@ snapshots:
'@vitest/spy': 2.0.5
storybook: 8.4.7(bufferutil@4.0.9)(prettier@3.4.2)(utf-8-validate@6.0.5)
'@storybook/testing-library@0.2.2':
dependencies:
'@testing-library/dom': 9.3.4
'@testing-library/user-event': 14.5.2(@testing-library/dom@9.3.4)
ts-dedent: 2.2.0
'@storybook/theming@7.6.17(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@18.3.1)
@@ -17657,17 +17563,6 @@ snapshots:
lz-string: 1.5.0
pretty-format: 27.5.1
'@testing-library/dom@9.3.4':
dependencies:
'@babel/code-frame': 7.26.2
'@babel/runtime': 7.26.0
'@types/aria-query': 5.0.4
aria-query: 5.1.3
chalk: 4.1.2
dom-accessibility-api: 0.5.16
lz-string: 1.5.0
pretty-format: 27.5.1
'@testing-library/jest-dom@6.5.0':
dependencies:
'@adobe/css-tools': 4.4.1
@@ -17678,34 +17573,10 @@ snapshots:
lodash: 4.17.21
redent: 3.0.0
'@testing-library/react@15.0.7(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)':
dependencies:
'@babel/runtime': 7.26.0
'@testing-library/dom': 10.4.0
'@types/react-dom': 18.3.5(@types/react@18.3.18)
react: 18.3.1
react-dom: 18.3.1(react@18.3.1)
optionalDependencies:
'@types/react': 18.3.18
'@testing-library/react@15.0.7(@types/react@18.3.18)(react-dom@19.0.0-rc-f994737d14-20240522(react@19.0.0-rc-f994737d14-20240522))(react@19.0.0-rc-f994737d14-20240522)':
dependencies:
'@babel/runtime': 7.26.0
'@testing-library/dom': 10.4.0
'@types/react-dom': 18.3.5(@types/react@18.3.18)
react: 19.0.0-rc-f994737d14-20240522
react-dom: 19.0.0-rc-f994737d14-20240522(react@19.0.0-rc-f994737d14-20240522)
optionalDependencies:
'@types/react': 18.3.18
'@testing-library/user-event@14.5.2(@testing-library/dom@10.4.0)':
dependencies:
'@testing-library/dom': 10.4.0
'@testing-library/user-event@14.5.2(@testing-library/dom@9.3.4)':
dependencies:
'@testing-library/dom': 9.3.4
'@tootallnate/once@2.0.0': {}
'@tootallnate/quickjs-emscripten@0.23.0': {}
@@ -18975,24 +18846,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@vitest/coverage-v8@2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@18.19.68)(happy-dom@14.12.3)(terser@5.37.0))':
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 0.2.3
debug: 4.4.0
istanbul-lib-coverage: 3.2.2
istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 5.0.6
istanbul-reports: 3.1.7
magic-string: 0.30.17
magicast: 0.3.5
std-env: 3.8.0
test-exclude: 7.0.1
tinyrainbow: 1.2.0
vitest: 2.1.8(@edge-runtime/vm@3.2.0)(@types/node@18.19.68)(happy-dom@14.12.3)(terser@5.37.0)
transitivePeerDependencies:
- supports-color
'@vitest/coverage-v8@2.1.8(vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0))':
dependencies:
'@ampproject/remapping': 2.3.0
@@ -19029,6 +18882,24 @@ snapshots:
transitivePeerDependencies:
- supports-color
'@vitest/coverage-v8@2.1.8(vitest@2.1.8(@types/node@20.17.10))':
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 0.2.3
debug: 4.4.0
istanbul-lib-coverage: 3.2.2
istanbul-lib-report: 3.0.1
istanbul-lib-source-maps: 5.0.6
istanbul-reports: 3.1.7
magic-string: 0.30.17
magicast: 0.3.5
std-env: 3.8.0
test-exclude: 7.0.1
tinyrainbow: 1.2.0
vitest: 2.1.8(@types/node@20.17.10)
transitivePeerDependencies:
- supports-color
'@vitest/expect@2.0.5':
dependencies:
'@vitest/spy': 2.0.5
@@ -19043,21 +18914,13 @@ snapshots:
chai: 5.1.2
tinyrainbow: 1.2.0
'@vitest/mocker@2.1.8(vite@5.4.11(@types/node@18.19.68)(terser@5.37.0))':
'@vitest/mocker@2.1.8(vite@5.4.11(@types/node@20.17.10))':
dependencies:
'@vitest/spy': 2.1.8
estree-walker: 3.0.3
magic-string: 0.30.17
optionalDependencies:
vite: 5.4.11(@types/node@18.19.68)(terser@5.37.0)
'@vitest/mocker@2.1.8(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))':
dependencies:
'@vitest/spy': 2.1.8
estree-walker: 3.0.3
magic-string: 0.30.17
optionalDependencies:
vite: 5.4.11(@types/node@20.17.10)(terser@5.37.0)
vite: 5.4.11(@types/node@20.17.10)
'@vitest/mocker@2.1.8(vite@5.4.11(@types/node@22.10.2)(terser@5.37.0))':
dependencies:
@@ -19303,10 +19166,6 @@ snapshots:
dependencies:
tslib: 2.8.1
aria-query@5.1.3:
dependencies:
deep-equal: 2.2.3
aria-query@5.3.0:
dependencies:
dequal: 2.0.3
@@ -20406,27 +20265,6 @@ snapshots:
deep-eql@5.0.2: {}
deep-equal@2.2.3:
dependencies:
array-buffer-byte-length: 1.0.2
call-bind: 1.0.8
es-get-iterator: 1.1.3
get-intrinsic: 1.2.6
is-arguments: 1.2.0
is-array-buffer: 3.0.5
is-date-object: 1.1.0
is-regex: 1.2.1
is-shared-array-buffer: 1.0.4
isarray: 2.0.5
object-is: 1.1.6
object-keys: 1.1.1
object.assign: 4.1.7
regexp.prototype.flags: 1.5.3
side-channel: 1.1.0
which-boxed-primitive: 1.1.1
which-collection: 1.0.2
which-typed-array: 1.1.18
deep-extend@0.6.0: {}
deep-is@0.1.4: {}
@@ -20718,18 +20556,6 @@ snapshots:
es-errors@1.3.0: {}
es-get-iterator@1.1.3:
dependencies:
call-bind: 1.0.8
get-intrinsic: 1.2.6
has-symbols: 1.1.0
is-arguments: 1.2.0
is-map: 2.0.3
is-set: 2.0.3
is-string: 1.1.1
isarray: 2.0.5
stop-iteration-iterator: 1.1.0
es-iterator-helpers@1.2.1:
dependencies:
call-bind: 1.0.8
@@ -24989,11 +24815,6 @@ snapshots:
object-inspect@1.13.3: {}
object-is@1.1.6:
dependencies:
call-bind: 1.0.8
define-properties: 1.2.1
object-keys@1.1.1: {}
object-to-spawn-args@2.0.1: {}
@@ -25416,6 +25237,13 @@ snapshots:
tsx: 4.19.2
yaml: 2.7.0
postcss-load-config@6.0.1(postcss@8.4.49)(yaml@2.7.0):
dependencies:
lilconfig: 3.1.3
optionalDependencies:
postcss: 8.4.49
yaml: 2.7.0
postcss-loader@7.3.4(postcss@8.4.49)(typescript@5.5.4):
dependencies:
cosmiconfig: 8.3.6(typescript@5.5.4)
@@ -26655,11 +26483,6 @@ snapshots:
std-env@3.8.0: {}
stop-iteration-iterator@1.1.0:
dependencies:
es-errors: 1.3.0
internal-slot: 1.1.0
store2@2.14.4: {}
storybook@8.4.7(bufferutil@4.0.9)(prettier@3.4.2)(utf-8-validate@6.0.5):
@@ -27336,6 +27159,33 @@ snapshots:
- tsx
- yaml
tsup@8.3.5(postcss@8.4.49)(typescript@5.5.4)(yaml@2.7.0):
dependencies:
bundle-require: 5.1.0(esbuild@0.24.2)
cac: 6.7.14
chokidar: 4.0.3
consola: 3.3.3
debug: 4.4.0
esbuild: 0.24.2
joycon: 3.1.1
picocolors: 1.1.1
postcss-load-config: 6.0.1(postcss@8.4.49)(yaml@2.7.0)
resolve-from: 5.0.0
rollup: 4.29.1
source-map: 0.8.0-beta.0
sucrase: 3.35.0
tinyexec: 0.3.2
tinyglobby: 0.2.10
tree-kill: 1.2.2
optionalDependencies:
postcss: 8.4.49
typescript: 5.5.4
transitivePeerDependencies:
- jiti
- supports-color
- tsx
- yaml
tsutils-etc@1.4.2(tsutils@3.21.0(typescript@5.5.4))(typescript@5.5.4):
dependencies:
'@types/yargs': 17.0.33
@@ -28025,13 +27875,13 @@ snapshots:
- supports-color
- terser
vite-node@2.1.8(@types/node@18.19.68)(terser@5.37.0):
vite-node@2.1.8(@types/node@20.17.10):
dependencies:
cac: 6.7.14
debug: 4.4.0
es-module-lexer: 1.6.0
pathe: 1.1.2
vite: 5.4.11(@types/node@18.19.68)(terser@5.37.0)
vite: 5.4.11(@types/node@20.17.10)
transitivePeerDependencies:
- '@types/node'
- less
@@ -28116,6 +27966,15 @@ snapshots:
fsevents: 2.3.3
terser: 5.37.0
vite@5.4.11(@types/node@20.17.10):
dependencies:
esbuild: 0.21.5
postcss: 8.4.49
rollup: 4.29.1
optionalDependencies:
'@types/node': 20.17.10
fsevents: 2.3.3
vite@5.4.11(@types/node@20.17.10)(terser@5.37.0):
dependencies:
esbuild: 0.21.5
@@ -28179,47 +28038,10 @@ snapshots:
- supports-color
- terser
vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@18.19.68)(happy-dom@14.12.3)(terser@5.37.0):
dependencies:
'@vitest/expect': 2.1.8
'@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@18.19.68)(terser@5.37.0))
'@vitest/pretty-format': 2.1.8
'@vitest/runner': 2.1.8
'@vitest/snapshot': 2.1.8
'@vitest/spy': 2.1.8
'@vitest/utils': 2.1.8
chai: 5.1.2
debug: 4.4.0
expect-type: 1.1.0
magic-string: 0.30.17
pathe: 1.1.2
std-env: 3.8.0
tinybench: 2.9.0
tinyexec: 0.3.2
tinypool: 1.0.2
tinyrainbow: 1.2.0
vite: 5.4.11(@types/node@18.19.68)(terser@5.37.0)
vite-node: 2.1.8(@types/node@18.19.68)(terser@5.37.0)
why-is-node-running: 2.3.0
optionalDependencies:
'@edge-runtime/vm': 3.2.0
'@types/node': 18.19.68
happy-dom: 14.12.3
transitivePeerDependencies:
- less
- lightningcss
- msw
- sass
- sass-embedded
- stylus
- sugarss
- supports-color
- terser
vitest@2.1.8(@edge-runtime/vm@3.2.0)(@types/node@20.17.10)(happy-dom@14.12.3)(terser@5.37.0):
dependencies:
'@vitest/expect': 2.1.8
'@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@20.17.10)(terser@5.37.0))
'@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@22.10.2)(terser@5.37.0))
'@vitest/pretty-format': 2.1.8
'@vitest/runner': 2.1.8
'@vitest/snapshot': 2.1.8
@@ -28290,6 +28112,41 @@ snapshots:
- supports-color
- terser
vitest@2.1.8(@types/node@20.17.10):
dependencies:
'@vitest/expect': 2.1.8
'@vitest/mocker': 2.1.8(vite@5.4.11(@types/node@20.17.10))
'@vitest/pretty-format': 2.1.8
'@vitest/runner': 2.1.8
'@vitest/snapshot': 2.1.8
'@vitest/spy': 2.1.8
'@vitest/utils': 2.1.8
chai: 5.1.2
debug: 4.4.0
expect-type: 1.1.0
magic-string: 0.30.17
pathe: 1.1.2
std-env: 3.8.0
tinybench: 2.9.0
tinyexec: 0.3.2
tinypool: 1.0.2
tinyrainbow: 1.2.0
vite: 5.4.11(@types/node@20.17.10)
vite-node: 2.1.8(@types/node@20.17.10)
why-is-node-running: 2.3.0
optionalDependencies:
'@types/node': 20.17.10
transitivePeerDependencies:
- less
- lightningcss
- msw
- sass
- sass-embedded
- stylus
- sugarss
- supports-color
- terser
vscode-oniguruma@1.7.0: {}
vscode-textmate@8.0.0: {}
@@ -28461,6 +28318,8 @@ snapshots:
imurmurhash: 0.1.4
signal-exit: 3.0.7
ws@8.18.0: {}
ws@8.18.0(bufferutil@4.0.9)(utf-8-validate@6.0.5):
optionalDependencies:
bufferutil: 4.0.9

View File

@@ -6,7 +6,7 @@ export default defineConfig({
passWithNoTests: true,
typecheck: {
enabled: true,
include: ['**/__tests__/types.test.ts'],
tsconfig: './tsconfig.test.json',
},
coverage: {
enabled: true,

8
vitest.d.ts vendored
View File

@@ -1,8 +0,0 @@
/* eslint-disable @typescript-eslint/no-empty-interface */
// This file only exists because of https://github.com/vitejs/vite/issues/9813.
declare interface Worker {}
declare interface WebSocket {}
declare namespace WebAssembly {
interface Module {}
}