diff --git a/.eslintrc.json b/.eslintrc.json index 5b53dbd..41dc2a7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -44,11 +44,6 @@ "error", { "allowModules": ["slow-stream"] } - ], - "node/no-missing-import": [ - "error", { - "tryExtensions": [".js", ".ts"] - } ] } } diff --git a/.tools/build.sh b/.tools/build.sh index ec9f647..9f42272 100644 --- a/.tools/build.sh +++ b/.tools/build.sh @@ -12,7 +12,7 @@ cd "${PROJECT_DIR}" echo "Compiling oleoduc (esm version)..." npm run tsc -- -p tsconfig.json -cat >"${DIST_DIR}/mjs/package.json" <"${DIST_DIR}/esm/package.json" <"${DIST_DIR}/cjs/package.json" < = TransformOptions & {accumulator?: TAcc}; export type AccumulateDataCallback = ( diff --git a/src/compose.ts b/src/compose.ts index 5e5b4b6..62390bc 100644 --- a/src/compose.ts +++ b/src/compose.ts @@ -1,10 +1,10 @@ -import {parseArgs} from "./utils/parseArgs"; -import {wrapStreams} from "./utils/wrapStreams"; -import {isReadableStream} from "./utils/isReadableStream"; -import {decorateWithAsyncIterator} from "./utils/decorateWithAsyncIterator"; -import {pipeStreamsTogether} from "./utils/pipeStreamsTogether"; -import {AnyStream, PipeableStreams} from "./types"; -import {Readable, TransformOptions} from "stream"; +import {Readable, TransformOptions} from "node:stream"; +import {parseArgs} from "./utils/parseArgs.ts"; +import {wrapStreams} from "./utils/wrapStreams.ts"; +import {isReadableStream} from "./utils/isReadableStream.ts"; +import {decorateWithAsyncIterator} from "./utils/decorateWithAsyncIterator.ts"; +import {pipeStreamsTogether} from "./utils/pipeStreamsTogether.ts"; +import {AnyStream, PipeableStreams} from "./types.ts"; export type ComposeOptions = TransformOptions; diff --git a/src/concatStreams.ts b/src/concatStreams.ts index 9dbd416..130c844 100644 --- a/src/concatStreams.ts +++ b/src/concatStreams.ts @@ -1,5 +1,5 @@ -import {PassThrough, TransformOptions} from "stream"; -import {parseArgs} from "./utils/parseArgs"; +import {PassThrough, TransformOptions} from "node:stream"; +import {parseArgs} from "./utils/parseArgs.ts"; type NextStreamCallback = () => Promise | NodeJS.ReadableStream | null; diff --git a/src/filterData.ts b/src/filterData.ts index db01b4c..bdf3e98 100644 --- a/src/filterData.ts +++ b/src/filterData.ts @@ -1,5 +1,5 @@ -import {TransformDataCallback, transformData, TransformDataOptions} from "./transformData"; import {Transform} from "node:stream"; +import {TransformDataCallback, transformData, TransformDataOptions} from "./transformData.ts"; export function filterData( filter: TransformDataCallback, diff --git a/src/flattenArray.ts b/src/flattenArray.ts index 64d95e0..2ae8112 100644 --- a/src/flattenArray.ts +++ b/src/flattenArray.ts @@ -1,4 +1,4 @@ -import {Transform, TransformCallback, TransformOptions} from "stream"; +import {Transform, TransformCallback, TransformOptions} from "node:stream"; /** * Inspired by https://stackoverflow.com/a/43811543/122975 diff --git a/src/groupData.ts b/src/groupData.ts index 54f470c..cf7cc4c 100644 --- a/src/groupData.ts +++ b/src/groupData.ts @@ -1,4 +1,4 @@ -import {accumulateData, AccumulateDataOptions} from "./accumulateData"; +import {accumulateData, AccumulateDataOptions} from "./accumulateData.ts"; export type GroupDataOptions = {size?: number} & AccumulateDataOptions>; diff --git a/src/index.ts b/src/index.ts index 571f925..5c71d8b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,18 +1,18 @@ -import {accumulateData} from "./accumulateData"; -import {compose} from "./compose"; -import {concatStreams} from "./concatStreams"; -import {filterData} from "./filterData"; -import {flattenArray} from "./flattenArray"; -import {groupData} from "./groupData"; -import {mergeStreams} from "./mergeStreams"; -import {oleoduc} from "./oleoduc"; -import {readLineByLine} from "./readLineByLine"; -import {transformData} from "./transformData"; -import {transformIntoCSV} from "./transformIntoCSV"; -import {transformIntoJSON} from "./transformIntoJSON"; -import {transformStream} from "./transformStream"; -import {writeData} from "./writeData"; -import {writeToStdout} from "./writeToStdout"; +import {accumulateData} from "./accumulateData.ts"; +import {compose} from "./compose.ts"; +import {concatStreams} from "./concatStreams.ts"; +import {filterData} from "./filterData.ts"; +import {flattenArray} from "./flattenArray.ts"; +import {groupData} from "./groupData.ts"; +import {mergeStreams} from "./mergeStreams.ts"; +import {oleoduc} from "./oleoduc.ts"; +import {readLineByLine} from "./readLineByLine.ts"; +import {transformData} from "./transformData.ts"; +import {transformIntoCSV} from "./transformIntoCSV.ts"; +import {transformIntoJSON} from "./transformIntoJSON.ts"; +import {transformStream} from "./transformStream.ts"; +import {writeData} from "./writeData.ts"; +import {writeToStdout} from "./writeToStdout.ts"; export { accumulateData, diff --git a/src/mergeStreams.ts b/src/mergeStreams.ts index c504e65..8ea1009 100644 --- a/src/mergeStreams.ts +++ b/src/mergeStreams.ts @@ -1,7 +1,6 @@ -import {PassThrough, Transform} from "stream"; -import {decorateWithAsyncIterator} from "./utils/decorateWithAsyncIterator"; -import {parseArgs} from "./utils/parseArgs"; -import {StreamOptions} from "node:stream"; +import {PassThrough, Transform, StreamOptions} from "node:stream"; +import {decorateWithAsyncIterator} from "./utils/decorateWithAsyncIterator.ts"; +import {parseArgs} from "./utils/parseArgs.ts"; export function mergeStreams( ...args: diff --git a/src/oleoduc.ts b/src/oleoduc.ts index 3d22f33..6f87410 100644 --- a/src/oleoduc.ts +++ b/src/oleoduc.ts @@ -1,8 +1,8 @@ -import {parseArgs} from "./utils/parseArgs"; -import {AnyStream, PipeableStreams} from "./types"; -import {wrapStreams} from "./utils/wrapStreams"; -import {pipeStreamsTogether} from "./utils/pipeStreamsTogether"; -import {TransformOptions} from "stream"; +import {TransformOptions} from "node:stream"; +import {parseArgs} from "./utils/parseArgs.ts"; +import {AnyStream, PipeableStreams} from "./types.ts"; +import {wrapStreams} from "./utils/wrapStreams.ts"; +import {pipeStreamsTogether} from "./utils/pipeStreamsTogether.ts"; export type OleoducOptions = TransformOptions; diff --git a/src/readLineByLine.ts b/src/readLineByLine.ts index d2ce443..fc40e4c 100644 --- a/src/readLineByLine.ts +++ b/src/readLineByLine.ts @@ -1,6 +1,6 @@ -import {accumulateData} from "./accumulateData"; -import {flattenArray} from "./flattenArray"; -import {compose} from "./compose"; +import {accumulateData} from "./accumulateData.ts"; +import {flattenArray} from "./flattenArray.ts"; +import {compose} from "./compose.ts"; export function readLineByLine() { return compose( diff --git a/src/transformData.ts b/src/transformData.ts index 7611f4c..9c9bb8c 100644 --- a/src/transformData.ts +++ b/src/transformData.ts @@ -1,6 +1,5 @@ import transform from "parallel-transform"; -import {Transform, TransformOptions} from "node:stream"; -import {TransformCallback} from "stream"; +import {Transform, TransformOptions, TransformCallback} from "node:stream"; export type TransformDataCallback = (data: TInput) => Promise | TOutput; export type TransformDataOptions = { diff --git a/src/transformIntoCSV.ts b/src/transformIntoCSV.ts index 3b6fcfe..9f98fec 100644 --- a/src/transformIntoCSV.ts +++ b/src/transformIntoCSV.ts @@ -1,4 +1,4 @@ -import {Transform, TransformOptions} from "stream"; +import {Transform, TransformOptions} from "node:stream"; export type TransformIntoCSVOptions = TransformOptions & { columns?: Record Promise | AllowedCSVType>; diff --git a/src/transformIntoJSON.ts b/src/transformIntoJSON.ts index 2bbc449..06cd377 100644 --- a/src/transformIntoJSON.ts +++ b/src/transformIntoJSON.ts @@ -1,4 +1,4 @@ -import {Transform, TransformOptions} from "stream"; +import {Transform, TransformOptions} from "node:stream"; export type TransformIntoJSONOptions = TransformOptions & { arrayPropertyName?: string; diff --git a/src/transformStream.ts b/src/transformStream.ts index c9d178d..ffadffd 100644 --- a/src/transformStream.ts +++ b/src/transformStream.ts @@ -1,5 +1,4 @@ -import {Transform, TransformCallback} from "stream"; -import {TransformOptions} from "node:stream"; +import {Transform, TransformOptions, TransformCallback} from "node:stream"; export type TransformStreamCallback = ( data: TInput, diff --git a/src/utils/Duplexer.ts b/src/utils/Duplexer.ts index 72dae29..2568bde 100644 --- a/src/utils/Duplexer.ts +++ b/src/utils/Duplexer.ts @@ -1,4 +1,4 @@ -import {Duplex, DuplexOptions, Readable, Writable} from "stream"; +import {Duplex, DuplexOptions, Readable, Writable} from "node:stream"; type DuplexerCallback = (error?: Error | null) => void; diff --git a/src/utils/decorateWithAsyncIterator.ts b/src/utils/decorateWithAsyncIterator.ts index 08dbdf1..5d96bf8 100644 --- a/src/utils/decorateWithAsyncIterator.ts +++ b/src/utils/decorateWithAsyncIterator.ts @@ -1,5 +1,5 @@ -import {toAsyncIterator} from "./toAsyncIterator"; -import {Readable} from "stream"; +import {Readable} from "node:stream"; +import {toAsyncIterator} from "./toAsyncIterator.ts"; export function decorateWithAsyncIterator(stream: Readable) { stream[Symbol.asyncIterator] = () => toAsyncIterator(stream); diff --git a/src/utils/isReadableStream.ts b/src/utils/isReadableStream.ts index ccf24da..fc56c44 100644 --- a/src/utils/isReadableStream.ts +++ b/src/utils/isReadableStream.ts @@ -1,4 +1,4 @@ -import {Readable} from "stream"; +import {Readable} from "node:stream"; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isReadableStream(stream: any): stream is Readable { diff --git a/src/utils/isWriteableStream.ts b/src/utils/isWriteableStream.ts index 7538fc3..49e58e3 100644 --- a/src/utils/isWriteableStream.ts +++ b/src/utils/isWriteableStream.ts @@ -1,4 +1,4 @@ -import {Writable} from "stream"; +import {Writable} from "node:stream"; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isWritableStream(stream: any): stream is Writable { diff --git a/src/utils/pipeStreamsTogether.ts b/src/utils/pipeStreamsTogether.ts index 6d2b398..b67df36 100644 --- a/src/utils/pipeStreamsTogether.ts +++ b/src/utils/pipeStreamsTogether.ts @@ -1,5 +1,5 @@ -import {AnyStream} from "../types"; -import {Readable, Writable} from "stream"; +import {Readable, Writable} from "node:stream"; +import {AnyStream} from "../types.ts"; export function pipeStreamsTogether(streams: AnyStream[], wrapper: AnyStream) { for (const [i, stream] of streams.entries()) { diff --git a/src/utils/toAsyncIterator.ts b/src/utils/toAsyncIterator.ts index cb2e08f..b1b4a04 100644 --- a/src/utils/toAsyncIterator.ts +++ b/src/utils/toAsyncIterator.ts @@ -1,4 +1,4 @@ -import {Readable} from "stream"; +import {Readable} from "node:stream"; type ToAsyncIteratorOptions = { chunkSize?: number; diff --git a/src/utils/wrapStreams.ts b/src/utils/wrapStreams.ts index 2dca3df..f4b0236 100644 --- a/src/utils/wrapStreams.ts +++ b/src/utils/wrapStreams.ts @@ -1,8 +1,8 @@ -import {Duplexer} from "./Duplexer"; -import {PassThrough, TransformOptions} from "stream"; -import {isReadableStream} from "./isReadableStream"; -import {isWritableStream} from "./isWriteableStream"; -import {AnyStream} from "../types"; +import {PassThrough, TransformOptions} from "node:stream"; +import {Duplexer} from "./Duplexer.ts"; +import {isReadableStream} from "./isReadableStream.ts"; +import {isWritableStream} from "./isWriteableStream.ts"; +import {AnyStream} from "../types.ts"; export function wrapStreams(streams: AnyStream[], options: TransformOptions = {}) { if (streams.length === 0) { diff --git a/src/writeData.ts b/src/writeData.ts index 3693f00..cb3973d 100644 --- a/src/writeData.ts +++ b/src/writeData.ts @@ -1,6 +1,5 @@ -import {Writable} from "stream"; +import {WritableOptions, Writable} from "node:stream"; import cyclist, {Cyclist} from "cyclist"; -import {WritableOptions} from "node:stream"; export type WriteDataOptions = {parallel?: number}; export type WriteDataCallback = (data: TInput) => void | unknown; diff --git a/src/writeToStdout.ts b/src/writeToStdout.ts index 740e725..357aae2 100644 --- a/src/writeToStdout.ts +++ b/src/writeToStdout.ts @@ -1,4 +1,4 @@ -import {Writable} from "stream"; +import {Writable} from "node:stream"; type WriteToStdoutCallback = (error: Error | null | undefined) => void; diff --git a/test/accumulateData-test.ts b/test/accumulateData-test.ts index a64f634..a231e0a 100644 --- a/test/accumulateData-test.ts +++ b/test/accumulateData-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, strictEqual, fail} from "assert"; -import {accumulateData, writeData} from "../src/index"; -import {createStream} from "./testUtils"; +import {accumulateData, writeData} from "../src/index.ts"; +import {createStream} from "./testUtils.ts"; describe("accumulateData", () => { it("can accumulateData by grouping them (flush)", (done) => { diff --git a/test/compose-test.ts b/test/compose-test.ts index fc8bfc9..9f424bd 100644 --- a/test/compose-test.ts +++ b/test/compose-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail} from "assert"; -import {createSlowStream, createStream} from "./testUtils"; -import {compose, flattenArray, transformData, writeData} from "../src"; +import {createSlowStream, createStream} from "./testUtils.ts"; +import {compose, flattenArray, transformData, writeData} from "../src/index.ts"; describe("compose", () => { it("can compose streams", (done) => { diff --git a/test/concatStreams-test.ts b/test/concatStreams-test.ts index ce54a2b..7a2f551 100644 --- a/test/concatStreams-test.ts +++ b/test/concatStreams-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {concatStreams, writeData} from "../src/index"; -import {delay, streamArray} from "./testUtils"; +import {concatStreams, writeData} from "../src/index.ts"; +import {delay, streamArray} from "./testUtils.ts"; import {Readable} from "stream"; describe("concatStreams", () => { diff --git a/test/filterData-tests.ts b/test/filterData-tests.ts index 9b111f6..3c2257c 100644 --- a/test/filterData-tests.ts +++ b/test/filterData-tests.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail, strictEqual} from "assert"; -import {createStream} from "./testUtils"; -import {filterData} from "../src"; +import {createStream} from "./testUtils.ts"; +import {filterData} from "../src/index.ts"; describe("filterData", () => { it("should filter (ignore empty)", (done) => { diff --git a/test/flattenArray-test.ts b/test/flattenArray-test.ts index 9849ddb..99ac2b7 100644 --- a/test/flattenArray-test.ts +++ b/test/flattenArray-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {accumulateData, flattenArray, writeData} from "../src"; -import {createSlowStream, streamArray} from "./testUtils"; +import {accumulateData, flattenArray, writeData} from "../src/index.ts"; +import {createSlowStream, streamArray} from "./testUtils.ts"; describe("flattenArray", () => { it("can flat map an array", (done) => { diff --git a/test/groupData-test.ts b/test/groupData-test.ts index 32114b2..eca3848 100644 --- a/test/groupData-test.ts +++ b/test/groupData-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {createStream} from "./testUtils"; -import {groupData, writeData} from "../src"; +import {createStream} from "./testUtils.ts"; +import {groupData, writeData} from "../src/index.ts"; describe("groupData", () => { it("can create group of data", (done) => { diff --git a/test/mergeStreams-test.ts b/test/mergeStreams-test.ts index 4b364e1..36c1b7c 100644 --- a/test/mergeStreams-test.ts +++ b/test/mergeStreams-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {mergeStreams, writeData} from "../src"; -import {streamArray} from "./testUtils"; +import {mergeStreams, writeData} from "../src/index.ts"; +import {streamArray} from "./testUtils.ts"; describe("mergeStreams", () => { it("can merge streams", (done) => { diff --git a/test/oleoduc-test.ts b/test/oleoduc-test.ts index 9d9165a..3e03576 100644 --- a/test/oleoduc-test.ts +++ b/test/oleoduc-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail} from "assert"; -import {assertErrorMessage, createStream, delay} from "./testUtils"; -import {compose, oleoduc, transformData, writeData} from "../src"; +import {assertErrorMessage, createStream, delay} from "./testUtils.ts"; +import {compose, oleoduc, transformData, writeData} from "../src/index.ts"; describe("oleoduc", () => { it("can create oleoduc", async () => { diff --git a/test/parallel-test.ts b/test/parallel-test.ts index ce080aa..1872890 100644 --- a/test/parallel-test.ts +++ b/test/parallel-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail, ok} from "assert"; -import {createStream, delay} from "./testUtils"; -import {filterData, transformData, writeData} from "../src"; +import {createStream, delay} from "./testUtils.ts"; +import {filterData, transformData, writeData} from "../src/index.ts"; type AccParallelData = {number: number; timestamp: number}; diff --git a/test/pipeline-test.ts b/test/pipeline-test.ts index 1f278ad..5a59621 100644 --- a/test/pipeline-test.ts +++ b/test/pipeline-test.ts @@ -1,8 +1,8 @@ import {deepStrictEqual, fail} from "assert"; import {pipeline} from "stream"; import {promisify} from "util"; -import {createStream, delay} from "./testUtils"; -import {transformData, writeData} from "../src"; +import {createStream, delay} from "./testUtils.ts"; +import {transformData, writeData} from "../src/index.ts"; describe("pipeline", () => { it("can create pipeline from stream", (done) => { diff --git a/test/readLineByLine-test.ts b/test/readLineByLine-test.ts index ca8b603..0d73bb8 100644 --- a/test/readLineByLine-test.ts +++ b/test/readLineByLine-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {createStream} from "./testUtils"; -import {oleoduc, readLineByLine, writeData} from "../src"; +import {createStream} from "./testUtils.ts"; +import {oleoduc, readLineByLine, writeData} from "../src/index.ts"; describe("readLineByLine", () => { it("can read a stream line by line", (done) => { diff --git a/test/toAsyncIterator-test.ts b/test/toAsyncIterator-test.ts index 76b1861..5ed41f3 100644 --- a/test/toAsyncIterator-test.ts +++ b/test/toAsyncIterator-test.ts @@ -1,7 +1,7 @@ import {deepStrictEqual, fail} from "assert"; -import {assertErrorMessage, createStream} from "./testUtils"; -import {toAsyncIterator} from "../src/utils/toAsyncIterator"; -import {compose, transformData} from "../src"; +import {assertErrorMessage, createStream} from "./testUtils.ts"; +import {toAsyncIterator} from "../src/utils/toAsyncIterator.ts"; +import {compose, transformData} from "../src/index.ts"; describe("toAsyncIterator", () => { it("can convert a readable stream into an iterator", async () => { diff --git a/test/transformData-test.ts b/test/transformData-test.ts index 8aff2ca..4393a6b 100644 --- a/test/transformData-test.ts +++ b/test/transformData-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, strictEqual, fail} from "assert"; -import {createStream} from "./testUtils"; -import {transformData, writeData} from "../src"; +import {createStream} from "./testUtils.ts"; +import {transformData, writeData} from "../src/index.ts"; describe("transformData", () => { it("should transformData", (done) => { diff --git a/test/transformIntoCSV-test.ts b/test/transformIntoCSV-test.ts index 0921359..a1ab489 100644 --- a/test/transformIntoCSV-test.ts +++ b/test/transformIntoCSV-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail, strictEqual, ok} from "assert"; -import {createStream, delay} from "./testUtils"; -import {transformIntoCSV, writeData} from "../src"; +import {createStream, delay} from "./testUtils.ts"; +import {transformIntoCSV, writeData} from "../src/index.ts"; type FullNameParams = {firstName: string; lastName: string}; diff --git a/test/transformIntoJSON-test.ts b/test/transformIntoJSON-test.ts index fdeafab..6236f7b 100644 --- a/test/transformIntoJSON-test.ts +++ b/test/transformIntoJSON-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {createStream} from "./testUtils"; -import {transformIntoJSON} from "../src"; +import {createStream} from "./testUtils.ts"; +import {transformIntoJSON} from "../src/index.ts"; describe("transformIntoJSON", () => { it("can stream a json array", (done) => { diff --git a/test/transformStream-test.ts b/test/transformStream-test.ts index 33ba876..85e88d4 100644 --- a/test/transformStream-test.ts +++ b/test/transformStream-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual} from "assert"; -import {createSlowStream, createStream, delay, streamArray} from "./testUtils"; -import {transformStream, writeData} from "../src"; +import {createSlowStream, createStream, delay, streamArray} from "./testUtils.ts"; +import {transformStream, writeData} from "../src/index.ts"; describe("transformStream", () => { it("should transform data into a stream", (done) => { diff --git a/test/writeData-test.ts b/test/writeData-test.ts index 7c8eb4a..38d1b6d 100644 --- a/test/writeData-test.ts +++ b/test/writeData-test.ts @@ -1,6 +1,6 @@ import {deepStrictEqual, fail, strictEqual} from "assert"; -import {createStream} from "./testUtils"; -import {writeData} from "../src"; +import {createStream} from "./testUtils.ts"; +import {writeData} from "../src/index.ts"; describe("writeData", () => { it("should writeData", (done) => { diff --git a/test/writeToStdout-test.ts b/test/writeToStdout-test.ts index bb7b491..e1deb98 100644 --- a/test/writeToStdout-test.ts +++ b/test/writeToStdout-test.ts @@ -1,5 +1,5 @@ -import {createStream} from "./testUtils"; -import {writeToStdout} from "../src"; +import {createStream} from "./testUtils.ts"; +import {writeToStdout} from "../src/index.ts"; describe("writeToStdout", () => { it("should write to stdout", (done) => { diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 56c760a..1a5236b 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -2,9 +2,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "module": "commonjs", + "esModuleInterop": true, "moduleResolution": "node", "outDir": "./dist/cjs", "target": "es2015", - "typeRoots": ["./node_modules/@types", "./src/@types"] } } diff --git a/tsconfig.json b/tsconfig.json index b6be70c..b99661b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,19 +1,15 @@ { "include": ["src"], - "exclude": ["node_modules", "dist"], "compilerOptions": { - "allowJs": true, - "declaration": true, - "declarationMap": true, - "esModuleInterop": true, - "lib": ["esnext"], - "module": "NodeNext", - "moduleResolution": "NodeNext", - "outDir": "./dist/mjs", + "module": "ESNext", + "target": "esnext", + "allowImportingTsExtensions": true, + "rewriteRelativeImportExtensions": true, + "allowSyntheticDefaultImports": true, + "outDir": "./dist/esm", "skipLibCheck": true, "sourceMap": true, "strict": true, - "target": "esnext", "types": ["node", "mocha"], }, } diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 0000000..4730310 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./dist/types", + "declaration": true, + "declarationMap": true, + "emitDeclarationOnly": true + } +}