diff --git a/CHANGELIST.md b/CHANGELIST.md index 11e658c..47a80f5 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -4,6 +4,7 @@ - [#488](https://github.com/nevware21/ts-async/issues/488) [CHORE] Drop Node.js 16 from CI matrix and add Node.js 24 - Node.js 16 is end-of-life and is no longer supported by key tooling dependencies (for example `puppeteer` and `@pnpm/error` require Node.js >= 18) +- [#499](https://github.com/nevware21/ts-async/issues/499) [BUG] Add the required ES Promise / Iterable / AsyncIterable libs to the package tsconfig and document the consumer ES2018 lib requirement # v0.5.5 Jan 5th, 2026 diff --git a/README.md b/README.md index 635d022..3b3a773 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,11 @@ Install the npm packare: `npm install @nevware21/ts-async --save` > "@nevware21/ts-async": ">= 0.5.5 < 2.x" > ``` +This package still targets ES5 at runtime, but its public TypeScript types use later built-in definitions such as `Promise`, `Iterable`, and `AsyncIterable`. If your project currently compiles with only ES5 libs, update your `tsconfig.json` to include a later ES lib, for example: + +- Browser / mixed environments: `"lib": ["ES2018", "DOM"]` +- Node-only environments: `"lib": ["ES2018"]` + And then just import the helpers and use them. ### Simple Examples diff --git a/lib/tsconfig.es6.json b/lib/tsconfig.es6.json index e079dfa..9976723 100644 --- a/lib/tsconfig.es6.json +++ b/lib/tsconfig.es6.json @@ -1,7 +1,12 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { + "lib": [ + "dom", + "es6", + "es2018.asynciterable" + ], "target": "es6", "outDir": "./build/es6" } -} \ No newline at end of file +} diff --git a/lib/tsconfig.json b/lib/tsconfig.json index 6b9580d..b8f9fe8 100644 --- a/lib/tsconfig.json +++ b/lib/tsconfig.json @@ -1,10 +1,16 @@ { "extends": "./tsconfig.base.json", "compilerOptions": { + "lib": [ + "dom", + "es2015.promise", + "es2015.iterable", + "es2018.asynciterable" + ], "target": "es5", "declaration": true, "declarationDir": "./build/types", "removeComments": false, "outDir": "./build/es5" } -} \ No newline at end of file +}