build: switch to bundler moduleResolution

This commit is contained in:
iCrawl
2023-05-01 13:14:13 +02:00
parent 8b71f44b1f
commit 48cab844d4
53 changed files with 186 additions and 79 deletions

View File

@@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks';
import { MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';
import { DiscordAPIError, HTTPError, RateLimitError, REST, BurstHandlerMajorIdKey } from '../src/index.js';
import { DiscordAPIError, REST, BurstHandlerMajorIdKey } from '../src/index.js';
import { BurstHandler } from '../src/lib/handlers/BurstHandler.js';
import { genPath } from './util.js';

View File

@@ -5,7 +5,7 @@ import type { Snowflake } from 'discord-api-types/v10';
import { Routes } from 'discord-api-types/v10';
import type { FormData } from 'undici';
import { File as UndiciFile, MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
import { beforeEach, afterEach, test, expect } from 'vitest';
import { REST } from '../src/index.js';
import { genPath } from './util.js';

View File

@@ -3,7 +3,7 @@
import { performance } from 'node:perf_hooks';
import { setInterval, clearInterval, setTimeout } from 'node:timers';
import { MockAgent, setGlobalDispatcher } from 'undici';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';
import { DiscordAPIError, HTTPError, RateLimitError, REST, RESTEvents } from '../src/index.js';
import { genPath } from './util.js';

View File

@@ -18,9 +18,9 @@
"module": "./dist/index.mjs",
"typings": "./dist/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"require": "./dist/index.js"
},
"directories": {
"lib": "src",

View File

@@ -1,4 +1,4 @@
import type { RateLimitData } from '../REST';
import type { RateLimitData } from '../REST.js';
export class RateLimitError extends Error implements RateLimitData {
public timeToReset: number;

View File

@@ -1,5 +1,5 @@
import type { Dispatcher } from 'undici';
import type { RequestOptions } from '../REST';
import type { RequestOptions } from '../REST.js';
import type { HandlerRequestData, RouteData } from '../RequestManager.js';
export interface IHandler {

View File

@@ -1,8 +1,8 @@
import { setTimeout as sleep } from 'node:timers/promises';
import { AsyncQueue } from '@sapphire/async-queue';
import type { Dispatcher } from 'undici';
import type { RateLimitData, RequestOptions } from '../REST';
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager';
import type { RateLimitData, RequestOptions } from '../REST.js';
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager.js';
import { RESTEvents } from '../utils/constants.js';
import { hasSublimit, onRateLimit, parseHeader } from '../utils/utils.js';
import type { IHandler } from './IHandler.js';