Skip to content

Commit

Permalink
Merge pull request #250 from msgpack/remove-tsconfig-paths
Browse files Browse the repository at this point in the history
Remove tsconfig paths
  • Loading branch information
gfx authored Feb 1, 2025
2 parents d53dba2 + a752401 commit 601e9cc
Show file tree
Hide file tree
Showing 26 changed files with 27 additions and 33 deletions.
1 change: 0 additions & 1 deletion .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

require("ts-node/register");
require("tsconfig-paths/register");

module.exports = {
diff: true,
Expand Down
4 changes: 0 additions & 4 deletions karma.conf.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const path = require("path");
// const webpack = require("webpack");

// eslint-disable-next-line import/no-default-export
Expand Down Expand Up @@ -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: [
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"rimraf": "latest",
"ts-loader": "latest",
"ts-node": "latest",
"tsconfig-paths": "latest",
"typescript": "latest",
"webpack": "latest",
"webpack-cli": "latest"
Expand Down
3 changes: 2 additions & 1 deletion test/CachedKeyDecoder.test.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/ExtensionCodec.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/bigint64.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { encode, decode } from "../src";
import { encode, decode } from "../src/index";

describe("useBigInt64: true", () => {
before(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/codec-bigint.test.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion test/codec-float.test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/codec-timestamp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
decodeTimestampExtension,
decodeTimestampToTimeSpec,
encodeTimestampExtension,
} from "../src";
} from "../src/index";

const TIME = 1556636810389;

Expand Down
2 changes: 1 addition & 1 deletion test/decode-blob.test.ts
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions test/decode-max-length.test.ts
Original file line number Diff line number Diff line change
@@ -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<T>(input: T) {
Expand Down
4 changes: 2 additions & 2 deletions test/decode-raw-strings.test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion test/decodeArrayStream.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { encode, decodeArrayStream } from "../src";
import { encode, decodeArrayStream } from "../src/index";

describe("decodeArrayStream", () => {
const generateSampleObject = () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeAsync.test.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeMulti.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/decodeMultiStream.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
Expand Down
2 changes: 1 addition & 1 deletion test/edge-cases.test.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion test/encode.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert";
import { encode, decode } from "@msgpack/msgpack";
import { encode, decode } from "../src/index";

describe("encode", () => {
context("sortKeys", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/msgpack-ext.test.ts
Original file line number Diff line number Diff line change
@@ -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<number> = [];
Expand Down
2 changes: 1 addition & 1 deletion test/msgpack-test-suite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion test/prototype-pollution.test.ts
Original file line number Diff line number Diff line change
@@ -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", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/readme.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deepStrictEqual } from "assert";
import { encode, decode } from "@msgpack/msgpack";
import { encode, decode } from "../src/index";

describe("README", () => {
context("## Synopsis", () => {
Expand Down
2 changes: 1 addition & 1 deletion test/reuse-instances.test.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/whatwg-streams.test.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 601e9cc

Please sign in to comment.