From 25503a76f6349744f14a5d89766d724db92a406b Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 17:22:30 +0100 Subject: [PATCH 1/8] Revert "Require Node 18 or higher" This reverts commit 94bf0cdd5300b063e324ab1eca7ad68c85c4b122. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70e0cde..aaf1f18 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "wpt-runner": "^5.0.0" }, "engines": { - "node": ">= 18" + "node": ">= 8" } }, "node_modules/@aashutoshrathi/word-wrap": { diff --git a/package.json b/package.json index fb89249..7126276 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "types" ], "engines": { - "node": ">= 18" + "node": ">= 8" }, "repository": { "type": "git", From 3c324eefc6910546b585578f83da1d73138e3a7a Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 17:29:27 +0100 Subject: [PATCH 2/8] Revert "Remove down-leveling for TypeScript 3.5 or lower" This reverts commit 9eb8d6c3330003c03a34a1d0652247f456599ec3. --- build/downlevel-dts.js | 71 ++++++++++++ package-lock.json | 239 ++++++++++++----------------------------- package.json | 12 ++- 3 files changed, 150 insertions(+), 172 deletions(-) create mode 100644 build/downlevel-dts.js diff --git a/build/downlevel-dts.js b/build/downlevel-dts.js new file mode 100644 index 0000000..b1d2bd0 --- /dev/null +++ b/build/downlevel-dts.js @@ -0,0 +1,71 @@ +// Based on downlevel-dts (MIT licensed) by Nathan Shively-Sanders +// https://github.com/sandersn/downlevel-dts/blob/e7d1cb5aced5686826fe8aac4d4af2f745a9ef60/index.js + +const { Project, ts } = require('ts-morph'); +const path = require('path'); + +const project = new Project(); +const inputDir = project.addDirectoryAtPath(path.join(__dirname, '../dist/types/')); + +// Create output directory +const ts36Dir = inputDir.createDirectory('ts3.6'); +project.saveSync(); + +// Down-level all *.d.ts files in input directory +const files = inputDir.addSourceFilesAtPaths('*.d.ts'); +for (const f of files) { + // Create copy for TypeScript 3.6+ + f.copyToDirectory(ts36Dir, { overwrite: true }); + downlevelTS36(f); + downlevelTS34(f); + // Original file will be overwritten by down-leveled file when saved +} +project.saveSync(); + +/** + * Down-level TypeScript 3.6 types in the given source file + */ +function downlevelTS36(f) { + // Replace get/set accessors with (read-only) properties + const gs = f.getDescendantsOfKind(ts.SyntaxKind.GetAccessor); + for (const g of gs) { + const s = g.getSetAccessor(); + const returnTypeNode = g.getReturnTypeNode(); + const returnType = returnTypeNode ? returnTypeNode.getText() : 'any'; + g.getParent().insertProperty(g.getChildIndex(), Object.assign({}, g.getStructure(), { + type: returnType, + isReadonly: !s + })); + g.remove(); + if (s) { + s.remove(); + } + } + const ss = f.getDescendantsOfKind(ts.SyntaxKind.SetAccessor); + for (const s of ss) { + const g = s.getGetAccessor(); + if (!g) { + const firstParam = s.getParameters()[0]; + const firstParamTypeNode = firstParam && firstParam.getTypeNode(); + const firstParamType = firstParamTypeNode ? firstParamTypeNode.getText() : 'any'; + s.getParent().insertProperty(s.getChildIndex(), Object.assign({}, s.getStructure(), { + type: firstParamType, + isReadonly: false + })); + s.remove(); + } + } +} + +/** + * Down-level TypeScript 3.4 types in the given source file + */ +function downlevelTS34(f) { + // Replace "es2018.asynciterable" with "esnext.asynciterable" in lib references + const refs = f.getLibReferenceDirectives(); + for (const r of refs) { + if (r.getFileName() === 'es2018.asynciterable') { + f.replaceText([r.getPos(), r.getEnd()], 'esnext.asynciterable'); + } + } +} diff --git a/package-lock.json b/package-lock.json index aaf1f18..fe11658 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "playwright": "^1.14.1", "recursive-readdir": "^2.2.2", "rollup": "^4.9.2", + "ts-morph": "^10.0.2", "tslib": "^2.6.2", "typescript": "^5.3.3", "wpt-runner": "^5.0.0" @@ -523,162 +524,6 @@ } } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz", - "integrity": "sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz", - "integrity": "sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz", - "integrity": "sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz", - "integrity": "sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz", - "integrity": "sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz", - "integrity": "sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz", - "integrity": "sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz", - "integrity": "sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz", - "integrity": "sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz", - "integrity": "sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz", - "integrity": "sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz", - "integrity": "sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@rollup/rollup-win32-x64-msvc": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz", @@ -746,6 +591,40 @@ "node": ">= 10" } }, + "node_modules/@ts-morph/common": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@ts-morph/common/-/common-0.9.2.tgz", + "integrity": "sha512-IPyg+c3Am0EBoa63W0f/AKeLrJhvzMzQ4BIvD1baxLopmiHOj1HFTXYxC6e8iTZ+UYtN+/WFM9UyGRnoA20b8g==", + "dev": true, + "dependencies": { + "fast-glob": "^3.2.5", + "minimatch": "^3.0.4", + "mkdirp": "^1.0.4", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@ts-morph/common/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@ts-morph/common/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", @@ -1288,6 +1167,12 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/code-block-writer": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-10.1.1.tgz", + "integrity": "sha512-67ueh2IRGst/51p0n6FvPrnRjAGHY5F8xdjkgrYE7DDzpJe6qA07RYQ9VcoUeo5ATOjSOiWpSL3SWBRRbempMw==", + "dev": true + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1874,20 +1759,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -2513,6 +2384,18 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2620,6 +2503,12 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -3405,6 +3294,16 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-morph": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ts-morph/-/ts-morph-10.1.0.tgz", + "integrity": "sha512-hfskRPAbc+N1+2QvPLvJ0MOrhcwxJuBlCbX+D+9T7UnrZZqsdbmWb6FfywQ7sghyqwok6Pc8ZPwzaumlOJ8OBA==", + "dev": true, + "dependencies": { + "@ts-morph/common": "~0.9.2", + "code-block-writer": "^10.1.1" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", diff --git a/package.json b/package.json index 7126276..8d8473f 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,13 @@ "browser": "dist/polyfill.min.js", "module": "dist/polyfill.mjs", "types": "types/polyfill.d.ts", + "typesVersions": { + ">=3.6": { + "dist/types/*": [ + "dist/types/ts3.6/*" + ] + } + }, "scripts": { "test": "npm run test:types && npm run test:unit && npm run test:wpt", "test:wpt": "npm run test:wpt:node && npm run test:wpt:chromium && npm run test:wpt:firefox", @@ -17,8 +24,8 @@ "lint": "eslint \"src/**/*.ts\"", "build": "npm run build:bundle && npm run build:types", "build:bundle": "rollup -c", - "build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run", - "accept:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run --local", + "build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run && node ./build/downlevel-dts.js", + "accept:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run --local && node ./build/downlevel-dts.js", "prepare": "npm run build" }, "files": [ @@ -67,6 +74,7 @@ "playwright": "^1.14.1", "recursive-readdir": "^2.2.2", "rollup": "^4.9.2", + "ts-morph": "^10.0.2", "tslib": "^2.6.2", "typescript": "^5.3.3", "wpt-runner": "^5.0.0" From a1d052e29c12807e758be524549c9d23964a72b3 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 17:43:14 +0100 Subject: [PATCH 3/8] Copy downleveled .d.ts files to dist/types/ --- build/downlevel-dts.js | 18 ++++++++++-------- es2018/package.json | 2 +- es6/package.json | 2 +- package.json | 2 +- ponyfill/es2018/package.json | 2 +- ponyfill/es6/package.json | 2 +- ponyfill/package.json | 2 +- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build/downlevel-dts.js b/build/downlevel-dts.js index b1d2bd0..fa5c264 100644 --- a/build/downlevel-dts.js +++ b/build/downlevel-dts.js @@ -5,20 +5,22 @@ const { Project, ts } = require('ts-morph'); const path = require('path'); const project = new Project(); -const inputDir = project.addDirectoryAtPath(path.join(__dirname, '../dist/types/')); +const inputDir = project.addDirectoryAtPath(path.join(__dirname, '../types/')); +const outputDir = project.createDirectory(path.join(__dirname, '../dist/types/')); // Create output directory -const ts36Dir = inputDir.createDirectory('ts3.6'); +const ts36Dir = outputDir.createDirectory('ts3.6'); project.saveSync(); // Down-level all *.d.ts files in input directory const files = inputDir.addSourceFilesAtPaths('*.d.ts'); -for (const f of files) { - // Create copy for TypeScript 3.6+ - f.copyToDirectory(ts36Dir, { overwrite: true }); - downlevelTS36(f); - downlevelTS34(f); - // Original file will be overwritten by down-leveled file when saved +for (const originalFile of files) { + // Create copy for TypeScript 3.6 and higher + originalFile.copyToDirectory(ts36Dir, { overwrite: true }); + // Downlevel and create copy for TypeScript 3.6 and lower + const downlevelFile = originalFile.copyToDirectory(outputDir, { overwrite: true }); + downlevelTS36(downlevelFile); + downlevelTS34(downlevelFile); } project.saveSync(); diff --git a/es2018/package.json b/es2018/package.json index b1ecfaf..878ab2d 100644 --- a/es2018/package.json +++ b/es2018/package.json @@ -3,5 +3,5 @@ "main": "../dist/polyfill.es2018", "browser": "../dist/polyfill.es2018.min.js", "module": "../dist/polyfill.es2018.mjs", - "types": "../types/polyfill.d.ts" + "types": "../dist/types/polyfill.d.ts" } diff --git a/es6/package.json b/es6/package.json index 7c90c45..ebdd02d 100644 --- a/es6/package.json +++ b/es6/package.json @@ -3,5 +3,5 @@ "main": "../dist/polyfill.es6", "browser": "../dist/polyfill.es6.min.js", "module": "../dist/polyfill.es6.mjs", - "types": "../types/polyfill.d.ts" + "types": "../dist/types/polyfill.d.ts" } diff --git a/package.json b/package.json index 8d8473f..f48a13c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/polyfill", "browser": "dist/polyfill.min.js", "module": "dist/polyfill.mjs", - "types": "types/polyfill.d.ts", + "types": "dist/types/polyfill.d.ts", "typesVersions": { ">=3.6": { "dist/types/*": [ diff --git a/ponyfill/es2018/package.json b/ponyfill/es2018/package.json index c2e92ed..3573f34 100644 --- a/ponyfill/es2018/package.json +++ b/ponyfill/es2018/package.json @@ -2,5 +2,5 @@ "name": "web-streams-ponyfill-es2018", "main": "../../dist/ponyfill.es2018", "module": "../../dist/ponyfill.es2018.mjs", - "types": "../../types/ponyfill.d.ts" + "types": "../../dist/types/ponyfill.d.ts" } diff --git a/ponyfill/es6/package.json b/ponyfill/es6/package.json index 46f2cc1..b629e6f 100644 --- a/ponyfill/es6/package.json +++ b/ponyfill/es6/package.json @@ -2,5 +2,5 @@ "name": "web-streams-ponyfill-es6", "main": "../../dist/ponyfill.es6", "module": "../../dist/ponyfill.es6.mjs", - "types": "../../types/ponyfill.d.ts" + "types": "../../dist/types/ponyfill.d.ts" } diff --git a/ponyfill/package.json b/ponyfill/package.json index a9d0bf6..310875e 100644 --- a/ponyfill/package.json +++ b/ponyfill/package.json @@ -2,5 +2,5 @@ "name": "web-streams-ponyfill", "main": "../dist/ponyfill", "module": "../dist/ponyfill.mjs", - "types": "../types/ponyfill.d.ts" + "types": "../dist/types/ponyfill.d.ts" } From d9eef9f73a96f51f1ad64c74f0d32390cc8d7648 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 18:02:59 +0100 Subject: [PATCH 4/8] Let downlevel-dts do most of the heavy lifting --- .gitignore | 3 +- .idea/web-streams-polyfill.iml | 1 + api-extractor.json | 7 +- build/downlevel-dts.js | 53 +------------ {types => dist/types/ts3.6}/polyfill.d.ts | 0 package-lock.json | 95 +++++++++++++++++++++++ package.json | 11 +-- test/types/polyfill.ts | 2 +- 8 files changed, 111 insertions(+), 61 deletions(-) rename {types => dist/types/ts3.6}/polyfill.d.ts (100%) diff --git a/.gitignore b/.gitignore index a4537c4..e6077b0 100644 --- a/.gitignore +++ b/.gitignore @@ -137,7 +137,6 @@ typings/ ### Project /dist/ +!/dist/types/ts3.6/polyfill.d.ts /lib/ /temp/ -/types/ponyfill.d.ts -/types/tsdoc-metadata.json diff --git a/.idea/web-streams-polyfill.iml b/.idea/web-streams-polyfill.iml index 9e9e597..c9aa0ae 100644 --- a/.idea/web-streams-polyfill.iml +++ b/.idea/web-streams-polyfill.iml @@ -9,6 +9,7 @@ + diff --git a/api-extractor.json b/api-extractor.json index edaf59a..44c283d 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -195,7 +195,7 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "/dist/.d.ts" */ - "untrimmedFilePath": "/types/ponyfill.d.ts", + "untrimmedFilePath": "/dist/types/ts3.6/ponyfill.d.ts", /** * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. @@ -242,7 +242,7 @@ * * DEFAULT VALUE: true */ - // "enabled": true, + "enabled": true, /** * Specifies where the TSDoc metadata file should be written. * @@ -256,9 +256,8 @@ * SUPPORTED TOKENS: , , * DEFAULT VALUE: "" */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + "tsdocMetadataFilePath": "/dist/types/tsdoc-metadata.json" }, - /** * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. diff --git a/build/downlevel-dts.js b/build/downlevel-dts.js index fa5c264..cb0f936 100644 --- a/build/downlevel-dts.js +++ b/build/downlevel-dts.js @@ -1,64 +1,19 @@ // Based on downlevel-dts (MIT licensed) by Nathan Shively-Sanders // https://github.com/sandersn/downlevel-dts/blob/e7d1cb5aced5686826fe8aac4d4af2f745a9ef60/index.js -const { Project, ts } = require('ts-morph'); +const { Project } = require('ts-morph'); const path = require('path'); const project = new Project(); -const inputDir = project.addDirectoryAtPath(path.join(__dirname, '../types/')); -const outputDir = project.createDirectory(path.join(__dirname, '../dist/types/')); - -// Create output directory -const ts36Dir = outputDir.createDirectory('ts3.6'); -project.saveSync(); +const inputDir = project.addDirectoryAtPath(path.join(__dirname, '../dist/types/')); // Down-level all *.d.ts files in input directory const files = inputDir.addSourceFilesAtPaths('*.d.ts'); -for (const originalFile of files) { - // Create copy for TypeScript 3.6 and higher - originalFile.copyToDirectory(ts36Dir, { overwrite: true }); - // Downlevel and create copy for TypeScript 3.6 and lower - const downlevelFile = originalFile.copyToDirectory(outputDir, { overwrite: true }); - downlevelTS36(downlevelFile); - downlevelTS34(downlevelFile); +for (const file of files) { + downlevelTS34(file); } project.saveSync(); -/** - * Down-level TypeScript 3.6 types in the given source file - */ -function downlevelTS36(f) { - // Replace get/set accessors with (read-only) properties - const gs = f.getDescendantsOfKind(ts.SyntaxKind.GetAccessor); - for (const g of gs) { - const s = g.getSetAccessor(); - const returnTypeNode = g.getReturnTypeNode(); - const returnType = returnTypeNode ? returnTypeNode.getText() : 'any'; - g.getParent().insertProperty(g.getChildIndex(), Object.assign({}, g.getStructure(), { - type: returnType, - isReadonly: !s - })); - g.remove(); - if (s) { - s.remove(); - } - } - const ss = f.getDescendantsOfKind(ts.SyntaxKind.SetAccessor); - for (const s of ss) { - const g = s.getGetAccessor(); - if (!g) { - const firstParam = s.getParameters()[0]; - const firstParamTypeNode = firstParam && firstParam.getTypeNode(); - const firstParamType = firstParamTypeNode ? firstParamTypeNode.getText() : 'any'; - s.getParent().insertProperty(s.getChildIndex(), Object.assign({}, s.getStructure(), { - type: firstParamType, - isReadonly: false - })); - s.remove(); - } - } -} - /** * Down-level TypeScript 3.4 types in the given source file */ diff --git a/types/polyfill.d.ts b/dist/types/ts3.6/polyfill.d.ts similarity index 100% rename from types/polyfill.d.ts rename to dist/types/ts3.6/polyfill.d.ts diff --git a/package-lock.json b/package-lock.json index fe11658..c8b2575 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@typescript-eslint/eslint-plugin": "^6.17.0", "@typescript-eslint/parser": "^6.17.0", "@ungap/promise-all-settled": "^1.1.2", + "downlevel-dts": "^0.11.0", "eslint": "^8.56.0", "jasmine": "^5.1.0", "micromatch": "^4.0.5", @@ -1339,6 +1340,20 @@ "node": ">=12" } }, + "node_modules/downlevel-dts": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/downlevel-dts/-/downlevel-dts-0.11.0.tgz", + "integrity": "sha512-vo835pntK7kzYStk7xUHDifiYJvXxVhUapt85uk2AI94gUUAQX9HNRtrcMHNSc3YHJUEHGbYIGsM99uIbgAtxw==", + "dev": true, + "dependencies": { + "semver": "^7.3.2", + "shelljs": "^0.8.3", + "typescript": "next" + }, + "bin": { + "downlevel-dts": "index.js" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2009,6 +2024,15 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/is-core-module": { "version": "2.13.1", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", @@ -2688,6 +2712,18 @@ "node": ">= 6" } }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/recursive-readdir": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", @@ -2989,6 +3025,65 @@ "node": ">=8" } }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/shelljs/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/shelljs/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/shelljs/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", diff --git a/package.json b/package.json index f48a13c..2532b23 100644 --- a/package.json +++ b/package.json @@ -24,16 +24,16 @@ "lint": "eslint \"src/**/*.ts\"", "build": "npm run build:bundle && npm run build:types", "build:bundle": "rollup -c", - "build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run && node ./build/downlevel-dts.js", - "accept:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run --local && node ./build/downlevel-dts.js", + "build:types": "tsc --project . --emitDeclarationOnly --declarationDir ./lib && api-extractor run", + "accept:types": "npm run build:types -- --local", + "postbuild:types": "downlevel-dts ./dist/types/ts3.6/ ./dist/types/ --to=3.5 && node ./build/downlevel-dts.js", "prepare": "npm run build" }, "files": [ "dist", "es6", "es2018", - "ponyfill", - "types" + "ponyfill" ], "engines": { "node": ">= 8" @@ -61,12 +61,13 @@ "@rollup/plugin-inject": "^5.0.5", "@rollup/plugin-replace": "^5.0.5", "@rollup/plugin-strip": "^3.0.4", - "@rollup/plugin-typescript": "^11.1.5", "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.5", "@types/node": "^18.19.4", "@typescript-eslint/eslint-plugin": "^6.17.0", "@typescript-eslint/parser": "^6.17.0", "@ungap/promise-all-settled": "^1.1.2", + "downlevel-dts": "^0.11.0", "eslint": "^8.56.0", "jasmine": "^5.1.0", "micromatch": "^4.0.5", diff --git a/test/types/polyfill.ts b/test/types/polyfill.ts index 853ce25..1b600bc 100644 --- a/test/types/polyfill.ts +++ b/test/types/polyfill.ts @@ -1,7 +1,7 @@ /* * This test verifies that the polyfill's type definitions correctly augment TypeScript's built-in DOM types. */ -import '../../types/polyfill'; +import '../../dist/types/ts3.6/polyfill'; const readable = new ReadableStream({ // TODO Figure out a way to augment the type of "declare var ReadableStream"? From 5ff8f9e80b3e7cb553ae1552b277e71d29eaa151 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 18:04:37 +0100 Subject: [PATCH 5/8] Add typesVersions to subpackages --- es2018/package.json | 9 ++++++++- es6/package.json | 9 ++++++++- ponyfill/es2018/package.json | 9 ++++++++- ponyfill/es6/package.json | 9 ++++++++- ponyfill/package.json | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/es2018/package.json b/es2018/package.json index 878ab2d..97f8fb1 100644 --- a/es2018/package.json +++ b/es2018/package.json @@ -3,5 +3,12 @@ "main": "../dist/polyfill.es2018", "browser": "../dist/polyfill.es2018.min.js", "module": "../dist/polyfill.es2018.mjs", - "types": "../dist/types/polyfill.d.ts" + "types": "../dist/types/polyfill.d.ts", + "typesVersions": { + ">=3.6": { + "../dist/types/*": [ + "../dist/types/ts3.6/*" + ] + } + } } diff --git a/es6/package.json b/es6/package.json index ebdd02d..ca3909b 100644 --- a/es6/package.json +++ b/es6/package.json @@ -3,5 +3,12 @@ "main": "../dist/polyfill.es6", "browser": "../dist/polyfill.es6.min.js", "module": "../dist/polyfill.es6.mjs", - "types": "../dist/types/polyfill.d.ts" + "types": "../dist/types/polyfill.d.ts", + "typesVersions": { + ">=3.6": { + "../dist/types/*": [ + "../dist/types/ts3.6/*" + ] + } + } } diff --git a/ponyfill/es2018/package.json b/ponyfill/es2018/package.json index 3573f34..26816ac 100644 --- a/ponyfill/es2018/package.json +++ b/ponyfill/es2018/package.json @@ -2,5 +2,12 @@ "name": "web-streams-ponyfill-es2018", "main": "../../dist/ponyfill.es2018", "module": "../../dist/ponyfill.es2018.mjs", - "types": "../../dist/types/ponyfill.d.ts" + "types": "../../dist/types/ponyfill.d.ts", + "typesVersions": { + ">=3.6": { + "../../dist/types/*": [ + "../../dist/types/ts3.6/*" + ] + } + } } diff --git a/ponyfill/es6/package.json b/ponyfill/es6/package.json index b629e6f..b54520d 100644 --- a/ponyfill/es6/package.json +++ b/ponyfill/es6/package.json @@ -2,5 +2,12 @@ "name": "web-streams-ponyfill-es6", "main": "../../dist/ponyfill.es6", "module": "../../dist/ponyfill.es6.mjs", - "types": "../../dist/types/ponyfill.d.ts" + "types": "../../dist/types/ponyfill.d.ts", + "typesVersions": { + ">=3.6": { + "../../dist/types/*": [ + "../../dist/types/ts3.6/*" + ] + } + } } diff --git a/ponyfill/package.json b/ponyfill/package.json index 310875e..36e9fbe 100644 --- a/ponyfill/package.json +++ b/ponyfill/package.json @@ -2,5 +2,12 @@ "name": "web-streams-ponyfill", "main": "../dist/ponyfill", "module": "../dist/ponyfill.mjs", - "types": "../dist/types/ponyfill.d.ts" + "types": "../dist/types/ponyfill.d.ts", + "typesVersions": { + ">=3.6": { + "../dist/types/*": [ + "../dist/types/ts3.6/*" + ] + } + } } From 4cf7554955d8d983ca45dd653a4aa980ef46c5de Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 18:08:49 +0100 Subject: [PATCH 6/8] Update changelog --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c14b3f..2b00fed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,17 @@ > - 🏠 Internal > - 💅 Polish +## Unreleased + +* 🐛 Revert `engines` bump in `package.json`. ([#137](https://github.com/MattiasBuelens/web-streams-polyfill/issues/137), [#138](https://github.com/MattiasBuelens/web-streams-polyfill/pull/138)) +* 🐛 Re-introduce support for TypeScript 3.6 and below. ([#137](https://github.com/MattiasBuelens/web-streams-polyfill/issues/137), [#138](https://github.com/MattiasBuelens/web-streams-polyfill/pull/138)) + ## 3.3.0 (2024-01-04) * 🚀 Added global augmentations for `ReadableStream` to the polyfill's type definitions. ([#130](https://github.com/MattiasBuelens/web-streams-polyfill/pull/130)) * This allows TypeScript users to use new methods such as `ReadableStream.prototype[Symbol.asyncIterator]()`, even when TypeScript doesn't yet have a built-in type definition for them. -* 💥 The type definitions now require TypeScript 3.5 or higher. ([#130](https://github.com/MattiasBuelens/web-streams-polyfill/pull/130)) +* ~~💥 The type definitions now require TypeScript 3.6 or higher. ([#130](https://github.com/MattiasBuelens/web-streams-polyfill/pull/130))~~ (Reverted in version 3.3.1) * 👓 Align with [spec version `4dc123a`](https://github.com/whatwg/streams/tree/4dc123a6e7f7ba89a8c6a7975b021156f39cab52/) ([#115](https://github.com/MattiasBuelens/web-streams-polyfill/issues/115), [#134](https://github.com/MattiasBuelens/web-streams-polyfill/pull/134)) * Added `ReadableStream.from(asyncIterable)`, which creates a `ReadableStream` wrapping the given iterable or async iterable. This can also be used to wrap a native `ReadableStream` (e.g. a `Response.body` from `fetch()`), From 604ab9e5fc6f1c9d100f0e633398b9011d1d5a1f Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 18:09:55 +0100 Subject: [PATCH 7/8] Fix package lock --- package-lock.json | 170 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/package-lock.json b/package-lock.json index c8b2575..88628f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -525,6 +525,162 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz", + "integrity": "sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz", + "integrity": "sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz", + "integrity": "sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz", + "integrity": "sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz", + "integrity": "sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz", + "integrity": "sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz", + "integrity": "sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz", + "integrity": "sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz", + "integrity": "sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz", + "integrity": "sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz", + "integrity": "sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz", + "integrity": "sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rollup/rollup-win32-x64-msvc": { "version": "4.9.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz", @@ -1774,6 +1930,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", From e1c7284950f18ff853c079130cfb8b08cdfb30e9 Mon Sep 17 00:00:00 2001 From: Mattias Buelens Date: Thu, 4 Jan 2024 18:14:40 +0100 Subject: [PATCH 8/8] Fix type tests --- test/types/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/types/tsconfig.json b/test/types/tsconfig.json index d5053ab..c64773e 100644 --- a/test/types/tsconfig.json +++ b/test/types/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "target": "esnext", - "module": "es2015", - "moduleResolution": "node", + "module": "node16", + "moduleResolution": "node16", "strict": true, "noEmit": true, "lib": [