diff --git a/openrewrite/package-lock.json b/openrewrite/package-lock.json index 243a79f0..7f6245fc 100644 --- a/openrewrite/package-lock.json +++ b/openrewrite/package-lock.json @@ -24,7 +24,8 @@ "@types/uuid": "^10.0.0", "jest": "^29.7.0", "ts-jest": "^29.2.5", - "ts-node": "^10.9.2" + "ts-node": "^10.9.2", + "ts-stronger-types": "~0.1.8" } }, "node_modules/@ampproject/remapping": { @@ -568,6 +569,18 @@ "node": ">=12" } }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1086,25 +1099,90 @@ "tslib": "2" } }, - "node_modules/@openrewrite/rewrite": { - "resolved": "", - "link": true + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@npmcli/fs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-4.0.0.tgz", + "integrity": "sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==", + "license": "ISC", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/@npmcli/fs/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } }, "node_modules/@openrewrite/rewrite-remote": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@openrewrite/rewrite-remote/-/rewrite-remote-0.5.0.tgz", - "integrity": "sha512-i1v7RdFLwQITehD1FvrvZBFCUM/74fzO9S7RdEvVMaXw/VFFGmfRKywzpXKBjxPSgUuLXQZcR0XgcGMIGdxyTg==", - "license": "Apache-2.0", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@openrewrite/rewrite-remote/-/rewrite-remote-0.5.4.tgz", + "integrity": "sha512-hI+Anrlx/FiDRmU2fhuHpfPW1MGSUzsotFQx2QtcAvx+fIuBsHrsKh8kiW6rvDoe3Di32jZL9se3cXkyJrWDkg==", + "license": "Moderne, Inc. Commercial License", "dependencies": { "@jsonjoy.com/json-pack": "^1.1.0", - "@openrewrite/rewrite": "^0.20.1", "@types/node": "^22.5.4", + "cacache": "^19.0.1", "cbor": "^9.0.2", "deasync": "^0.1.30", - "glob": "^11.0.0", + "fast-glob": "^3.3.2", "uuid": "^10.0.0" } }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1479,6 +1557,18 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/babel-polyfill": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.23.0.tgz", + "integrity": "sha512-0l7mVU+LrQ2X/ZTUq63T5i3VyR2aTgcRTFmBcD6djQ/Fek6q1A9t5u0F4jZVYHzp78jwWAzGfLpAY1b4/I3lfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-runtime": "^6.22.0", + "core-js": "^2.4.0", + "regenerator-runtime": "^0.10.0" + } + }, "node_modules/babel-preset-current-node-syntax": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz", @@ -1523,6 +1613,24 @@ "@babel/core": "^7.0.0" } }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true, + "license": "MIT" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -1551,7 +1659,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -1623,6 +1730,35 @@ "dev": true, "license": "MIT" }, + "node_modules/cacache": { + "version": "19.0.1", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-19.0.1.tgz", + "integrity": "sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==", + "license": "ISC", + "dependencies": { + "@npmcli/fs": "^4.0.0", + "fs-minipass": "^3.0.0", + "glob": "^10.2.2", + "lru-cache": "^10.0.1", + "minipass": "^7.0.3", + "minipass-collect": "^2.0.1", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "p-map": "^7.0.2", + "ssri": "^12.0.0", + "tar": "^7.4.3", + "unique-filename": "^4.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1703,6 +1839,22 @@ "node": ">=10" } }, + "node_modules/chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==", + "dev": true, + "license": "MIT" + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/ci-info": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", @@ -1726,6 +1878,26 @@ "dev": true, "license": "MIT" }, + "node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true, + "license": "ISC" + }, "node_modules/cliui": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", @@ -1854,6 +2026,15 @@ "dev": true, "license": "MIT" }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true, + "license": "MIT" + }, "node_modules/create-jest": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", @@ -1982,6 +2163,16 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dotenv": { + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.6.0.tgz", + "integrity": "sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=10" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -2030,6 +2221,29 @@ "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "license": "MIT" }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2131,6 +2345,37 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2138,6 +2383,15 @@ "dev": true, "license": "MIT" }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -2148,6 +2402,29 @@ "bser": "2.1.1" } }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/figures/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", @@ -2181,7 +2458,6 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -2220,6 +2496,18 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/fs-minipass": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", + "integrity": "sha512-XUBA9XClHbnJWSfBzjkm6RvPsyg3sryZt06BEQoXcF7EK/xpGaQYJgQKDJSUH5SGZ76Y7pFx1QBnXz09rU5Fbw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2296,28 +2584,37 @@ } }, "node_modules/glob": { - "version": "11.0.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", - "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^4.0.1", - "minimatch": "^10.0.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", - "path-scurry": "^2.0.0" + "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -2335,6 +2632,29 @@ "dev": true, "license": "ISC" }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2384,6 +2704,19 @@ "node": ">=10.18" } }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -2408,7 +2741,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.19" @@ -2433,85 +2765,254 @@ "dev": true, "license": "ISC" }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "node_modules/inquirer": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.0.6.tgz", + "integrity": "sha512-thluxTGBXUGb8DuQcvH9/CM/CrcGyB5xUpWc9x6Slqcq1z/hRr2a6KxUpX4ddRfmbe0hg3E4jTvo5833aWz3BA==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "ansi-escapes": "^1.1.0", + "chalk": "^1.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.1", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx": "^4.1.0", + "string-width": "^2.0.0", + "strip-ansi": "^3.0.0", + "through": "^2.3.6" + } }, - "node_modules/is-core-module": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", - "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "node_modules/inquirer/node_modules/ansi-escapes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "integrity": "sha512-wiXutNjDUlNEDWHcYH3jtZUhd3c4/VojassD8zHdHCY13xbZy2XbW+NKQwA0tWGBVzDA9qEzYwfoSsWmviidhw==", "dev": true, "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "dev": true, "license": "MIT", "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/inquirer/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", "dev": true, "license": "MIT", + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, "engines": { - "node": ">=0.12.0" + "node": ">=0.10.0" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/inquirer/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.8.0" } }, - "node_modules/isexe": { + "node_modules/inquirer/node_modules/is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "license": "ISC" - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", "dev": true, - "license": "BSD-3-Clause", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/string-width/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" } }, "node_modules/istanbul-lib-instrument": { @@ -2589,18 +3090,18 @@ } }, "node_modules/jackspeak": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.2.tgz", - "integrity": "sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": "20 || >=22" - }, "funding": { "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, "node_modules/jake": { @@ -3428,6 +3929,13 @@ "node": ">=8" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -3498,11 +4006,19 @@ "dev": true, "license": "MIT" }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -3523,20 +4039,27 @@ } }, "node_modules/minimatch": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", - "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha512-7Wl+Jz+IGWuSdgsQEJ4JunV0si/iMhg42MnQQG6h1R6TNeVenp4U9x5CC5v/gYqz/fENLQITAWXidNtVL0NNbw==", + "dev": true, + "license": "MIT" + }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -3546,6 +4069,106 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/minipass-collect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-2.0.1.tgz", + "integrity": "sha512-D7V8PO9oaz7PWGLbCACuI1qEOsq7UKfLotx/C0Aet43fCUB/wfQ7DYeq2oR/svFJGYDHPr38SHATeaj/ZoKHKw==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-flush/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-flush/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-pipeline/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/minizlib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", + "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "license": "MIT", + "dependencies": { + "minipass": "^7.0.4", + "rimraf": "^5.0.5" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3553,6 +4176,13 @@ "dev": true, "license": "MIT" }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "dev": true, + "license": "ISC" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -3566,6 +4196,27 @@ "integrity": "sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==", "license": "MIT" }, + "node_modules/node-fetch": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.6.3.tgz", + "integrity": "sha512-BDxbhLHXFFFvilHjh9xihcDyPkXQ+kjblxnl82zAX41xUYSNvuRpFRznmldR9+OKu+p+ULZ7hNoyunlLB5ecUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "node_modules/node-fetch/node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -3612,6 +4263,16 @@ "node": ">=8" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -3638,6 +4299,119 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/opencollective": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/opencollective/-/opencollective-1.0.3.tgz", + "integrity": "sha512-YBRI0Qa8+Ui0/STV1qYuPrJm889PT3oCPHMVoL+8Y3nwCffj7PSrB2NlGgrhgBKDujxTjxknHWJ/FiqOsYcIDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "babel-polyfill": "6.23.0", + "chalk": "1.1.3", + "inquirer": "3.0.6", + "minimist": "1.2.0", + "node-fetch": "1.6.3", + "opn": "4.0.2" + }, + "bin": { + "oc": "dist/bin/opencollective.js", + "opencollective": "dist/bin/opencollective.js" + } + }, + "node_modules/opencollective/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/opencollective/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/opencollective/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/opencollective/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/opencollective/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/opencollective/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/opn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "integrity": "sha512-iPBWbPP4OEOzR1xfhpGLDh+ypKBOygunZhM9jBtA7FS5sKjEiMZw0EFb82hnDOmTZX90ZWLoZKUza4cVt8MexA==", + "dev": true, + "license": "MIT", + "dependencies": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -3683,6 +4457,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/p-map": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-7.0.2.tgz", + "integrity": "sha512-z4cYYMMdKHzw4O5UkWJImbZynVIo0lSGTXc7bzB1e/rrDqkgGUNysK/o4bTr+0+xKvvLoTyGqYC4Fgljy9qe1Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -3755,29 +4541,26 @@ "license": "MIT" }, "node_modules/path-scurry": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", - "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^11.0.0", - "minipass": "^7.1.2" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { - "node": "20 || >=22" + "node": ">=16 || 14 >=14.18" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", - "license": "ISC", - "engines": { - "node": "20 || >=22" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" }, "node_modules/picocolors": { "version": "1.1.1", @@ -3790,7 +4573,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -3799,6 +4581,29 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/pirates": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", @@ -3881,6 +4686,26 @@ ], "license": "MIT" }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -3888,6 +4713,20 @@ "dev": true, "license": "MIT" }, + "node_modules/reflect-metadata": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==", + "dev": true, + "license": "MIT" + }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -3949,6 +4788,122 @@ "node": ">=10" } }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor/node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor/node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + "license": "ISC", + "dependencies": { + "glob": "^10.3.7" + }, + "bin": { + "rimraf": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rx": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "integrity": "sha512-CiaiuN6gapkdl+cZUr67W6I8jquN4lkak3vtIsIWCl4XIPP8ffsoyN6/+PuGXnQy8Cu8W2y9Xxh31Rq4M6wUug==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -4037,6 +4992,18 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/ssri": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-12.0.0.tgz", + "integrity": "sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==", + "license": "ISC", + "dependencies": { + "minipass": "^7.0.3" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/stack-utils": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", @@ -4242,6 +5209,32 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -4315,6 +5308,26 @@ "tslib": "^2" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -4326,7 +5339,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -4451,6 +5463,23 @@ "node": ">=0.3.1" } }, + "node_modules/ts-stronger-types": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/ts-stronger-types/-/ts-stronger-types-0.1.8.tgz", + "integrity": "sha512-V6HYvsigwA+49DgFgOsBaBZglJnWbHHl2BRXE0jW/lwtx4loKEeCWZy7xFvWBg+8kaoNS1akxBiuLhc0bm/M8g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "dotenv": "^8.2.0", + "opencollective": "^1.0.3", + "reflect-metadata": "^0.1.13" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ts-stronger-types" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4500,6 +5529,30 @@ "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", "license": "MIT" }, + "node_modules/unique-filename": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-4.0.0.tgz", + "integrity": "sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==", + "license": "ISC", + "dependencies": { + "unique-slug": "^5.0.0" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, + "node_modules/unique-slug": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-5.0.0.tgz", + "integrity": "sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==", + "license": "ISC", + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^18.17.0 || >=20.5.0" + } + }, "node_modules/update-browserslist-db": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz", diff --git a/openrewrite/src/javascript/parser.ts b/openrewrite/src/javascript/parser.ts index 27e93f7e..1ea81eef 100644 --- a/openrewrite/src/javascript/parser.ts +++ b/openrewrite/src/javascript/parser.ts @@ -258,10 +258,11 @@ export class JavaScriptParserVisitor { private mapModifiers(node: ts.VariableDeclarationList | ts.VariableStatement | ts.ClassDeclaration | ts.PropertyDeclaration | ts.FunctionDeclaration | ts.ParameterDeclaration | ts.MethodDeclaration | ts.EnumDeclaration | ts.InterfaceDeclaration - | ts.PropertySignature | ts.ConstructorDeclaration | ts.ModuleDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration | ts.ArrowFunction) { + | ts.PropertySignature | ts.ConstructorDeclaration | ts.ModuleDeclaration | ts.GetAccessorDeclaration | ts.SetAccessorDeclaration + | ts.ArrowFunction | ts.IndexSignatureDeclaration) { if (ts.isVariableStatement(node) || ts.isModuleDeclaration(node) || ts.isClassDeclaration(node) || ts.isEnumDeclaration(node) || ts.isInterfaceDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isParameter(node) - || ts.isMethodDeclaration(node) || ts.isConstructorDeclaration(node) || ts.isArrowFunction(node)) { + || ts.isMethodDeclaration(node) || ts.isConstructorDeclaration(node) || ts.isArrowFunction(node) || ts.isIndexSignatureDeclaration(node)) { return node.modifiers ? node.modifiers?.filter(ts.isModifier).map(this.mapModifier) : []; } else if (ts.isFunctionDeclaration(node)) { return [...node.modifiers ? node.modifiers?.filter(ts.isModifier).map(this.mapModifier) : [], @@ -1128,7 +1129,15 @@ export class JavaScriptParserVisitor { } visitIndexSignature(node: ts.IndexSignatureDeclaration) { - return this.visitUnknown(node); + return new JS.IndexSignatureDeclaration( + randomId(), + this.prefix(node), + Markers.EMPTY, + this.mapModifiers(node), + this.mapCommaSeparatedList(this.getParameterListNodes(node, ts.SyntaxKind.OpenBracketToken)), + this.leftPadded(this.prefix(node.getChildAt(node.getChildren().indexOf(node.type) - 1)), this.convert(node.type)), + this.mapType(node) + ); } visitTypePredicate(node: ts.TypePredicateNode) { @@ -1172,7 +1181,24 @@ export class JavaScriptParserVisitor { } visitTypeLiteral(node: ts.TypeLiteralNode) { - return this.visitUnknown(node); + return new JS.TypeLiteral( + randomId(), + this.prefix(node), + Markers.EMPTY, + new J.Block( + randomId(), + this.prefix(this.findChildNode(node, ts.SyntaxKind.OpenBraceToken)!), + Markers.EMPTY, + this.rightPadded(false, Space.EMPTY), + node.members.map(te => new JRightPadded( + this.convert(te), + (te.getLastToken()?.kind === ts.SyntaxKind.SemicolonToken) || (te.getLastToken()?.kind === ts.SyntaxKind.CommaToken) ? this.prefix(te.getLastToken()!) : Space.EMPTY, + (te.getLastToken()?.kind === ts.SyntaxKind.SemicolonToken) || (te.getLastToken()?.kind === ts.SyntaxKind.CommaToken) ? Markers.build([this.convertToken(te.getLastToken())!]) : Markers.EMPTY + )), + this.prefix(node.getLastToken()!) + ), + this.mapType(node) + ); } visitArrayType(node: ts.ArrayTypeNode) { @@ -1202,7 +1228,13 @@ export class JavaScriptParserVisitor { } visitIntersectionType(node: ts.IntersectionTypeNode) { - return this.visitUnknown(node); + return new JS.Intersection( + randomId(), + this.prefix(node), + Markers.EMPTY, + this.rightPaddedList([...node.types], (n) => this.keywordPrefix(ts.SyntaxKind.AmpersandToken)(n)), + this.mapType(node), + ); } visitConditionalType(node: ts.ConditionalTypeNode) { @@ -2273,10 +2305,10 @@ export class JavaScriptParserVisitor { ); } - private getParameterListNodes(node: ts.SignatureDeclarationBase) { + private getParameterListNodes(node: ts.SignatureDeclarationBase, openToken : ts.SyntaxKind = ts.SyntaxKind.OpenParenToken) { const children = node.getChildren(this.sourceFile); for (let i = 0; i < children.length; i++) { - if (children[i].kind == ts.SyntaxKind.OpenParenToken) { + if (children[i].kind == openToken) { return children.slice(i, i + 3); } } diff --git a/openrewrite/src/javascript/remote/receiver.ts b/openrewrite/src/javascript/remote/receiver.ts index 5765c8d3..6d1630af 100644 --- a/openrewrite/src/javascript/remote/receiver.ts +++ b/openrewrite/src/javascript/remote/receiver.ts @@ -2,7 +2,7 @@ import * as extensions from "./remote_extensions"; import {Checksum, Cursor, FileAttributes, ListUtils, Tree} from '../../core'; import {DetailsReceiver, Receiver, ReceiverContext, ReceiverFactory, ValueType} from '@openrewrite/rewrite-remote'; import {JavaScriptVisitor} from '..'; -import {JS, JsLeftPadded, JsRightPadded, JsContainer, JsSpace, CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration} from '../tree'; +import {JS, JsLeftPadded, JsRightPadded, JsContainer, JsSpace, CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Intersection, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration, TypeLiteral, IndexSignatureDeclaration} from '../tree'; import {Expression, J, JContainer, JLeftPadded, JRightPadded, NameTree, Space, Statement, TypeTree, TypedTree} from "../../java"; import * as Java from "../../java/tree"; @@ -286,6 +286,15 @@ class Visitor extends JavaScriptVisitor { return union; } + public visitIntersection(intersection: Intersection, ctx: ReceiverContext): J { + intersection = intersection.withId(ctx.receiveValue(intersection.id, ValueType.UUID)!); + intersection = intersection.withPrefix(ctx.receiveNode(intersection.prefix, receiveSpace)!); + intersection = intersection.withMarkers(ctx.receiveNode(intersection.markers, ctx.receiveMarkers)!); + intersection = intersection.padding.withTypes(ctx.receiveNodes(intersection.padding.types, receiveRightPaddedTree)!); + intersection = intersection.withType(ctx.receiveValue(intersection.type, ValueType.Object)); + return intersection; + } + public visitVoid(_void: Void, ctx: ReceiverContext): J { _void = _void.withId(ctx.receiveValue(_void.id, ValueType.UUID)!); _void = _void.withPrefix(ctx.receiveNode(_void.prefix, receiveSpace)!); @@ -389,6 +398,26 @@ class Visitor extends JavaScriptVisitor { return functionDeclaration; } + public visitTypeLiteral(typeLiteral: TypeLiteral, ctx: ReceiverContext): J { + typeLiteral = typeLiteral.withId(ctx.receiveValue(typeLiteral.id, ValueType.UUID)!); + typeLiteral = typeLiteral.withPrefix(ctx.receiveNode(typeLiteral.prefix, receiveSpace)!); + typeLiteral = typeLiteral.withMarkers(ctx.receiveNode(typeLiteral.markers, ctx.receiveMarkers)!); + typeLiteral = typeLiteral.withMembers(ctx.receiveNode(typeLiteral.members, ctx.receiveTree)!); + typeLiteral = typeLiteral.withType(ctx.receiveValue(typeLiteral.type, ValueType.Object)); + return typeLiteral; + } + + public visitIndexSignatureDeclaration(indexSignatureDeclaration: IndexSignatureDeclaration, ctx: ReceiverContext): J { + indexSignatureDeclaration = indexSignatureDeclaration.withId(ctx.receiveValue(indexSignatureDeclaration.id, ValueType.UUID)!); + indexSignatureDeclaration = indexSignatureDeclaration.withPrefix(ctx.receiveNode(indexSignatureDeclaration.prefix, receiveSpace)!); + indexSignatureDeclaration = indexSignatureDeclaration.withMarkers(ctx.receiveNode(indexSignatureDeclaration.markers, ctx.receiveMarkers)!); + indexSignatureDeclaration = indexSignatureDeclaration.withModifiers(ctx.receiveNodes(indexSignatureDeclaration.modifiers, ctx.receiveTree)!); + indexSignatureDeclaration = indexSignatureDeclaration.padding.withParameters(ctx.receiveNode(indexSignatureDeclaration.padding.parameters, receiveContainer)!); + indexSignatureDeclaration = indexSignatureDeclaration.padding.withTypeExpression(ctx.receiveNode(indexSignatureDeclaration.padding.typeExpression, receiveLeftPaddedTree)!); + indexSignatureDeclaration = indexSignatureDeclaration.withType(ctx.receiveValue(indexSignatureDeclaration.type, ValueType.Object)); + return indexSignatureDeclaration; + } + public visitAnnotatedType(annotatedType: Java.AnnotatedType, ctx: ReceiverContext): J { annotatedType = annotatedType.withId(ctx.receiveValue(annotatedType.id, ValueType.UUID)!); annotatedType = annotatedType.withPrefix(ctx.receiveNode(annotatedType.prefix, receiveSpace)!); @@ -1343,6 +1372,16 @@ class Factory implements ReceiverFactory { ); } + if (type === "org.openrewrite.javascript.tree.JS$Intersection") { + return new Intersection( + ctx.receiveValue(null, ValueType.UUID)!, + ctx.receiveNode(null, receiveSpace)!, + ctx.receiveNode(null, ctx.receiveMarkers)!, + ctx.receiveNodes(null, receiveRightPaddedTree)!, + ctx.receiveValue(null, ValueType.Object) + ); + } + if (type === "org.openrewrite.javascript.tree.JS$Void") { return new Void( ctx.receiveValue(null, ValueType.UUID)!, @@ -1455,6 +1494,28 @@ class Factory implements ReceiverFactory { ); } + if (type === "org.openrewrite.javascript.tree.JS$TypeLiteral") { + return new TypeLiteral( + ctx.receiveValue(null, ValueType.UUID)!, + ctx.receiveNode(null, receiveSpace)!, + ctx.receiveNode(null, ctx.receiveMarkers)!, + ctx.receiveNode(null, ctx.receiveTree)!, + ctx.receiveValue(null, ValueType.Object) + ); + } + + if (type === "org.openrewrite.javascript.tree.JS$IndexSignatureDeclaration") { + return new IndexSignatureDeclaration( + ctx.receiveValue(null, ValueType.UUID)!, + ctx.receiveNode(null, receiveSpace)!, + ctx.receiveNode(null, ctx.receiveMarkers)!, + ctx.receiveNodes(null, ctx.receiveTree)!, + ctx.receiveNode>(null, receiveContainer)!, + ctx.receiveNode>(null, receiveLeftPaddedTree)!, + ctx.receiveValue(null, ValueType.Object) + ); + } + if (type === "org.openrewrite.java.tree.J$AnnotatedType") { return new Java.AnnotatedType( ctx.receiveValue(null, ValueType.UUID)!, diff --git a/openrewrite/src/javascript/remote/sender.ts b/openrewrite/src/javascript/remote/sender.ts index a563d9a7..44d552c2 100644 --- a/openrewrite/src/javascript/remote/sender.ts +++ b/openrewrite/src/javascript/remote/sender.ts @@ -2,7 +2,7 @@ import * as extensions from "./remote_extensions"; import {Cursor, ListUtils, Tree} from '../../core'; import {Sender, SenderContext, ValueType} from '@openrewrite/rewrite-remote'; import {JavaScriptVisitor} from '..'; -import {JS, JsLeftPadded, JsRightPadded, JsContainer, JsSpace, CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration} from '../tree'; +import {JS, JsLeftPadded, JsRightPadded, JsContainer, JsSpace, CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Intersection, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration, TypeLiteral, IndexSignatureDeclaration} from '../tree'; import {Expression, J, JContainer, JLeftPadded, JRightPadded, Space, Statement} from "../../java"; import * as Java from "../../java/tree"; @@ -281,6 +281,15 @@ class Visitor extends JavaScriptVisitor { return union; } + public visitIntersection(intersection: Intersection, ctx: SenderContext): J { + ctx.sendValue(intersection, v => v.id, ValueType.UUID); + ctx.sendNode(intersection, v => v.prefix, Visitor.sendSpace); + ctx.sendNode(intersection, v => v.markers, ctx.sendMarkers); + ctx.sendNodes(intersection, v => v.padding.types, Visitor.sendRightPadded(ValueType.Tree), t => t.element.id); + ctx.sendTypedValue(intersection, v => v.type, ValueType.Object); + return intersection; + } + public visitVoid(_void: Void, ctx: SenderContext): J { ctx.sendValue(_void, v => v.id, ValueType.UUID); ctx.sendNode(_void, v => v.prefix, Visitor.sendSpace); @@ -384,6 +393,26 @@ class Visitor extends JavaScriptVisitor { return functionDeclaration; } + public visitTypeLiteral(typeLiteral: TypeLiteral, ctx: SenderContext): J { + ctx.sendValue(typeLiteral, v => v.id, ValueType.UUID); + ctx.sendNode(typeLiteral, v => v.prefix, Visitor.sendSpace); + ctx.sendNode(typeLiteral, v => v.markers, ctx.sendMarkers); + ctx.sendNode(typeLiteral, v => v.members, ctx.sendTree); + ctx.sendTypedValue(typeLiteral, v => v.type, ValueType.Object); + return typeLiteral; + } + + public visitIndexSignatureDeclaration(indexSignatureDeclaration: IndexSignatureDeclaration, ctx: SenderContext): J { + ctx.sendValue(indexSignatureDeclaration, v => v.id, ValueType.UUID); + ctx.sendNode(indexSignatureDeclaration, v => v.prefix, Visitor.sendSpace); + ctx.sendNode(indexSignatureDeclaration, v => v.markers, ctx.sendMarkers); + ctx.sendNodes(indexSignatureDeclaration, v => v.modifiers, ctx.sendTree, t => t.id); + ctx.sendNode(indexSignatureDeclaration, v => v.padding.parameters, Visitor.sendContainer(ValueType.Tree)); + ctx.sendNode(indexSignatureDeclaration, v => v.padding.typeExpression, Visitor.sendLeftPadded(ValueType.Tree)); + ctx.sendTypedValue(indexSignatureDeclaration, v => v.type, ValueType.Object); + return indexSignatureDeclaration; + } + public visitAnnotatedType(annotatedType: Java.AnnotatedType, ctx: SenderContext): J { ctx.sendValue(annotatedType, v => v.id, ValueType.UUID); ctx.sendNode(annotatedType, v => v.prefix, Visitor.sendSpace); diff --git a/openrewrite/src/javascript/tree/support_types.ts b/openrewrite/src/javascript/tree/support_types.ts index 1f107a90..49ea9ea1 100644 --- a/openrewrite/src/javascript/tree/support_types.ts +++ b/openrewrite/src/javascript/tree/support_types.ts @@ -224,7 +224,15 @@ export namespace JsSpace { NAMESPACE_DECLARATION_KEYWORD_PREFIX, JSMETHOD_DECLARATION_PREFIX, FUNCTION_DECLARATION_PREFIX, - JSMETHOD_INVOCATION_PREFIX + JSMETHOD_INVOCATION_PREFIX, + INTERSECTION_PREFIX, + TYPE_LITERAL_PREFIX, + TYPE_LITERAL_MEMBERS_PREFIX, + TYPE_LITERAL_MEMBERS_SUFFIX, + INDEX_SIGNATURE_DECLARATION_PREFIX, + INDEX_SIGNATURE_DECLARATION_PARAMETERS_PREFIX, + INDEX_SIGNATURE_DECLARATION_PARAMETERS_SUFFIX, + INDEX_SIGNATURE_DECLARATION_TYPE_EXPRESSION_PREFIX, } } export namespace JsLeftPadded { @@ -245,7 +253,8 @@ export namespace JsLeftPadded { JSMETHOD_DECLARATION_DEFAULT_VALUE, NAMESPACE_DECLARATION_KEYWORD_TYPE, SCOPED_VARIABLE_DECLARATIONS_SCOPE, - JS_IMPORT_SPECIFIER_IMPORT_TYPE + JS_IMPORT_SPECIFIER_IMPORT_TYPE, + INDEX_SIGNATURE_DECLARATION_TYPE_EXPRESSION, } } export namespace JsRightPadded { @@ -260,7 +269,10 @@ export namespace JsRightPadded { UNION_TYPES, JSVARIABLE_DECLARATIONS_VARIABLES, NAMESPACE_DECLARATION_NAME, - JSMETHOD_INVOCATION_SELECT + INTERSECTION_TYPES, + JSMETHOD_INVOCATION_SELECT, + TYPE_LITERAL_MEMBERS, + INDEX_SIGNATURE_DECLARATION_PARAMETERS, } } export namespace JsContainer { @@ -274,6 +286,8 @@ export namespace JsContainer { JSMETHOD_DECLARATION_THROWZ, FUNCTION_DECLARATION_PARAMETERS, JSMETHOD_INVOCATION_TYPE_PARAMETERS, - JSMETHOD_INVOCATION_ARGUMENTS + JSMETHOD_INVOCATION_ARGUMENTS, + TYPE_LITERAL_MEMBERS, + INDEX_SIGNATURE_DECLARATION_PARAMETERS, } } diff --git a/openrewrite/src/javascript/tree/tree.ts b/openrewrite/src/javascript/tree/tree.ts index 39783e8c..8aa79df7 100644 --- a/openrewrite/src/javascript/tree/tree.ts +++ b/openrewrite/src/javascript/tree/tree.ts @@ -4,7 +4,7 @@ import * as extensions from "./extensions"; import {JS, JSMixin, JsLeftPadded, JsRightPadded, JsContainer, JsSpace} from "./support_types"; import {JavaScriptVisitor} from "../visitor"; import {Checksum, Cursor, FileAttributes, LstType, Markers, PrintOutputCapture, PrinterFactory, SourceFile, SourceFileMixin, Tree, TreeVisitor, UUID} from "../../core"; -import {Expression, J, JavaSourceFile, JavaType, JContainer, JLeftPadded, JRightPadded, NameTree, Space, Statement, TypedTree, TypeTree, MethodCall} from "../../java/tree"; +import {Expression, J, JavaSourceFile, JavaType, JContainer, JLeftPadded, JRightPadded, NameTree, Space, Statement, TypedTree, TypeTree, MethodCall, Loop} from "../../java/tree"; import * as Java from "../../java/tree"; @LstType("org.openrewrite.javascript.tree.JS$CompilationUnit") @@ -2333,6 +2333,85 @@ export class Union extends JSMixin(Object) implements Expression, TypeTree { } +@LstType("org.openrewrite.javascript.tree.JS$Intersection") +export class Intersection extends JSMixin(Object) implements Expression, TypeTree { + public constructor(id: UUID, prefix: Space, markers: Markers, types: JRightPadded[], _type: JavaType | null) { + super(); + this._id = id; + this._prefix = prefix; + this._markers = markers; + this._types = types; + this._type = _type; + } + + private readonly _id: UUID; + + public get id(): UUID { + return this._id; + } + + public withId(id: UUID): Intersection { + return id === this._id ? this : new Intersection(id, this._prefix, this._markers, this._types, this._type); + } + + private readonly _prefix: Space; + + public get prefix(): Space { + return this._prefix; + } + + public withPrefix(prefix: Space): Intersection { + return prefix === this._prefix ? this : new Intersection(this._id, prefix, this._markers, this._types, this._type); + } + + private readonly _markers: Markers; + + public get markers(): Markers { + return this._markers; + } + + public withMarkers(markers: Markers): Intersection { + return markers === this._markers ? this : new Intersection(this._id, this._prefix, markers, this._types, this._type); + } + + private readonly _types: JRightPadded[]; + + public get types(): Expression[] { + return JRightPadded.getElements(this._types); + } + + public withTypes(types: Expression[]): Intersection { + return this.padding.withTypes(JRightPadded.withElements(this._types, types)); + } + + private readonly _type: JavaType | null; + + public get type(): JavaType | null { + return this._type; + } + + public withType(_type: JavaType | null): Intersection { + return _type === this._type ? this : new Intersection(this._id, this._prefix, this._markers, this._types, _type); + } + + public acceptJavaScript

(v: JavaScriptVisitor

, p: P): J | null { + return v.visitIntersection(this, p); + } + + get padding() { + const t = this; + return new class { + public get types(): JRightPadded[] { + return t._types; + } + public withTypes(types: JRightPadded[]): Intersection { + return t._types === types ? t : new Intersection(t._id, t._prefix, t._markers, types, t._type); + } + } + } + +} + @LstType("org.openrewrite.javascript.tree.JS$Void") export class Void extends JSMixin(Object) implements Expression, Statement { public constructor(id: UUID, prefix: Space, markers: Markers, expression: Expression) { @@ -3345,3 +3424,177 @@ export class FunctionDeclaration extends JSMixin(Object) implements Statement, E } } + +@LstType("org.openrewrite.javascript.tree.JS$TypeLiteral") +export class TypeLiteral extends JSMixin(Object) implements Expression, TypedTree { + public constructor(id: UUID, prefix: Space, markers: Markers, members: Java.Block, _type: JavaType | null) { + super(); + this._id = id; + this._prefix = prefix; + this._markers = markers; + this._members = members; + this._type = _type; + } + + private readonly _id: UUID; + + public get id(): UUID { + return this._id; + } + + public withId(id: UUID): TypeLiteral { + return id === this._id ? this : new TypeLiteral(id, this._prefix, this._markers, this._members, this._type); + } + + private readonly _prefix: Space; + + public get prefix(): Space { + return this._prefix; + } + + public withPrefix(prefix: Space): TypeLiteral { + return prefix === this._prefix ? this : new TypeLiteral(this._id, prefix, this._markers, this._members, this._type); + } + + private readonly _markers: Markers; + + public get markers(): Markers { + return this._markers; + } + + public withMarkers(markers: Markers): TypeLiteral { + return markers === this._markers ? this : new TypeLiteral(this._id, this._prefix, markers, this._members, this._type); + } + + private readonly _members: Java.Block; + + public get members(): Java.Block { + return this._members; + } + + public withMembers(members: Java.Block): TypeLiteral { + return members === this._members ? this : new TypeLiteral(this._id, this._prefix, this._markers, members, this._type); + } + + private readonly _type: JavaType | null; + + public get type(): JavaType | null { + return this._type; + } + + public withType(_type: JavaType | null): TypeLiteral { + return _type === this._type ? this : new TypeLiteral(this._id, this._prefix, this._markers, this._members, _type); + } + + public acceptJavaScript

(v: JavaScriptVisitor

, p: P): J | null { + return v.visitTypeLiteral(this, p); + } + +} + +@LstType("org.openrewrite.javascript.tree.JS$IndexSignatureDeclaration") +export class IndexSignatureDeclaration extends JSMixin(Object) implements Statement, TypedTree { + public constructor(id: UUID, prefix: Space, markers: Markers, modifiers: Java.Modifier[], parameters: JContainer, typeExpression: JLeftPadded, _type: JavaType | null) { + super(); + this._id = id; + this._prefix = prefix; + this._markers = markers; + this._modifiers = modifiers; + this._parameters = parameters; + this._typeExpression = typeExpression; + this._type = _type; + } + + private readonly _id: UUID; + + public get id(): UUID { + return this._id; + } + + public withId(id: UUID): IndexSignatureDeclaration { + return id === this._id ? this : new IndexSignatureDeclaration(id, this._prefix, this._markers, this._modifiers, this._parameters, this._typeExpression, this._type); + } + + private readonly _prefix: Space; + + public get prefix(): Space { + return this._prefix; + } + + public withPrefix(prefix: Space): IndexSignatureDeclaration { + return prefix === this._prefix ? this : new IndexSignatureDeclaration(this._id, prefix, this._markers, this._modifiers, this._parameters, this._typeExpression, this._type); + } + + private readonly _markers: Markers; + + public get markers(): Markers { + return this._markers; + } + + public withMarkers(markers: Markers): IndexSignatureDeclaration { + return markers === this._markers ? this : new IndexSignatureDeclaration(this._id, this._prefix, markers, this._modifiers, this._parameters, this._typeExpression, this._type); + } + + private readonly _modifiers: Java.Modifier[]; + + public get modifiers(): Java.Modifier[] { + return this._modifiers; + } + + public withModifiers(modifiers: Java.Modifier[]): IndexSignatureDeclaration { + return modifiers === this._modifiers ? this : new IndexSignatureDeclaration(this._id, this._prefix, this._markers, modifiers, this._parameters, this._typeExpression, this._type); + } + + private readonly _parameters: JContainer; + + public get parameters(): J[] { + return this._parameters.elements; + } + + public withParameters(parameters: J[]): IndexSignatureDeclaration { + return this.padding.withParameters(JContainer.withElements(this._parameters, parameters)); + } + + private readonly _typeExpression: JLeftPadded; + + public get typeExpression(): Expression { + return this._typeExpression.element; + } + + public withTypeExpression(typeExpression: Expression): IndexSignatureDeclaration { + return this.padding.withTypeExpression(this._typeExpression.withElement(typeExpression)); + } + + private readonly _type: JavaType | null; + + public get type(): JavaType | null { + return this._type; + } + + public withType(_type: JavaType | null): IndexSignatureDeclaration { + return _type === this._type ? this : new IndexSignatureDeclaration(this._id, this._prefix, this._markers, this._modifiers, this._parameters, this._typeExpression, _type); + } + + public acceptJavaScript

(v: JavaScriptVisitor

, p: P): J | null { + return v.visitIndexSignatureDeclaration(this, p); + } + + get padding() { + const t = this; + return new class { + public get parameters(): JContainer { + return t._parameters; + } + public withParameters(parameters: JContainer): IndexSignatureDeclaration { + return t._parameters === parameters ? t : new IndexSignatureDeclaration(t._id, t._prefix, t._markers, t._modifiers, parameters, t._typeExpression, t._type); + } + public get typeExpression(): JLeftPadded { + return t._typeExpression; + } + public withTypeExpression(typeExpression: JLeftPadded): IndexSignatureDeclaration { + return t._typeExpression === typeExpression ? t : new IndexSignatureDeclaration(t._id, t._prefix, t._markers, t._modifiers, t._parameters, typeExpression, t._type); + } + } + } + +} diff --git a/openrewrite/src/javascript/visitor.ts b/openrewrite/src/javascript/visitor.ts index 7864cf00..7784441b 100644 --- a/openrewrite/src/javascript/visitor.ts +++ b/openrewrite/src/javascript/visitor.ts @@ -1,7 +1,7 @@ import * as extensions from "./extensions"; import {ListUtils, SourceFile, Tree, TreeVisitor} from "../core"; import {JS, isJavaScript, JsLeftPadded, JsRightPadded, JsContainer, JsSpace} from "./tree"; -import {CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration} from "./tree"; +import {CompilationUnit, Alias, ArrowFunction, Await, DefaultType, Delete, Export, ExpressionStatement, FunctionType, JsImport, JsImportSpecifier, JsBinary, ObjectBindingDeclarations, PropertyAssignment, ScopedVariableDeclarations, StatementExpression, TemplateExpression, Tuple, TypeDeclaration, TypeOf, TypeOperator, Unary, Union, Intersection, Void, Yield, TypeInfo, JSVariableDeclarations, JSMethodDeclaration, JSMethodInvocation, NamespaceDeclaration, FunctionDeclaration, TypeLiteral, IndexSignatureDeclaration} from "./tree"; import {Expression, J, JContainer, JLeftPadded, JRightPadded, Space, Statement} from "../java/tree"; import {JavaVisitor} from "../java"; import * as Java from "../java/tree"; @@ -367,6 +367,19 @@ export class JavaScriptVisitor

extends JavaVisitor

{ return union; } + public visitIntersection(intersection: Intersection, p: P): J | null { + intersection = intersection.withPrefix(this.visitJsSpace(intersection.prefix, JsSpace.Location.INTERSECTION_PREFIX, p)!); + let tempExpression = this.visitExpression(intersection, p) as Expression; + if (!(tempExpression instanceof Intersection)) + { + return tempExpression; + } + intersection = tempExpression as Intersection; + intersection = intersection.withMarkers(this.visitMarkers(intersection.markers, p)); + intersection = intersection.padding.withTypes(ListUtils.map(intersection.padding.types, el => this.visitJsRightPadded(el, JsRightPadded.Location.INTERSECTION_TYPES, p))); + return intersection; + } + public visitVoid(_void: Void, p: P): J | null { _void = _void.withPrefix(this.visitJsSpace(_void.prefix, JsSpace.Location.VOID_PREFIX, p)!); let tempStatement = this.visitStatement(_void, p) as Statement; @@ -521,6 +534,34 @@ export class JavaScriptVisitor

extends JavaVisitor

{ return functionDeclaration; } + public visitTypeLiteral(typeLiteral: TypeLiteral, p: P): J | null { + typeLiteral = typeLiteral.withPrefix(this.visitJsSpace(typeLiteral.prefix, JsSpace.Location.TYPE_LITERAL_PREFIX, p)!); + let tempExpression = this.visitExpression(typeLiteral, p) as Expression; + if (!(tempExpression instanceof TypeLiteral)) + { + return tempExpression; + } + typeLiteral = tempExpression as TypeLiteral; + typeLiteral = typeLiteral.withMarkers(this.visitMarkers(typeLiteral.markers, p)); + typeLiteral = typeLiteral.withMembers(this.visitAndCast(typeLiteral.members, p)!); + return typeLiteral; + } + + public visitIndexSignatureDeclaration(indexSignatureDeclaration: IndexSignatureDeclaration, p: P): J | null { + indexSignatureDeclaration = indexSignatureDeclaration.withPrefix(this.visitJsSpace(indexSignatureDeclaration.prefix, JsSpace.Location.INDEX_SIGNATURE_DECLARATION_PREFIX, p)!); + let tempStatement = this.visitStatement(indexSignatureDeclaration, p) as Statement; + if (!(tempStatement instanceof IndexSignatureDeclaration)) + { + return tempStatement; + } + indexSignatureDeclaration = tempStatement as IndexSignatureDeclaration; + indexSignatureDeclaration = indexSignatureDeclaration.withMarkers(this.visitMarkers(indexSignatureDeclaration.markers, p)); + indexSignatureDeclaration = indexSignatureDeclaration.withModifiers(ListUtils.map(indexSignatureDeclaration.modifiers, el => this.visitAndCast(el, p))); + indexSignatureDeclaration = indexSignatureDeclaration.padding.withParameters(this.visitJsContainer(indexSignatureDeclaration.padding.parameters, JsContainer.Location.INDEX_SIGNATURE_DECLARATION_PARAMETERS, p)!); + indexSignatureDeclaration = indexSignatureDeclaration.padding.withTypeExpression(this.visitJsLeftPadded(indexSignatureDeclaration.padding.typeExpression, JsLeftPadded.Location.INDEX_SIGNATURE_DECLARATION_TYPE_EXPRESSION, p)!); + return indexSignatureDeclaration; + } + public visitJsLeftPadded(left: JLeftPadded | null, loc: JsLeftPadded.Location, p: P): JLeftPadded { return extensions.visitJsLeftPadded(this, left, loc, p); } diff --git a/openrewrite/test/javascript/e2e/google-maps-services-js_files.test.ts b/openrewrite/test/javascript/e2e/google-maps-services-js_files.test.ts index 14e335f3..40103261 100644 --- a/openrewrite/test/javascript/e2e/google-maps-services-js_files.test.ts +++ b/openrewrite/test/javascript/e2e/google-maps-services-js_files.test.ts @@ -262,5 +262,108 @@ describe('google-maps-services-js files tests', () => { `) ); }); + test('adapter.ts', () => { + rewriteRun( + //language=typescript + typeScript(` + /** + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + import { Status } from "./common"; + + import axios from "axios"; + import type { AxiosResponse } from "axios"; + + export function statusToCode(status: Status): number { + switch (status) { + case Status.OK: + case Status.ZERO_RESULTS: { + return 200; + } + case Status.INVALID_REQUEST: + case Status.MAX_ROUTE_LENGTH_EXCEEDED: + case Status.MAX_WAYPOINTS_EXCEEDED: { + return 400; + } + case Status.REQUEST_DENIED: { + return 403; + } + case Status.NOT_FOUND: { + return 404; + } + case Status.OVER_DAILY_LIMIT: + case Status.OVER_QUERY_LIMIT: { + return 429; + } + case Status.UNKNOWN_ERROR: { + return 500; + } + default: { + return 200; + } + } + } + + function settle(resolve, reject, response) { + const validateStatus = response.config.validateStatus; + if (!response.status || !validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject( + new axios.AxiosError( + "Request failed with status code " + response.status, + [axios.AxiosError.ERR_BAD_REQUEST, axios.AxiosError.ERR_BAD_RESPONSE][ + Math.floor(response.status / 100) - 4 + ], + response.config, + response.request, + response + ) + ); + } + } + + export const customAdapter = axios.getAdapter((config) => { + const httpAdapter = axios.getAdapter("http"); + + return new Promise((resolve, reject) => { + httpAdapter(config) + .then((r: AxiosResponse) => { + // unfortunately data is transformed after the adapter + let data = r.data; + if (config.transformResponse) { + const t = Array.isArray(config.transformResponse) + ? config.transformResponse + : [config.transformResponse]; + for (const fn of t) { + data = fn.call(config, data, r.headers, r.status); + } + } + + if (r.status === 200 && data.status) { + r.status = statusToCode(data.status); + } + + settle(resolve, reject, r); + }) + .catch(reject); + }); + }); + `) + ); + }); }); diff --git a/openrewrite/test/javascript/parser/for.test.ts b/openrewrite/test/javascript/parser/for.test.ts index b8050016..531ee446 100644 --- a/openrewrite/test/javascript/parser/for.test.ts +++ b/openrewrite/test/javascript/parser/for.test.ts @@ -103,6 +103,18 @@ describe('for mapping', () => { ); }); + test('for-of with object binding pattern', () => { + rewriteRun( + //language=typescript + typeScript(` + const list : any = []; + for (let {a, b} of list) { + console.log(a); // 4, 5, 6 + } + `) + ); + }); + test('for-of with comments', () => { rewriteRun( //language=typescript diff --git a/openrewrite/test/javascript/parser/interface.test.ts b/openrewrite/test/javascript/parser/interface.test.ts index 0a475a57..3880bf96 100644 --- a/openrewrite/test/javascript/parser/interface.test.ts +++ b/openrewrite/test/javascript/parser/interface.test.ts @@ -351,7 +351,7 @@ describe('interface mapping', () => { ); }); - test.skip('interface with hybrid types', () => { + test('interface with hybrid types', () => { rewriteRun( //language=typescript typeScript(` diff --git a/openrewrite/test/javascript/parser/typeLiteral.test.ts b/openrewrite/test/javascript/parser/typeLiteral.test.ts new file mode 100644 index 00000000..15cbfdea --- /dev/null +++ b/openrewrite/test/javascript/parser/typeLiteral.test.ts @@ -0,0 +1,35 @@ +import {connect, disconnect, rewriteRun, typeScript} from '../testHarness'; + +describe('type literal mapping', () => { + beforeAll(() => connect()); + afterAll(() => disconnect()); + + test('indexed type literal', () => { + rewriteRun( + //language=typescript + typeScript(` + /*1*/ + type/*2*/ OnlyBoolsAndHorses /*3*/ =/*4*/ { /*5*/ + /*6*/ + /*7*/[/*8*/key/*9*/:/*10*/ string/*11*/]/*12*/:/*13*/ boolean/*14*/ |/*15*/ Horse/*16*/; /*17*/ + /*18*/ + }/*19*/; /*20*/ + + const conforms: OnlyBoolsAndHorses = { + del: true, + rodney: false, + }; + `), + //language=typescript + typeScript(` + type test = { + (start: number): string; // Call signature + interval: number; // Property + reset(): void; // Method + [index: number]: string // Indexable + add(): (x: number, y: number) => number; //Function signature + } + `) + ); + }); +}); diff --git a/openrewrite/test/javascript/parser/variableDeclarations.test.ts b/openrewrite/test/javascript/parser/variableDeclarations.test.ts index 0d0ee828..12ff1bdf 100644 --- a/openrewrite/test/javascript/parser/variableDeclarations.test.ts +++ b/openrewrite/test/javascript/parser/variableDeclarations.test.ts @@ -108,9 +108,11 @@ describe('variable declaration mapping', () => { `), //language=typescript typeScript(` - const numbers = []; - const obj = { a: 1, b: 2 }; - ({ a: numbers[0], b: numbers[1] } = obj); + const { + size = "big", + coords = { x: 0, y: 0 }, + radius = 25, + } = {} `), //language=typescript typeScript(` diff --git a/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptReceiver.java b/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptReceiver.java index 4f8f694a..408ae521 100644 --- a/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptReceiver.java +++ b/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptReceiver.java @@ -357,6 +357,16 @@ public JS.Union visitUnion(JS.Union union, ReceiverContext ctx) { return union; } + @Override + public JS.Intersection visitIntersection(JS.Intersection intersection, ReceiverContext ctx) { + intersection = intersection.withId(ctx.receiveNonNullValue(intersection.getId(), UUID.class)); + intersection = intersection.withPrefix(ctx.receiveNonNullNode(intersection.getPrefix(), JavaScriptReceiver::receiveSpace)); + intersection = intersection.withMarkers(ctx.receiveNonNullNode(intersection.getMarkers(), ctx::receiveMarkers)); + intersection = intersection.getPadding().withTypes(ctx.receiveNonNullNodes(intersection.getPadding().getTypes(), JavaScriptReceiver::receiveRightPaddedTree)); + intersection = intersection.withType(ctx.receiveValue(intersection.getType(), JavaType.class)); + return intersection; + } + @Override public JS.Void visitVoid(JS.Void void_, ReceiverContext ctx) { void_ = void_.withId(ctx.receiveNonNullValue(void_.getId(), UUID.class)); @@ -469,6 +479,28 @@ public JS.FunctionDeclaration visitFunctionDeclaration(JS.FunctionDeclaration fu return functionDeclaration; } + @Override + public JS.TypeLiteral visitTypeLiteral(JS.TypeLiteral typeLiteral, ReceiverContext ctx) { + typeLiteral = typeLiteral.withId(ctx.receiveNonNullValue(typeLiteral.getId(), UUID.class)); + typeLiteral = typeLiteral.withPrefix(ctx.receiveNonNullNode(typeLiteral.getPrefix(), JavaScriptReceiver::receiveSpace)); + typeLiteral = typeLiteral.withMarkers(ctx.receiveNonNullNode(typeLiteral.getMarkers(), ctx::receiveMarkers)); + typeLiteral = typeLiteral.withMembers(ctx.receiveNonNullNode(typeLiteral.getMembers(), ctx::receiveTree)); + typeLiteral = typeLiteral.withType(ctx.receiveValue(typeLiteral.getType(), JavaType.class)); + return typeLiteral; + } + + @Override + public JS.IndexSignatureDeclaration visitIndexSignatureDeclaration(JS.IndexSignatureDeclaration indexSignatureDeclaration, ReceiverContext ctx) { + indexSignatureDeclaration = indexSignatureDeclaration.withId(ctx.receiveNonNullValue(indexSignatureDeclaration.getId(), UUID.class)); + indexSignatureDeclaration = indexSignatureDeclaration.withPrefix(ctx.receiveNonNullNode(indexSignatureDeclaration.getPrefix(), JavaScriptReceiver::receiveSpace)); + indexSignatureDeclaration = indexSignatureDeclaration.withMarkers(ctx.receiveNonNullNode(indexSignatureDeclaration.getMarkers(), ctx::receiveMarkers)); + indexSignatureDeclaration = indexSignatureDeclaration.withModifiers(ctx.receiveNonNullNodes(indexSignatureDeclaration.getModifiers(), ctx::receiveTree)); + indexSignatureDeclaration = indexSignatureDeclaration.getPadding().withParameters(ctx.receiveNonNullNode(indexSignatureDeclaration.getPadding().getParameters(), JavaScriptReceiver::receiveContainer)); + indexSignatureDeclaration = indexSignatureDeclaration.getPadding().withTypeExpression(ctx.receiveNonNullNode(indexSignatureDeclaration.getPadding().getTypeExpression(), JavaScriptReceiver::receiveLeftPaddedTree)); + indexSignatureDeclaration = indexSignatureDeclaration.withType(ctx.receiveValue(indexSignatureDeclaration.getType(), JavaType.class)); + return indexSignatureDeclaration; + } + @Override public J.AnnotatedType visitAnnotatedType(J.AnnotatedType annotatedType, ReceiverContext ctx) { annotatedType = annotatedType.withId(ctx.receiveNonNullValue(annotatedType.getId(), UUID.class)); @@ -1453,6 +1485,16 @@ public T create(Class type, ReceiverContext ctx) { ); } + if (type == JS.Intersection.class) { + return (T) new JS.Intersection( + ctx.receiveNonNullValue(null, UUID.class), + ctx.receiveNonNullNode(null, JavaScriptReceiver::receiveSpace), + ctx.receiveNonNullNode(null, ctx::receiveMarkers), + ctx.receiveNonNullNodes(null, JavaScriptReceiver::receiveRightPaddedTree), + ctx.receiveValue(null, JavaType.class) + ); + } + if (type == JS.Void.class) { return (T) new JS.Void( ctx.receiveNonNullValue(null, UUID.class), @@ -1565,6 +1607,28 @@ public T create(Class type, ReceiverContext ctx) { ); } + if (type == JS.TypeLiteral.class) { + return (T) new JS.TypeLiteral( + ctx.receiveNonNullValue(null, UUID.class), + ctx.receiveNonNullNode(null, JavaScriptReceiver::receiveSpace), + ctx.receiveNonNullNode(null, ctx::receiveMarkers), + ctx.receiveNonNullNode(null, ctx::receiveTree), + ctx.receiveValue(null, JavaType.class) + ); + } + + if (type == JS.IndexSignatureDeclaration.class) { + return (T) new JS.IndexSignatureDeclaration( + ctx.receiveNonNullValue(null, UUID.class), + ctx.receiveNonNullNode(null, JavaScriptReceiver::receiveSpace), + ctx.receiveNonNullNode(null, ctx::receiveMarkers), + ctx.receiveNonNullNodes(null, ctx::receiveTree), + ctx.receiveNonNullNode(null, JavaScriptReceiver::receiveContainer), + ctx.receiveNonNullNode(null, JavaScriptReceiver::receiveLeftPaddedTree), + ctx.receiveValue(null, JavaType.class) + ); + } + if (type == J.AnnotatedType.class) { return (T) new J.AnnotatedType( ctx.receiveNonNullValue(null, UUID.class), diff --git a/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptSender.java b/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptSender.java index 18a723cc..b555d09d 100644 --- a/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptSender.java +++ b/rewrite-javascript-remote/src/main/java/org/openrewrite/javascript/remote/JavaScriptSender.java @@ -340,6 +340,16 @@ public JS.Union visitUnion(JS.Union union, SenderContext ctx) { return union; } + @Override + public JS.Intersection visitIntersection(JS.Intersection intersection, SenderContext ctx) { + ctx.sendValue(intersection, JS.Intersection::getId); + ctx.sendNode(intersection, JS.Intersection::getPrefix, JavaScriptSender::sendSpace); + ctx.sendNode(intersection, JS.Intersection::getMarkers, ctx::sendMarkers); + ctx.sendNodes(intersection, e -> e.getPadding().getTypes(), JavaScriptSender::sendRightPadded, e -> e.getElement().getId()); + ctx.sendTypedValue(intersection, JS.Intersection::getType); + return intersection; + } + @Override public JS.Void visitVoid(JS.Void void_, SenderContext ctx) { ctx.sendValue(void_, JS.Void::getId); @@ -452,6 +462,28 @@ public JS.FunctionDeclaration visitFunctionDeclaration(JS.FunctionDeclaration fu return functionDeclaration; } + @Override + public JS.TypeLiteral visitTypeLiteral(JS.TypeLiteral typeLiteral, SenderContext ctx) { + ctx.sendValue(typeLiteral, JS.TypeLiteral::getId); + ctx.sendNode(typeLiteral, JS.TypeLiteral::getPrefix, JavaScriptSender::sendSpace); + ctx.sendNode(typeLiteral, JS.TypeLiteral::getMarkers, ctx::sendMarkers); + ctx.sendNode(typeLiteral, JS.TypeLiteral::getMembers, ctx::sendTree); + ctx.sendTypedValue(typeLiteral, JS.TypeLiteral::getType); + return typeLiteral; + } + + @Override + public JS.IndexSignatureDeclaration visitIndexSignatureDeclaration(JS.IndexSignatureDeclaration indexSignatureDeclaration, SenderContext ctx) { + ctx.sendValue(indexSignatureDeclaration, JS.IndexSignatureDeclaration::getId); + ctx.sendNode(indexSignatureDeclaration, JS.IndexSignatureDeclaration::getPrefix, JavaScriptSender::sendSpace); + ctx.sendNode(indexSignatureDeclaration, JS.IndexSignatureDeclaration::getMarkers, ctx::sendMarkers); + ctx.sendNodes(indexSignatureDeclaration, JS.IndexSignatureDeclaration::getModifiers, ctx::sendTree, Tree::getId); + ctx.sendNode(indexSignatureDeclaration, e -> e.getPadding().getParameters(), JavaScriptSender::sendContainer); + ctx.sendNode(indexSignatureDeclaration, e -> e.getPadding().getTypeExpression(), JavaScriptSender::sendLeftPadded); + ctx.sendTypedValue(indexSignatureDeclaration, JS.IndexSignatureDeclaration::getType); + return indexSignatureDeclaration; + } + @Override public J.AnnotatedType visitAnnotatedType(J.AnnotatedType annotatedType, SenderContext ctx) { ctx.sendValue(annotatedType, J.AnnotatedType::getId); diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/JavaScriptVisitor.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/JavaScriptVisitor.java index 7ad184f8..358e58ff 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/JavaScriptVisitor.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/JavaScriptVisitor.java @@ -479,6 +479,21 @@ public J visitUnion(JS.Union union, P p) { return u; } + public J visitIntersection(JS.Intersection intersection, P p) { + JS.Intersection u = intersection; + u = u.withPrefix(visitSpace(u.getPrefix(), JsSpace.Location.INTERSECTION_PREFIX, p)); + u = u.withMarkers(visitMarkers(u.getMarkers(), p)); + Expression temp = (Expression) visitExpression(u, p); + if (!(temp instanceof JS.Intersection)) { + return temp; + } else { + u = (JS.Intersection) temp; + } + u = u.getPadding().withTypes(ListUtils.map(u.getPadding().getTypes(), t -> visitRightPadded(t, JsRightPadded.Location.INTERSECTION_TYPE, p))); + u = u.withType(visitType(u.getType(), p)); + return u; + } + // TODO: remove me. Requires changes from rewrite-java. @Override public J visitAnnotatedType(J.AnnotatedType annotatedType, P p) { @@ -752,4 +767,41 @@ public J visitFunctionDeclaration(JS.FunctionDeclaration functionDeclaration, P f = f.withType(visitType(f.getType(), p)); return f; } + + public J visitTypeLiteral(JS.TypeLiteral typeLiteral, P p) { + JS.TypeLiteral t = typeLiteral; + t = t.withPrefix(visitSpace(t.getPrefix(), JsSpace.Location.TYPE_LITERAL_PREFIX, p)); + t = t.withMarkers(visitMarkers(t.getMarkers(), p)); + + Expression temp = (Expression) visitExpression(t, p); + if (!(temp instanceof JS.TypeLiteral)) { + return temp; + } else { + t = (JS.TypeLiteral) temp; + } + + t = t.withMembers(Objects.requireNonNull(visitAndCast(t.getMembers(), p))); + t = t.withType(visitType(t.getType(), p)); + return t; + } + + public J visitIndexSignatureDeclaration(JS.IndexSignatureDeclaration indexSignatureDeclaration, P p) { + JS.IndexSignatureDeclaration isd = indexSignatureDeclaration; + isd = isd.withPrefix(visitSpace(isd.getPrefix(), JsSpace.Location.INDEXED_SIGNATURE_DECLARATION_PREFIX, p)); + isd = isd.withMarkers(visitMarkers(isd.getMarkers(), p)); + + Statement temp = (Statement) visitStatement(isd, p); + if (!(temp instanceof JS.IndexSignatureDeclaration)) { + return temp; + } else { + isd = (JS.IndexSignatureDeclaration) temp; + } + + isd = isd.withModifiers(ListUtils.map(isd.getModifiers(), + mod -> mod.withPrefix(visitSpace(mod.getPrefix(), Space.Location.MODIFIER_PREFIX, p)))); + isd = isd.getPadding().withParameters(visitContainer(isd.getPadding().getParameters(), JsContainer.Location.INDEXED_SIGNATURE_DECLARATION_PARAMETERS, p)); + isd = isd.getPadding().withTypeExpression(visitLeftPadded(isd.getPadding().getTypeExpression(), JsLeftPadded.Location.INDEXED_SIGNATURE_DECLARATION_TYPE_EXPRESSION, p)); + isd = isd.withType(visitType(isd.getType(), p)); + return isd; + } } diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java index 9cd0c4af..eff3e4ea 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java @@ -488,6 +488,16 @@ public J visitUnion(JS.Union union, PrintOutputCapture

p) { return union; } + @Override + public J visitIntersection(JS.Intersection intersection, PrintOutputCapture

p) { + beforeSyntax(intersection, JsSpace.Location.INTERSECTION_PREFIX, p); + + visitRightPadded(intersection.getPadding().getTypes(), JsRightPadded.Location.INTERSECTION_TYPE, "&", p); + + afterSyntax(intersection, p); + return intersection; + } + @Override public J visitVoid(JS.Void aVoid, PrintOutputCapture

p) { beforeSyntax(aVoid, JsSpace.Location.VOID_PREFIX, p); @@ -645,6 +655,30 @@ public J visitFunctionDeclaration(JS.FunctionDeclaration functionDeclaration, Pr return functionDeclaration; } + @Override + public J visitTypeLiteral(JS.TypeLiteral tl, PrintOutputCapture

p) { + beforeSyntax(tl, JsSpace.Location.TYPE_LITERAL_PREFIX, p); + + visit(tl.getMembers(), p); + + afterSyntax(tl, p); + return tl; + } + + @Override + public J visitIndexSignatureDeclaration(JS.IndexSignatureDeclaration isd, PrintOutputCapture

p) { + beforeSyntax(isd, JsSpace.Location.INDEXED_SIGNATURE_DECLARATION_PREFIX, p); + + visitContainer("[", isd.getPadding().getParameters(), JsContainer.Location.INDEXED_SIGNATURE_DECLARATION_PARAMETERS, "", "]", p); + + visitLeftPadded(":", isd.getPadding().getTypeExpression(), JsLeftPadded.Location.INDEXED_SIGNATURE_DECLARATION_TYPE_EXPRESSION, p); + + afterSyntax(isd, p); + return isd; + } + + + private class JavaScriptJavaPrinter extends JavaPrinter

{ @Override diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JS.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JS.java index 72bed872..bad5bda8 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JS.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JS.java @@ -2157,6 +2157,81 @@ public JS.Union withTypes(List> types) { } } + @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) + @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) + @RequiredArgsConstructor + @AllArgsConstructor(access = AccessLevel.PRIVATE) + @Data + final class Intersection implements JS, Expression, TypeTree { + + @Nullable + @NonFinal + transient WeakReference padding; + + @With + @EqualsAndHashCode.Include + UUID id; + + @With + Space prefix; + + @With + Markers markers; + + List> types; + + public List getTypes() { + return JRightPadded.getElements(types); + } + + public JS.Intersection withTypes(List types) { + return getPadding().withTypes(JRightPadded.withElements(this.types, types)); + } + + @With + @Nullable + JavaType type; + + @Override + public

J acceptJavaScript(JavaScriptVisitor

v, P p) { + return v.visitIntersection(this, p); + } + + @Transient + @Override + public CoordinateBuilder.Expression getCoordinates() { + return new CoordinateBuilder.Expression(this); + } + + public JS.Intersection.Padding getPadding() { + JS.Intersection.Padding p; + if (this.padding == null) { + p = new JS.Intersection.Padding(this); + this.padding = new WeakReference<>(p); + } else { + p = this.padding.get(); + if (p == null || p.t != this) { + p = new JS.Intersection.Padding(this); + this.padding = new WeakReference<>(p); + } + } + return p; + } + + @RequiredArgsConstructor + public static class Padding { + private final JS.Intersection t; + + public List> getTypes() { + return t.types; + } + + public JS.Intersection withTypes(List> types) { + return t.types == types ? t : new JS.Intersection(t.id, t.prefix, t.markers, types, t.type); + } + } + } + @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) @Data @@ -3028,4 +3103,145 @@ public FunctionDeclaration withParameters(JContainer parameters) { } } } + + + @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) + @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) + @RequiredArgsConstructor + final class TypeLiteral implements JS, Expression, TypedTree { + + @With + @EqualsAndHashCode.Include + @Getter + UUID id; + + @With + @Getter + Space prefix; + + @With + @Getter + Markers markers; + + @With + @Getter + J.Block members; + + @Nullable + @With + @Getter + JavaType type; + + @Override + public

J acceptJavaScript(JavaScriptVisitor

v, P p) { + return v.visitTypeLiteral(this, p); + } + + @Transient + @Override + public CoordinateBuilder.Expression getCoordinates() { + return new CoordinateBuilder.Expression(this); + } + } + + @FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) + @EqualsAndHashCode(callSuper = false, onlyExplicitlyIncluded = true) + @RequiredArgsConstructor + @AllArgsConstructor(access = AccessLevel.PRIVATE) + final class IndexSignatureDeclaration implements JS, Statement, TypedTree { + + @Nullable + @NonFinal + transient WeakReference padding; + + @With + @EqualsAndHashCode.Include + @Getter + UUID id; + + @With + @Getter + Space prefix; + + @With + @Getter + Markers markers; + + @Getter + @With + List modifiers; + + JContainer parameters; + + public List getParameters() { + return parameters.getElements(); + } + + public IndexSignatureDeclaration withParameters(List parameters) { + return getPadding().withParameters(JContainer.withElements(this.parameters, parameters)); + } + + JLeftPadded typeExpression; + + public Expression getTypeExpression() { + return typeExpression.getElement(); + } + + public IndexSignatureDeclaration withTypeExpression(Expression typeExpression) { + return getPadding().withTypeExpression(JLeftPadded.withElement(this.typeExpression, typeExpression)); + } + + @Nullable + @With + @Getter + JavaType type; + + + @Override + public

J acceptJavaScript(JavaScriptVisitor

v, P p) { + return v.visitIndexSignatureDeclaration(this, p); + } + + @Transient + @Override + public CoordinateBuilder.Statement getCoordinates() { + return new CoordinateBuilder.Statement(this); + } + + public IndexSignatureDeclaration.Padding getPadding() { + IndexSignatureDeclaration.Padding p; + if (this.padding == null) { + p = new IndexSignatureDeclaration.Padding(this); + this.padding = new WeakReference<>(p); + } else { + p = this.padding.get(); + if (p == null || p.isd != this) { + p = new IndexSignatureDeclaration.Padding(this); + this.padding = new WeakReference<>(p); + } + } + return p; + } + + @RequiredArgsConstructor + public static class Padding { + private final IndexSignatureDeclaration isd; + + public JContainer getParameters() { + return isd.parameters; + } + + public IndexSignatureDeclaration withParameters(JContainer parameters) { + return isd.parameters == parameters ? isd : new IndexSignatureDeclaration(isd.id, isd.prefix, isd.markers, isd.modifiers, parameters, isd.typeExpression, isd.type); + } + + public JLeftPadded getTypeExpression() { + return isd.typeExpression; + } + + public IndexSignatureDeclaration withTypeExpression(JLeftPadded typeExpression) { + return isd.typeExpression == typeExpression ? isd : new IndexSignatureDeclaration(isd.id, isd.prefix, isd.markers, isd.modifiers, isd.parameters, typeExpression, isd.type); + } + } + } } diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsContainer.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsContainer.java index d259b31a..1e70e7c2 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsContainer.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsContainer.java @@ -28,7 +28,9 @@ public enum Location { TUPLE_ELEMENT(JsSpace.Location.TUPLE_ELEMENT, JsRightPadded.Location.TUPLE_ELEMENT_SUFFIX), JSMETHOD_DECLARATION_PARAMETERS(JsSpace.Location.JSMETHOD_DECLARATION_PARAMETERS, JsRightPadded.Location.JSMETHOD_DECLARATION_PARAMETER), JSTYPE_PARAMETERS(JsSpace.Location.JSTYPE_PARAMETERS, JsRightPadded.Location.JSTYPE_PARAMETER), - JSMETHOD_INVOCATION_ARGUMENTS(JsSpace.Location.JSTYPE_PARAMETERS, JsRightPadded.Location.JSTYPE_PARAMETER) + JSMETHOD_INVOCATION_ARGUMENTS(JsSpace.Location.JSTYPE_PARAMETERS, JsRightPadded.Location.JSTYPE_PARAMETER), + TYPE_LITERAL_MEMBERS(JsSpace.Location.TYPE_LITERAL_MEMBERS_PREFIX, JsRightPadded.Location.TYPE_LITERAL_MEMBERS), + INDEXED_SIGNATURE_DECLARATION_PARAMETERS(JsSpace.Location.INDEXED_SIGNATURE_DECLARATION_PARAMETERS_PREFIX, JsRightPadded.Location.INDEXED_SIGNATURE_DECLARATION_PARAMETERS), ; private final JsSpace.Location beforeLocation; diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsLeftPadded.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsLeftPadded.java index f4295f78..5e3a391c 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsLeftPadded.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsLeftPadded.java @@ -31,6 +31,7 @@ public enum Location { NAMESPACE_DECLARATION_KEYWORD_TYPE(JsSpace.Location.NAMESPACE_DECLARATION_KEYWORD_PREFIX), JS_IMPORT_IMPORT_TYPE(JsSpace.Location.JS_IMPORT_IMPORT_TYPE_PREFIX), JS_IMPORT_SPECIFIER_IMPORT_TYPE(JsSpace.Location.JS_IMPORT_SPECIFIER_IMPORT_TYPE_PREFIX), + INDEXED_SIGNATURE_DECLARATION_TYPE_EXPRESSION(JsSpace.Location.INDEXED_SIGNATURE_DECLARATION_TYPE_EXPRESSION_PREFIX), ; private final JsSpace.Location beforeLocation; diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsRightPadded.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsRightPadded.java index 984efb34..d4e00228 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsRightPadded.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsRightPadded.java @@ -34,11 +34,15 @@ public enum Location { TAG(JsSpace.Location.TAG_SUFFIX), TUPLE_ELEMENT_SUFFIX(JsSpace.Location.TUPLE_ELEMENT_SUFFIX), UNION_TYPE(JsSpace.Location.UNION_TYPE_SUFFIX), + INTERSECTION_TYPE(JsSpace.Location.INTERSECTION_TYPE_SUFFIX), JSNAMED_VARIABLE(JsSpace.Location.JSNAMED_VARIABLE_SUFFIX), NAMESPACE_DECLARATION_NAME(JsSpace.Location.NAMESPACE_DECLARATION_PREFIX), JSMETHOD_DECLARATION_PARAMETER(JsSpace.Location.JSMETHOD_DECLARATION_PARAMETERS), JSMETHOD_SELECT(JsSpace.Location.JSMETHOD_SELECT_SUFFIX), - JSTYPE_PARAMETER(JsSpace.Location.JSTYPE_PARAMETER_SUFFIX); + JSTYPE_PARAMETER(JsSpace.Location.JSTYPE_PARAMETER_SUFFIX), + TYPE_LITERAL_MEMBERS(JsSpace.Location.TYPE_LITERAL_MEMBERS_SUFFIX), + INDEXED_SIGNATURE_DECLARATION_PARAMETERS(JsSpace.Location.INDEXED_SIGNATURE_DECLARATION_PARAMETERS_SUFFIX), + ; private final JsSpace.Location afterLocation; diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsSpace.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsSpace.java index 68a8f419..d00312a5 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsSpace.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/tree/JsSpace.java @@ -68,6 +68,8 @@ public enum Location { TYPE_OPERATOR_PREFIX, UNION_PREFIX, UNION_TYPE_SUFFIX, + INTERSECTION_PREFIX, + INTERSECTION_TYPE_SUFFIX, UNKNOWN_PREFIX, UNKNOWN_SOURCE_PREFIX, VARIABLE_DECLARATION_PREFIX, @@ -89,6 +91,13 @@ public enum Location { JSMETHOD_SELECT_SUFFIX, JSTYPE_PARAMETERS, JSTYPE_PARAMETER_SUFFIX, + TYPE_LITERAL_PREFIX, + TYPE_LITERAL_MEMBERS_PREFIX, + TYPE_LITERAL_MEMBERS_SUFFIX, + INDEXED_SIGNATURE_DECLARATION_PREFIX, + INDEXED_SIGNATURE_DECLARATION_PARAMETERS_PREFIX, + INDEXED_SIGNATURE_DECLARATION_PARAMETERS_SUFFIX, + INDEXED_SIGNATURE_DECLARATION_TYPE_EXPRESSION_PREFIX, } }