diff --git a/.mocharc.js b/.mocharc.js index 35d19d6..cc57238 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -1,7 +1,6 @@ 'use strict'; require("ts-node/register"); -require("tsconfig-paths/register"); module.exports = { diff: true, diff --git a/karma.conf.ts b/karma.conf.ts index 78b5e06..8ee789f 100644 --- a/karma.conf.ts +++ b/karma.conf.ts @@ -1,4 +1,3 @@ -const path = require("path"); // const webpack = require("webpack"); // eslint-disable-next-line import/no-default-export @@ -37,9 +36,6 @@ export default function configure(config: any) { resolve: { extensions: [".ts", ".tsx", ".mjs", ".js", ".json", ".wasm"], - alias: { - "@msgpack/msgpack": path.resolve(__dirname, "src"), - }, }, module: { rules: [ diff --git a/package-lock.json b/package-lock.json index c2c6612..17a627b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,6 @@ "rimraf": "latest", "ts-loader": "latest", "ts-node": "latest", - "tsconfig-paths": "latest", "typescript": "latest", "webpack": "latest", "webpack-cli": "latest" diff --git a/package.json b/package.json index 2c53e9c..0bd13a4 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,6 @@ "rimraf": "latest", "ts-loader": "latest", "ts-node": "latest", - "tsconfig-paths": "latest", "typescript": "latest", "webpack": "latest", "webpack-cli": "latest" diff --git a/test/CachedKeyDecoder.test.ts b/test/CachedKeyDecoder.test.ts index 09f5842..4e9dd06 100644 --- a/test/CachedKeyDecoder.test.ts +++ b/test/CachedKeyDecoder.test.ts @@ -1,6 +1,7 @@ import assert from "assert"; -import { CachedKeyDecoder, KeyDecoder } from "../src/CachedKeyDecoder"; +import { CachedKeyDecoder } from "../src/CachedKeyDecoder"; import { utf8EncodeJs, utf8Count } from "../src/utils/utf8"; +import type { KeyDecoder } from "../src/CachedKeyDecoder"; function tryDecode(keyDecoder: KeyDecoder, str: string): string { const byteLength = utf8Count(str); diff --git a/test/ExtensionCodec.test.ts b/test/ExtensionCodec.test.ts index 6949b17..d53634b 100644 --- a/test/ExtensionCodec.test.ts +++ b/test/ExtensionCodec.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; import util from "util"; -import { encode, decode, ExtensionCodec, decodeAsync } from "../src"; +import { encode, decode, ExtensionCodec, decodeAsync } from "../src/index"; describe("ExtensionCodec", () => { context("timestamp", () => { diff --git a/test/bigint64.test.ts b/test/bigint64.test.ts index fabf0f5..e4ab68a 100644 --- a/test/bigint64.test.ts +++ b/test/bigint64.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode } from "../src"; +import { encode, decode } from "../src/index"; describe("useBigInt64: true", () => { before(function () { diff --git a/test/codec-bigint.test.ts b/test/codec-bigint.test.ts index 4ed6aff..524bbf7 100644 --- a/test/codec-bigint.test.ts +++ b/test/codec-bigint.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, ExtensionCodec, DecodeError } from "../src"; +import { encode, decode, ExtensionCodec, DecodeError } from "../src/index"; // There's a built-in `useBigInt64: true` option, but a custom codec might be // better if you'd like to encode bigint to reduce the size of binaries. diff --git a/test/codec-float.test.ts b/test/codec-float.test.ts index 6b55df7..3b690dc 100644 --- a/test/codec-float.test.ts +++ b/test/codec-float.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import { decode } from "../src"; import * as ieee754 from "ieee754"; +import { decode } from "../src/index"; const FLOAT32_TYPE = 0xca; const FLOAT64_TYPE = 0xcb; diff --git a/test/codec-timestamp.test.ts b/test/codec-timestamp.test.ts index de4f707..1ee1432 100644 --- a/test/codec-timestamp.test.ts +++ b/test/codec-timestamp.test.ts @@ -7,7 +7,7 @@ import { decodeTimestampExtension, decodeTimestampToTimeSpec, encodeTimestampExtension, -} from "../src"; +} from "../src/index"; const TIME = 1556636810389; diff --git a/test/decode-blob.test.ts b/test/decode-blob.test.ts index 4c7c536..5fdb6c9 100644 --- a/test/decode-blob.test.ts +++ b/test/decode-blob.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, decodeAsync } from "@msgpack/msgpack"; +import { encode, decode, decodeAsync } from "../src/index"; (typeof Blob !== "undefined" ? describe : describe.skip)("Blob", () => { it("decodes it with `decode()`", async function () { diff --git a/test/decode-max-length.test.ts b/test/decode-max-length.test.ts index 7ee2e33..8a2eb56 100644 --- a/test/decode-max-length.test.ts +++ b/test/decode-max-length.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import { encode, decode, decodeAsync } from "../src"; -import type { DecoderOptions } from "../src"; +import { encode, decode, decodeAsync } from "../src/index"; +import type { DecoderOptions } from "../src/index"; describe("decode with max${Type}Length specified", () => { async function* createStream(input: T) { diff --git a/test/decode-raw-strings.test.ts b/test/decode-raw-strings.test.ts index cdaaa1b..dc5f89b 100644 --- a/test/decode-raw-strings.test.ts +++ b/test/decode-raw-strings.test.ts @@ -1,6 +1,6 @@ import assert from "assert"; -import { encode, decode } from "../src"; -import type { DecoderOptions } from "../src"; +import { encode, decode } from "../src/index"; +import type { DecoderOptions } from "../src/index"; describe("decode with rawStrings specified", () => { const options = { rawStrings: true } satisfies DecoderOptions; diff --git a/test/decodeArrayStream.test.ts b/test/decodeArrayStream.test.ts index 0486101..f91b12e 100644 --- a/test/decodeArrayStream.test.ts +++ b/test/decodeArrayStream.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeArrayStream } from "../src"; +import { encode, decodeArrayStream } from "../src/index"; describe("decodeArrayStream", () => { const generateSampleObject = () => { diff --git a/test/decodeAsync.test.ts b/test/decodeAsync.test.ts index 0e8d901..99b46f6 100644 --- a/test/decodeAsync.test.ts +++ b/test/decodeAsync.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeAsync } from "../src"; +import { encode, decodeAsync } from "../src/index"; describe("decodeAsync", () => { function wrapWithNoisyBuffer(byte: number) { diff --git a/test/decodeMulti.test.ts b/test/decodeMulti.test.ts index 346d15c..f5b96e1 100644 --- a/test/decodeMulti.test.ts +++ b/test/decodeMulti.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeMulti } from "@msgpack/msgpack"; +import { encode, decodeMulti } from "../src/index"; describe("decodeMulti", () => { it("decodes multiple objects in a single binary", () => { diff --git a/test/decodeMultiStream.test.ts b/test/decodeMultiStream.test.ts index cef9d6e..b88dd12 100644 --- a/test/decodeMultiStream.test.ts +++ b/test/decodeMultiStream.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decodeMultiStream } from "@msgpack/msgpack"; +import { encode, decodeMultiStream } from "../src/index"; describe("decodeStream", () => { it("decodes stream", async () => { diff --git a/test/edge-cases.test.ts b/test/edge-cases.test.ts index ca4ad51..642df22 100644 --- a/test/edge-cases.test.ts +++ b/test/edge-cases.test.ts @@ -1,7 +1,7 @@ // kind of hand-written fuzzing data // any errors should not break Encoder/Decoder instance states import assert from "assert"; -import { encode, decodeAsync, decode, Encoder, Decoder, decodeMulti, decodeMultiStream } from "../src"; +import { encode, decodeAsync, decode, Encoder, Decoder, decodeMulti, decodeMultiStream } from "../src/index"; import { DataViewIndexOutOfBoundsError } from "../src/Decoder"; function testEncoder(encoder: Encoder): void { diff --git a/test/encode.test.ts b/test/encode.test.ts index d2679d5..2167276 100644 --- a/test/encode.test.ts +++ b/test/encode.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode } from "@msgpack/msgpack"; +import { encode, decode } from "../src/index"; describe("encode", () => { context("sortKeys", () => { diff --git a/test/msgpack-ext.test.ts b/test/msgpack-ext.test.ts index 73a536a..a884f5c 100644 --- a/test/msgpack-ext.test.ts +++ b/test/msgpack-ext.test.ts @@ -1,5 +1,5 @@ import assert from "assert"; -import { encode, decode, ExtData } from "../src"; +import { encode, decode, ExtData } from "../src/index"; function seq(n: number) { const a: Array = []; diff --git a/test/msgpack-test-suite.test.ts b/test/msgpack-test-suite.test.ts index 6800973..94c841e 100644 --- a/test/msgpack-test-suite.test.ts +++ b/test/msgpack-test-suite.test.ts @@ -2,7 +2,7 @@ import assert from "assert"; import util from "util"; import { Exam } from "msgpack-test-js"; import { MsgTimestamp } from "msg-timestamp"; -import { encode, decode, ExtensionCodec, EXT_TIMESTAMP, encodeTimeSpecToTimestamp } from "@msgpack/msgpack"; +import { encode, decode, ExtensionCodec, EXT_TIMESTAMP, encodeTimeSpecToTimestamp } from "../src/index"; const extensionCodec = new ExtensionCodec(); extensionCodec.register({ diff --git a/test/prototype-pollution.test.ts b/test/prototype-pollution.test.ts index bc15b63..78238c0 100644 --- a/test/prototype-pollution.test.ts +++ b/test/prototype-pollution.test.ts @@ -1,5 +1,5 @@ import { throws } from "assert"; -import { encode, decode, DecodeError } from "@msgpack/msgpack"; +import { encode, decode, DecodeError } from "../src/index"; describe("prototype pollution", () => { context("__proto__ exists as a map key", () => { diff --git a/test/readme.test.ts b/test/readme.test.ts index fea8123..0ee9fd5 100644 --- a/test/readme.test.ts +++ b/test/readme.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual } from "assert"; -import { encode, decode } from "@msgpack/msgpack"; +import { encode, decode } from "../src/index"; describe("README", () => { context("## Synopsis", () => { diff --git a/test/reuse-instances.test.ts b/test/reuse-instances.test.ts index 29a0b78..8f1cee1 100644 --- a/test/reuse-instances.test.ts +++ b/test/reuse-instances.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual } from "assert"; -import { Encoder, Decoder, decode } from "@msgpack/msgpack"; +import { Encoder, Decoder, decode } from "../src/index"; const createStream = async function* (...args: any) { for (const item of args) { diff --git a/test/whatwg-streams.test.ts b/test/whatwg-streams.test.ts index 7a83805..ac2ae6a 100644 --- a/test/whatwg-streams.test.ts +++ b/test/whatwg-streams.test.ts @@ -1,5 +1,5 @@ import { deepStrictEqual } from "assert"; -import { decodeAsync, encode, decodeArrayStream } from "@msgpack/msgpack"; +import { decodeAsync, encode, decodeArrayStream } from "../src/index"; const isReadableStreamConstructorAvailable: boolean = (() => { try { diff --git a/tsconfig.json b/tsconfig.json index c62b0b1..72ea80a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -45,9 +45,9 @@ /* Module Resolution Options */ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ - "paths": { - "@msgpack/msgpack": ["./src"] - }, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "paths": { + // "@msgpack/msgpack": ["./src"] + // }, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */