From dc79023fc9da8f1e8518c33920894095ff56e18d Mon Sep 17 00:00:00 2001 From: Alec Helmturner Date: Fri, 2 Jun 2023 01:24:59 -0500 Subject: [PATCH 1/4] chore: add tsconfig chore: update deps --- package-lock.json | 1110 ++++++++++++++++++++++++++++++++++++++++++++- package.json | 17 +- tsconfig.json | 51 +++ 3 files changed, 1176 insertions(+), 2 deletions(-) create mode 100644 tsconfig.json diff --git a/package-lock.json b/package-lock.json index b78475cf2..db6181fbb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,20 @@ "commit-and-tag-version": "bin/cli.js" }, "devDependencies": { + "@types/chai": "^4.3.5", + "@types/conventional-changelog": "^3.1.1", + "@types/conventional-changelog-config-spec": "^2.1.2", + "@types/conventional-changelog-core": "^4.2.2", + "@types/conventional-recommended-bump": "^6.1.0", + "@types/git-semver-tags": "^4.1.1", + "@types/mocha": "^10.0.1", + "@types/mockery": "^1.4.30", + "@types/node": "^20.2.5", + "@types/shelljs": "^0.8.12", + "@types/std-mocks": "^1.0.1", + "@types/yargs": "^17.0.24", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", "chai": "^4.2.0", "eslint": "^8.16.0", "eslint-config-standard": "^17.0.0", @@ -39,7 +53,8 @@ "nyc": "^15.1.0", "shelljs": "^0.8.4", "std-mocks": "^1.0.1", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.0", + "typescript": "^5.1.3" }, "engines": { "node": ">=14" @@ -410,6 +425,30 @@ "node": ">=6.9.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, "node_modules/@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -609,22 +648,430 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "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==", + "dev": true, + "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==", + "dev": true, + "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==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/chai": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "dev": true + }, + "node_modules/@types/conventional-changelog": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog/-/conventional-changelog-3.1.1.tgz", + "integrity": "sha512-+Ei7ZUTHnWseUthn22+MVLQjcQZ0AitqOk/UMl3/3aX5FMPofGeKVn/0HZYabsLN+kCioP3FpBrucrWdcCoMJw==", + "dev": true, + "dependencies": { + "@types/conventional-changelog-core": "*", + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*", + "@types/node": "*" + } + }, + "node_modules/@types/conventional-changelog-config-spec": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.2.tgz", + "integrity": "sha512-Mahx5cJCf5XKmUsLFfCjDzNaa28aNjCkf4L7eyUZXF+d7Yux0vGbcYPPOUIYx/qrCacjB5s7gztMbAyaONVZEA==", + "dev": true, + "dependencies": { + "@types/json-schema": "*" + } + }, + "node_modules/@types/conventional-changelog-core": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz", + "integrity": "sha512-WBdtU4dmCuPTq4p4Xa39BtEqOM7a9uRaLPSpWrca2nHwJcbZ2jkrD7MGb1eHo9Vf3M12Go6j8r6+9G9zW/sG2g==", + "dev": true, + "dependencies": { + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*", + "@types/conventional-recommended-bump": "*", + "@types/git-raw-commits": "*", + "@types/node": "*", + "@types/normalize-package-data": "*" + } + }, + "node_modules/@types/conventional-changelog-writer": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-writer/-/conventional-changelog-writer-4.0.3.tgz", + "integrity": "sha512-fL9tZgn70qjPpKw4Kt44VvXyVJeQfJL6tQObLIOgdqaAzoJokI353ypVBiJA1lgvt3Kpy5dbhm7mjJ6Fz/MxQw==", + "dev": true, + "dependencies": { + "@types/conventional-commits-parser": "*", + "@types/node": "*" + } + }, + "node_modules/@types/conventional-commits-parser": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz", + "integrity": "sha512-aoUKfRQYvGMH+spFpOTX9jO4nZoz9/BKp4hlHPxL3Cj2r2Xj+jEcwlXtFIyZr5uL8bh1nbWynDEYaAota+XqPg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/conventional-recommended-bump": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-AlhJsbzY2W+9xkn44qvEgeJGY6FbQIluPRZawwU2JgJw+o7PYB/yjeuRsJhNZRKto3j71hDj+hQik10w/7bI4Q==", + "dev": true, + "dependencies": { + "@types/conventional-changelog-core": "*", + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*" + } + }, + "node_modules/@types/git-raw-commits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/git-raw-commits/-/git-raw-commits-2.0.1.tgz", + "integrity": "sha512-vE2lbXxqJ0AqMDoP4N6d+WVfbcBla9+z8IL6e+37JNQIwYZCYY0z3J7hdpY8D/VGwFZ0yIYQLcqk8eCnfXsaEg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/git-semver-tags": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-6RrosMDOX0rU233ldLAuF4WbF61S44GeQV56D+sV7SG4ZGEXd43LjIgr87NFsD9cE1Kr+n5NMHFRTFpk4MeNxw==", + "dev": true + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, "node_modules/@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, + "node_modules/@types/mocha": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", + "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", + "dev": true + }, + "node_modules/@types/mockery": { + "version": "1.4.30", + "resolved": "https://registry.npmjs.org/@types/mockery/-/mockery-1.4.30.tgz", + "integrity": "sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==", + "dev": true + }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" }, + "node_modules/@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "dev": true + }, + "node_modules/@types/shelljs": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.12.tgz", + "integrity": "sha512-ZA8U81/gldY+rR5zl/7HSHrG2KDfEb3lzG6uCUDhW1DTQE9yC/VBQ45fXnXq8f3CgInfhZmjtdu/WOUlrXRQUg==", + "dev": true, + "dependencies": { + "@types/glob": "~7.2.0", + "@types/node": "*" + } + }, + "node_modules/@types/std-mocks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/std-mocks/-/std-mocks-1.0.1.tgz", + "integrity": "sha512-pwOrGJ6jnqb1bw9TxrmbbHTI+7ngY8yEEkrTG7lJuwplvFT9XSwOCQC3Zb4E+e6g9yDzrFX+S1ysLZuT/07WYg==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", + "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/type-utils": "5.59.8", + "@typescript-eslint/utils": "5.59.8", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", + "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", + "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", + "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/utils": "5.59.8", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", + "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", + "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", + "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", + "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "5.59.8", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -769,6 +1216,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/array.prototype.flat": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", @@ -1514,6 +1970,27 @@ "node": ">=0.3.1" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dir-glob/node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2301,6 +2778,22 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "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", @@ -2313,6 +2806,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -2740,11 +3242,37 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -3891,6 +4419,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -4133,6 +4683,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -4739,6 +5295,26 @@ "teleport": ">=0.2.0" } }, + "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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -4995,6 +5571,16 @@ "node": ">=4" } }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -5010,6 +5596,29 @@ "url": "https://github.com/sponsors/isaacs" } }, + "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==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -5102,6 +5711,15 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5425,6 +6043,27 @@ "node": ">=4" } }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -5472,6 +6111,19 @@ "is-typedarray": "^1.0.0" } }, + "node_modules/typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uglify-js": { "version": "3.15.5", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.5.tgz", @@ -6058,6 +6710,21 @@ "to-fast-properties": "^2.0.0" } }, + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.3.0" + } + }, + "@eslint-community/regexpp": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.1.tgz", + "integrity": "sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==", + "dev": true + }, "@eslint/eslintrc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.3.0.tgz", @@ -6216,22 +6883,328 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@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==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@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==", + "dev": true + }, + "@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==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@types/chai": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "dev": true + }, + "@types/conventional-changelog": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog/-/conventional-changelog-3.1.1.tgz", + "integrity": "sha512-+Ei7ZUTHnWseUthn22+MVLQjcQZ0AitqOk/UMl3/3aX5FMPofGeKVn/0HZYabsLN+kCioP3FpBrucrWdcCoMJw==", + "dev": true, + "requires": { + "@types/conventional-changelog-core": "*", + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*", + "@types/node": "*" + } + }, + "@types/conventional-changelog-config-spec": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.2.tgz", + "integrity": "sha512-Mahx5cJCf5XKmUsLFfCjDzNaa28aNjCkf4L7eyUZXF+d7Yux0vGbcYPPOUIYx/qrCacjB5s7gztMbAyaONVZEA==", + "dev": true, + "requires": { + "@types/json-schema": "*" + } + }, + "@types/conventional-changelog-core": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-core/-/conventional-changelog-core-4.2.2.tgz", + "integrity": "sha512-WBdtU4dmCuPTq4p4Xa39BtEqOM7a9uRaLPSpWrca2nHwJcbZ2jkrD7MGb1eHo9Vf3M12Go6j8r6+9G9zW/sG2g==", + "dev": true, + "requires": { + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*", + "@types/conventional-recommended-bump": "*", + "@types/git-raw-commits": "*", + "@types/node": "*", + "@types/normalize-package-data": "*" + } + }, + "@types/conventional-changelog-writer": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@types/conventional-changelog-writer/-/conventional-changelog-writer-4.0.3.tgz", + "integrity": "sha512-fL9tZgn70qjPpKw4Kt44VvXyVJeQfJL6tQObLIOgdqaAzoJokI353ypVBiJA1lgvt3Kpy5dbhm7mjJ6Fz/MxQw==", + "dev": true, + "requires": { + "@types/conventional-commits-parser": "*", + "@types/node": "*" + } + }, + "@types/conventional-commits-parser": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/conventional-commits-parser/-/conventional-commits-parser-3.0.3.tgz", + "integrity": "sha512-aoUKfRQYvGMH+spFpOTX9jO4nZoz9/BKp4hlHPxL3Cj2r2Xj+jEcwlXtFIyZr5uL8bh1nbWynDEYaAota+XqPg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/conventional-recommended-bump": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-AlhJsbzY2W+9xkn44qvEgeJGY6FbQIluPRZawwU2JgJw+o7PYB/yjeuRsJhNZRKto3j71hDj+hQik10w/7bI4Q==", + "dev": true, + "requires": { + "@types/conventional-changelog-core": "*", + "@types/conventional-changelog-writer": "*", + "@types/conventional-commits-parser": "*" + } + }, + "@types/git-raw-commits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/git-raw-commits/-/git-raw-commits-2.0.1.tgz", + "integrity": "sha512-vE2lbXxqJ0AqMDoP4N6d+WVfbcBla9+z8IL6e+37JNQIwYZCYY0z3J7hdpY8D/VGwFZ0yIYQLcqk8eCnfXsaEg==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/git-semver-tags": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@types/git-semver-tags/-/git-semver-tags-4.1.1.tgz", + "integrity": "sha512-6RrosMDOX0rU233ldLAuF4WbF61S44GeQV56D+sV7SG4ZGEXd43LjIgr87NFsD9cE1Kr+n5NMHFRTFpk4MeNxw==", + "dev": true + }, + "@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", + "dev": true + }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true + }, "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==" }, + "@types/mocha": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz", + "integrity": "sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==", + "dev": true + }, + "@types/mockery": { + "version": "1.4.30", + "resolved": "https://registry.npmjs.org/@types/mockery/-/mockery-1.4.30.tgz", + "integrity": "sha512-uv53RrNdhbkV/3VmVCtfImfYCWC3GTTRn3R11Whni3EJ+gb178tkZBVNj2edLY5CMrB749dQi+SJkg87jsN8UQ==", + "dev": true + }, + "@types/node": { + "version": "20.2.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", + "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==", + "dev": true + }, "@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==" }, + "@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", + "dev": true + }, + "@types/shelljs": { + "version": "0.8.12", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.12.tgz", + "integrity": "sha512-ZA8U81/gldY+rR5zl/7HSHrG2KDfEb3lzG6uCUDhW1DTQE9yC/VBQ45fXnXq8f3CgInfhZmjtdu/WOUlrXRQUg==", + "dev": true, + "requires": { + "@types/glob": "~7.2.0", + "@types/node": "*" + } + }, + "@types/std-mocks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/std-mocks/-/std-mocks-1.0.1.tgz", + "integrity": "sha512-pwOrGJ6jnqb1bw9TxrmbbHTI+7ngY8yEEkrTG7lJuwplvFT9XSwOCQC3Zb4E+e6g9yDzrFX+S1ysLZuT/07WYg==", + "dev": true + }, + "@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.8.tgz", + "integrity": "sha512-JDMOmhXteJ4WVKOiHXGCoB96ADWg9q7efPWHRViT/f09bA8XOMLAVHHju3l0MkZnG1izaWXYmgvQcUjTRcpShQ==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/type-utils": "5.59.8", + "@typescript-eslint/utils": "5.59.8", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.8.tgz", + "integrity": "sha512-AnR19RjJcpjoeGojmwZtCwBX/RidqDZtzcbG3xHrmz0aHHoOcbWnpDllenRDmDvsV0RQ6+tbb09/kyc+UT9Orw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.8.tgz", + "integrity": "sha512-/w08ndCYI8gxGf+9zKf1vtx/16y8MHrZs5/tnjHhMLNSixuNcJavSX4wAiPf4aS5x41Es9YPCn44MIe4cxIlig==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.8.tgz", + "integrity": "sha512-+5M518uEIHFBy3FnyqZUF3BMP+AXnYn4oyH8RF012+e7/msMY98FhGL5SrN29NQ9xDgvqCgYnsOiKp1VjZ/fpA==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "5.59.8", + "@typescript-eslint/utils": "5.59.8", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.8.tgz", + "integrity": "sha512-+uWuOhBTj/L6awoWIg0BlWy0u9TyFpCHrAuQ5bNfxDaZ1Ppb3mx6tUigc74LHcbHpOHuOTOJrBoAnhdHdaea1w==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.8.tgz", + "integrity": "sha512-Jy/lPSDJGNow14vYu6IrW790p7HIf/SOV1Bb6lZ7NUkLc2iB2Z9elESmsaUtLw8kVqogSbtLH9tut5GCX1RLDg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/visitor-keys": "5.59.8", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.8.tgz", + "integrity": "sha512-Tr65630KysnNn9f9G7ROF3w1b5/7f6QVCJ+WK9nhIocWmx9F+TmCAcglF26Vm7z8KCTwoKcNEBZrhlklla3CKg==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.59.8", + "@typescript-eslint/types": "5.59.8", + "@typescript-eslint/typescript-estree": "5.59.8", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.59.8", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.8.tgz", + "integrity": "sha512-pJhi2ms0x0xgloT7xYabil3SGGlojNNKjK/q6dB3Ey0uJLMjK2UDGJvHieiyJVW/7C3KI+Z4Q3pEHkm4ejA+xQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.59.8", + "eslint-visitor-keys": "^3.3.0" + } + }, "@ungap/promise-all-settled": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", @@ -6343,6 +7316,12 @@ "is-string": "^1.0.7" } }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, "array.prototype.flat": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", @@ -6896,6 +7875,23 @@ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", "dev": true }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } + } + }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -7476,6 +8472,19 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "dev": true, + "requires": { + "@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" + } + }, "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", @@ -7488,6 +8497,15 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -7793,11 +8811,31 @@ "type-fest": "^0.20.2" } }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "handlebars": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", @@ -8621,6 +9659,22 @@ } } }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -8803,6 +9857,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", + "dev": true + }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -9258,6 +10318,12 @@ "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, "quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -9449,6 +10515,12 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -9458,6 +10530,15 @@ "glob": "^7.1.3" } }, + "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==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -9529,6 +10610,12 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9779,6 +10866,21 @@ } } }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -9814,6 +10916,12 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true + }, "uglify-js": { "version": "3.15.5", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.15.5.tgz", diff --git a/package.json b/package.json index 3e0125964..6b4e4e844 100644 --- a/package.json +++ b/package.json @@ -55,6 +55,20 @@ "yargs": "^17.0.0" }, "devDependencies": { + "@types/chai": "^4.3.5", + "@types/conventional-changelog": "^3.1.1", + "@types/conventional-changelog-config-spec": "^2.1.2", + "@types/conventional-changelog-core": "^4.2.2", + "@types/conventional-recommended-bump": "^6.1.0", + "@types/git-semver-tags": "^4.1.1", + "@types/mocha": "^10.0.1", + "@types/mockery": "^1.4.30", + "@types/node": "^20.2.5", + "@types/shelljs": "^0.8.12", + "@types/std-mocks": "^1.0.1", + "@types/yargs": "^17.0.24", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", "chai": "^4.2.0", "eslint": "^8.16.0", "eslint-config-standard": "^17.0.0", @@ -67,6 +81,7 @@ "nyc": "^15.1.0", "shelljs": "^0.8.4", "std-mocks": "^1.0.1", - "strip-ansi": "^6.0.0" + "strip-ansi": "^6.0.0", + "typescript": "^5.1.3" } } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..331f3aa0f --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,51 @@ +{ + "compilerOptions": { + "noEmit": true, + "target": "ES2015", + "lib": [ + "esnext" + ], + "checkJs": true, + "removeComments": true, + "useUnknownInCatchVariables": true, + "allowJs": true, + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true, + "module": "CommonJS", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": false, + "noErrorTruncation": true, + "noUncheckedIndexedAccess": true, + "noFallthroughCasesInSwitch": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "noUnusedLocals": false, + "noUnusedParameters": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "strictBindCallApply": true, + "strictPropertyInitialization": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "baseUrl": ".", + "outDir": "./dist", + "types": [ + "node", + "mocha" + ], + }, + "include": [ + "**/*.js", + "**/*.ts" + ], + "exclude": [ + "node_modules", + "dist" + ], + } From 26773afc5b003df27cd9866b4d823e8e0a1e831a Mon Sep 17 00:00:00 2001 From: Alec Helmturner Date: Fri, 2 Jun 2023 01:49:09 -0500 Subject: [PATCH 2/4] style: add jsdoc types without changing code --- lib/checkpoint.js | 10 ++++++- lib/detect-package-manager.js | 11 +++++++- lib/format-commit-message.js | 5 ++++ lib/lifecycles/commit.js | 14 ++++++++++ lib/print-error.js | 14 +++++++++- lib/run-exec.js | 7 ++++- lib/run-execFile.js | 8 +++++- lib/stringify-package.js | 6 ++++ lib/updaters/types/json.js | 13 +++++++++ lib/updaters/types/plain-text.js | 9 ++++++ lib/write-file.js | 6 ++++ types.d.ts | 47 ++++++++++++++++++++++++++++++++ 12 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 types.d.ts diff --git a/lib/checkpoint.js b/lib/checkpoint.js index c37275b78..74403f5cb 100644 --- a/lib/checkpoint.js +++ b/lib/checkpoint.js @@ -1,7 +1,15 @@ -const chalk = require('chalk') +/**@type {import('chalk').default}*/ +const chalk = /**@type {any}*/(require("chalk")) const figures = require('figures') const util = require('util') +/** + * @param {RuntimeConfig} argv + * @param {string} msg + * @param {string[]} args + * @param {string} [figure] + * @returns {void} + */ module.exports = function (argv, msg, args, figure) { const defaultFigure = argv.dryRun ? chalk.yellow(figures.tick) : chalk.green(figures.tick) if (!argv.silent) { diff --git a/lib/detect-package-manager.js b/lib/detect-package-manager.js index 99680bc2b..1e0896406 100644 --- a/lib/detect-package-manager.js +++ b/lib/detect-package-manager.js @@ -9,6 +9,8 @@ const { resolve } = require('path') /** * Check if a path exists + * @param {string} p + * @returns {Promise} */ async function pathExists (p) { try { @@ -18,7 +20,10 @@ async function pathExists (p) { return false } } - +/** + * @param {string} cwd + * @returns {Promise} + */ function getTypeofLockFile (cwd = '.') { return Promise.all([ pathExists(resolve(cwd, 'yarn.lock')), @@ -39,6 +44,10 @@ function getTypeofLockFile (cwd = '.') { }) } +/** + * @param {string} [cwd] + * @returns {Promise} + */ const detectPMByLockFile = async (cwd) => { const type = await getTypeofLockFile(cwd) if (type) { diff --git a/lib/format-commit-message.js b/lib/format-commit-message.js index a597b5198..dec4be2b8 100644 --- a/lib/format-commit-message.js +++ b/lib/format-commit-message.js @@ -1,3 +1,8 @@ +/** + * @param {string} rawMsg + * @param {string} newVersion + * @returns {string} + */ module.exports = function (rawMsg, newVersion) { const message = String(rawMsg) return message.replace(/{{currentTag}}/g, newVersion) diff --git a/lib/lifecycles/commit.js b/lib/lifecycles/commit.js index 1f56ec632..1794f4ff2 100644 --- a/lib/lifecycles/commit.js +++ b/lib/lifecycles/commit.js @@ -5,6 +5,12 @@ const path = require('path') const runExecFile = require('../run-execFile') const runLifecycleScript = require('../run-lifecycle-script') +/** + * + * @param {RuntimeConfig} args + * @param {string} newVersion + * @returns {Promise} + */ module.exports = async function (args, newVersion) { if (args.skip.commit) return const message = await runLifecycleScript(args, 'precommit') @@ -13,11 +19,19 @@ module.exports = async function (args, newVersion) { await runLifecycleScript(args, 'postcommit') } +/** + * + * @param {RuntimeConfig} args + * @param {string} newVersion + * @returns {Promise} + */ async function execCommit (args, newVersion) { let msg = 'committing %s' + /** @type {string[]} */ let paths = [] const verify = args.verify === false || args.n ? ['--no-verify'] : [] const sign = args.sign ? ['-S'] : [] + /** @type {string[]} */ const toAdd = [] // only start with a pre-populated paths list when CHANGELOG processing is not skipped diff --git a/lib/print-error.js b/lib/print-error.js index 84aaa8257..c667c7768 100644 --- a/lib/print-error.js +++ b/lib/print-error.js @@ -1,5 +1,17 @@ -const chalk = require('chalk') +/**@type {import('chalk').default}*/ +const chalk = /**@type {any}*/(require("chalk")) +/** + * @typedef {'red' | 'blue' | 'green' | 'yellow' | 'cyan' | 'magenta' | 'black' | 'white' | 'gray' | 'grey' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright' | 'bgBlack' | 'bgRed' | 'bgGreen' | 'bgYellow' | 'bgBlue' | 'bgMagenta' | 'bgCyan' | 'bgWhite' | 'bgBlackBright' | 'bgRedBright' | 'bgGreenBright' | 'bgYellowBright' | 'bgBlueBright' | 'bgMagentaBright' | 'bgCyanBright' | 'bgWhiteBright'} Color + * @typedef {'error' | 'warn' | 'info' | 'log' | 'debug'} LogLevel + */ + +/** + * @param {RuntimeConfig} args + * @param {string} msg + * @param {{ level: LogLevel, color: Color }} [opts] + * @returns {void} + */ module.exports = function (args, msg, opts) { if (!args.silent) { opts = Object.assign({ diff --git a/lib/run-exec.js b/lib/run-exec.js index eec2feb3d..efef9ca13 100644 --- a/lib/run-exec.js +++ b/lib/run-exec.js @@ -3,6 +3,11 @@ const printError = require('./print-error') const exec = promisify(require('child_process').exec) +/** + * @param {RuntimeConfig} args + * @param {string} cmd + * @return {Promise} + */ module.exports = async function (args, cmd) { if (args.dryRun) return try { @@ -10,7 +15,7 @@ module.exports = async function (args, cmd) { // If exec returns content in stderr, but no error, print it as a warning if (stderr) printError(args, stderr, { level: 'warn', color: 'yellow' }) return stdout - } catch (error) { + } catch (/** @type {any} */error) { // If exec returns an error, print it and exit with return code 1 printError(args, error.stderr || error.message) throw error diff --git a/lib/run-execFile.js b/lib/run-execFile.js index c0c814d45..c1c32df12 100644 --- a/lib/run-execFile.js +++ b/lib/run-execFile.js @@ -3,6 +3,12 @@ const printError = require('./print-error') const execFile = promisify(require('child_process').execFile) +/** + * @param {RuntimeConfig} args + * @param {string} cmd + * @param {string[]} cmdArgs + * @returns {Promise} + */ module.exports = async function (args, cmd, cmdArgs) { if (args.dryRun) return try { @@ -10,7 +16,7 @@ module.exports = async function (args, cmd, cmdArgs) { // If execFile returns content in stderr, but no error, print it as a warning if (stderr) printError(args, stderr, { level: 'warn', color: 'yellow' }) return stdout - } catch (error) { + } catch (/**@type {any}*/error) { // If execFile returns an error, print it and exit with return code 1 printError(args, error.stderr || error.message) throw error diff --git a/lib/stringify-package.js b/lib/stringify-package.js index 46594cf78..de71f5f14 100644 --- a/lib/stringify-package.js +++ b/lib/stringify-package.js @@ -24,6 +24,12 @@ const DEFAULT_INDENT = 2 const CRLF = '\r\n' const LF = '\n' +/** + * @param {unknown} data + * @param {string | number} [indent] + * @param {string} [newline] + * @returns {string} + */ function stringifyPackage (data, indent, newline) { indent = indent || (indent === 0 ? 0 : DEFAULT_INDENT) const json = JSON.stringify(data, null, indent) diff --git a/lib/updaters/types/json.js b/lib/updaters/types/json.js index e0cba511c..1d11be351 100644 --- a/lib/updaters/types/json.js +++ b/lib/updaters/types/json.js @@ -2,10 +2,19 @@ const stringifyPackage = require('../../stringify-package') const detectIndent = require('detect-indent') const detectNewline = require('detect-newline') +/** + * @param {string} contents + * @returns {string} + */ module.exports.readVersion = function (contents) { return JSON.parse(contents).version } +/** + * @param {string} contents + * @param {string} version + * @returns {string} + */ module.exports.writeVersion = function (contents, version) { const json = JSON.parse(contents) const indent = detectIndent(contents).indent @@ -20,6 +29,10 @@ module.exports.writeVersion = function (contents, version) { return stringifyPackage(json, indent, newline) } +/** + * @param {string} contents + * @returns {boolean} + */ module.exports.isPrivate = function (contents) { return JSON.parse(contents).private } diff --git a/lib/updaters/types/plain-text.js b/lib/updaters/types/plain-text.js index 18bcabed2..2cd0318f8 100644 --- a/lib/updaters/types/plain-text.js +++ b/lib/updaters/types/plain-text.js @@ -1,7 +1,16 @@ +/** + * @param {string} contents + * @returns {string} + */ module.exports.readVersion = function (contents) { return contents } +/** + * @param {string} _contents + * @param {string} version + * @returns {string} + */ module.exports.writeVersion = function (_contents, version) { return version } diff --git a/lib/write-file.js b/lib/write-file.js index b6aaa19f7..354027d8f 100644 --- a/lib/write-file.js +++ b/lib/write-file.js @@ -1,5 +1,11 @@ const fs = require('fs') +/** + * @param {RuntimeConfig} args + * @param {string} filePath + * @param {string} content + * @returns {void} + */ module.exports = function (args, filePath, content) { if (args.dryRun) return fs.writeFileSync(filePath, content, 'utf8') diff --git a/types.d.ts b/types.d.ts new file mode 100644 index 000000000..59a52c88f --- /dev/null +++ b/types.d.ts @@ -0,0 +1,47 @@ +type IgnoreMatcher = { + negated: boolean[]; + rooted: boolean[]; + matchers: RegExp[]; + shouldIgnore: (arg0: string) => boolean; + delimiter: string; +} + +declare module 'dotgitignore' { + interface DotGitIgnoreInstance { + matcher: IgnoreMatcher; + ignore(name: string): boolean; + } + function DotGitIgnore(opts?: import('find-up').Options): DotGitIgnoreInstance; + export default DotGitIgnore; +} + +declare type RuntimeConfig = { + releaseAs: string; + path: string | undefined; + lernaPackage: string | undefined; + dryRun: boolean; + + scripts: { [x: string]: string }; + preset: string; + silent: boolean; + skip: { + tag: boolean; + changelog: boolean; + commit: boolean; + bump: boolean; + }; + tagForce: boolean; + sign: boolean; + tagPrefix: string; + releaseCommitMessageFormat: string; + npmPublishHint: string; + prerelease: string; + verify: boolean; + n: boolean; + infile: string; + commitAll: boolean; + releaseCount: number; + header: string; + verbose: boolean; + }; + From 87ae4978bdcd453d67beb1f0be8c92c39d643b3b Mon Sep 17 00:00:00 2001 From: Alec Helmturner Date: Fri, 2 Jun 2023 02:23:55 -0500 Subject: [PATCH 3/4] chore: lint --- lib/checkpoint.js | 4 ++-- lib/lifecycles/commit.js | 3 +-- lib/print-error.js | 4 ++-- lib/run-execFile.js | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/checkpoint.js b/lib/checkpoint.js index 74403f5cb..79e3ce720 100644 --- a/lib/checkpoint.js +++ b/lib/checkpoint.js @@ -1,5 +1,5 @@ -/**@type {import('chalk').default}*/ -const chalk = /**@type {any}*/(require("chalk")) +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) const figures = require('figures') const util = require('util') diff --git a/lib/lifecycles/commit.js b/lib/lifecycles/commit.js index 1794f4ff2..43749c9c6 100644 --- a/lib/lifecycles/commit.js +++ b/lib/lifecycles/commit.js @@ -6,7 +6,6 @@ const runExecFile = require('../run-execFile') const runLifecycleScript = require('../run-lifecycle-script') /** - * * @param {RuntimeConfig} args * @param {string} newVersion * @returns {Promise} @@ -20,7 +19,7 @@ module.exports = async function (args, newVersion) { } /** - * + * * @param {RuntimeConfig} args * @param {string} newVersion * @returns {Promise} diff --git a/lib/print-error.js b/lib/print-error.js index c667c7768..255c26a1a 100644 --- a/lib/print-error.js +++ b/lib/print-error.js @@ -1,5 +1,5 @@ -/**@type {import('chalk').default}*/ -const chalk = /**@type {any}*/(require("chalk")) +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) /** * @typedef {'red' | 'blue' | 'green' | 'yellow' | 'cyan' | 'magenta' | 'black' | 'white' | 'gray' | 'grey' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright' | 'bgBlack' | 'bgRed' | 'bgGreen' | 'bgYellow' | 'bgBlue' | 'bgMagenta' | 'bgCyan' | 'bgWhite' | 'bgBlackBright' | 'bgRedBright' | 'bgGreenBright' | 'bgYellowBright' | 'bgBlueBright' | 'bgMagentaBright' | 'bgCyanBright' | 'bgWhiteBright'} Color diff --git a/lib/run-execFile.js b/lib/run-execFile.js index c1c32df12..eff9ee9d2 100644 --- a/lib/run-execFile.js +++ b/lib/run-execFile.js @@ -16,7 +16,7 @@ module.exports = async function (args, cmd, cmdArgs) { // If execFile returns content in stderr, but no error, print it as a warning if (stderr) printError(args, stderr, { level: 'warn', color: 'yellow' }) return stdout - } catch (/**@type {any}*/error) { + } catch (/** @type {any} */error) { // If execFile returns an error, print it and exit with return code 1 printError(args, error.stderr || error.message) throw error From b8f30e48cc916d80c993a60a5da676bb0b2dc0e0 Mon Sep 17 00:00:00 2001 From: Alec Helmturner Date: Fri, 2 Jun 2023 02:25:22 -0500 Subject: [PATCH 4/4] chore: add types in files where type errors occur --- lib/configuration.js | 4 +- lib/latest-semver-tag.js | 4 ++ lib/lifecycles/bump.js | 102 ++++++++++++++++++++++++----------- lib/lifecycles/changelog.js | 18 ++++++- lib/lifecycles/tag.js | 18 ++++++- lib/preset-loader.js | 4 ++ lib/run-lifecycle-script.js | 11 +++- lib/updaters/index.js | 42 +++++++++++++-- lib/updaters/types/gradle.js | 9 ++++ 9 files changed, 172 insertions(+), 40 deletions(-) diff --git a/lib/configuration.js b/lib/configuration.js index b73e0b1ca..4426e5177 100644 --- a/lib/configuration.js +++ b/lib/configuration.js @@ -8,7 +8,9 @@ const CONFIGURATION_FILES = [ '.versionrc.json', '.versionrc.js' ] - +/** + * @returns {import('conventional-changelog-config-spec').Config} + */ module.exports.getConfiguration = function () { let config = {} const configPath = findUp.sync(CONFIGURATION_FILES) diff --git a/lib/latest-semver-tag.js b/lib/latest-semver-tag.js index eec93af2b..0014df983 100644 --- a/lib/latest-semver-tag.js +++ b/lib/latest-semver-tag.js @@ -1,6 +1,10 @@ const gitSemverTags = require('git-semver-tags') const semver = require('semver') +/** + * @param {string} [tagPrefix] + * @returns {Promise} + */ module.exports = function (tagPrefix = undefined) { return new Promise((resolve, reject) => { gitSemverTags({ tagPrefix }, function (err, tags) { diff --git a/lib/lifecycles/bump.js b/lib/lifecycles/bump.js index 7758dc6e6..f2fde6c4e 100644 --- a/lib/lifecycles/bump.js +++ b/lib/lifecycles/bump.js @@ -1,19 +1,27 @@ 'use strict' -const chalk = require('chalk') +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) const checkpoint = require('../checkpoint') const conventionalRecommendedBump = require('conventional-recommended-bump') const figures = require('figures') const fs = require('fs') -const DotGitignore = require('dotgitignore') +/** @type {import('dotgitignore').default} */ +const DotGitignore = /** @type {any} */(require('dotgitignore')) const path = require('path') const presetLoader = require('../preset-loader') const runLifecycleScript = require('../run-lifecycle-script') const semver = require('semver') const writeFile = require('../write-file') const { resolveUpdaterObjectFromArgument } = require('../updaters') +/** @type {Object} */ let configsToUpdate = {} +/** + * @typedef {import('semver').ReleaseType} ReleaseType + */ + +/** @type {(args: RuntimeConfig, version: string) => Promise} */ async function Bump (args, version) { // reset the cache of updated config files each // time we perform the version bump step. @@ -22,42 +30,71 @@ async function Bump (args, version) { if (args.skip.bump) return version let newVersion = version await runLifecycleScript(args, 'prerelease') + /** @type {ReleaseType | void | undefined} */ const stdout = await runLifecycleScript(args, 'prebump') if (stdout && stdout.trim().length) args.releaseAs = stdout.trim() const release = await bumpVersion(args.releaseAs, version, args) if (!args.firstRelease) { - const releaseType = getReleaseType(args.prerelease, release.releaseType, version) - const releaseTypeAsVersion = releaseType === 'pre' + release.releaseType ? semver.valid(release.releaseType + '-' + args.prerelease + '.0') : semver.valid(releaseType) - - newVersion = releaseTypeAsVersion || semver.inc(version, releaseType, args.prerelease) + const releaseType = getReleaseType( + args.prerelease, + release.releaseType, + version + ) + const releaseTypeAsVersion = + releaseType === 'pre' + release.releaseType + ? semver.valid(release.releaseType + '-' + args.prerelease + '.0') + : semver.valid(releaseType) + + newVersion = + releaseTypeAsVersion || semver.inc(version, releaseType, args.prerelease) updateConfigs(args, newVersion) } else { - checkpoint(args, 'skip version bump on first release', [], chalk.red(figures.cross)) + checkpoint( + args, + 'skip version bump on first release', + [], + chalk.red(figures.cross) + ) } await runLifecycleScript(args, 'postbump') return newVersion } +/** + * @returns {Object} + */ Bump.getUpdatedConfigs = function () { return configsToUpdate } +/** + * + * @param {string} prerelease + * @param {"major" | "minor" | "patch"} expectedReleaseType + * @param {string} currentVersion + * @returns {ReleaseType} + */ function getReleaseType (prerelease, expectedReleaseType, currentVersion) { if (isString(prerelease)) { if (isInPrerelease(currentVersion)) { - if (shouldContinuePrerelease(currentVersion, expectedReleaseType) || - getTypePriority(getCurrentActiveType(currentVersion)) > getTypePriority(expectedReleaseType) + if ( + shouldContinuePrerelease(currentVersion, expectedReleaseType) || + getTypePriority(getCurrentActiveType(currentVersion)) > + getTypePriority(expectedReleaseType) ) { return 'prerelease' } } - return 'pre' + expectedReleaseType + return /** @type {ReleaseType} */('pre' + expectedReleaseType) } else { return expectedReleaseType } } +/** + * @type {(val: unknown) => val is string} + */ function isString (val) { return typeof val === 'string' } @@ -67,14 +104,15 @@ function isString (val) { * and if it current in-pre-release type is same as expect type, * it should continue the pre-release with the same type * - * @param version - * @param expectType + * @param {string} version + * @param {string} expectType * @return {boolean} */ function shouldContinuePrerelease (version, expectType) { return getCurrentActiveType(version) === expectType } +/** @type {(version: string) => boolean} */ function isInPrerelease (version) { return Array.isArray(semver.prerelease(version)) } @@ -83,9 +121,8 @@ const TypeList = ['major', 'minor', 'patch'].reverse() /** * extract the in-pre-release type in target version - * - * @param version - * @return {string} + * @param {string} version + * @return {string | void} */ function getCurrentActiveType (version) { const typelist = TypeList @@ -100,13 +137,13 @@ function getCurrentActiveType (version) { * calculate the priority of release type, * major - 2, minor - 1, patch - 0 * - * @param type + * @param {string} type * @return {number} */ function getTypePriority (type) { return TypeList.indexOf(type) } - +/** @type {(releaseAs: ReleaseType, currentVersion: string, args: RuntimeConfig) => Promise<{releaseType: ReleaseType}>} */ function bumpVersion (releaseAs, currentVersion, args) { return new Promise((resolve, reject) => { if (releaseAs) { @@ -118,16 +155,21 @@ function bumpVersion (releaseAs, currentVersion, args) { if (typeof presetOptions === 'object') { if (semver.lt(currentVersion, '1.0.0')) presetOptions.preMajor = true } - conventionalRecommendedBump({ - debug: args.verbose && console.info.bind(console, 'conventional-recommended-bump'), - preset: presetOptions, - path: args.path, - tagPrefix: args.tagPrefix, - lernaPackage: args.lernaPackage - }, function (err, release) { - if (err) return reject(err) - else return resolve(release) - }) + conventionalRecommendedBump( + { + debug: + args.verbose && + console.info.bind(console, 'conventional-recommended-bump'), + preset: presetOptions, + path: args.path, + tagPrefix: args.tagPrefix, + lernaPackage: args.lernaPackage + }, + function (err, release) { + if (err) return reject(err) + else return resolve(release) + } + ) } }) } @@ -159,11 +201,7 @@ function updateConfigs (args, newVersion) { 'bumping version in ' + updater.filename + ' from %s to %s', [updater.updater.readVersion(contents), realNewVersion] ) - writeFile( - args, - configPath, - newContents - ) + writeFile(args, configPath, newContents) // flag any config files that we modify the version # for // as having been updated. configsToUpdate[updater.filename] = true diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js index 6d4ba990a..c932b2ce9 100644 --- a/lib/lifecycles/changelog.js +++ b/lib/lifecycles/changelog.js @@ -1,4 +1,5 @@ -const chalk = require('chalk') +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) const checkpoint = require('../checkpoint') const conventionalChangelog = require('conventional-changelog') const fs = require('fs') @@ -7,6 +8,11 @@ const runLifecycleScript = require('../run-lifecycle-script') const writeFile = require('../write-file') const START_OF_LAST_RELEASE_PATTERN = /(^#+ \[?[0-9]+\.[0-9]+\.[0-9]+|} + */ async function Changelog (args, newVersion) { if (args.skip.changelog) return await runLifecycleScript(args, 'prechangelog') @@ -18,6 +24,11 @@ Changelog.START_OF_LAST_RELEASE_PATTERN = START_OF_LAST_RELEASE_PATTERN module.exports = Changelog +/** + * @param {RuntimeConfig} args + * @param {string} newVersion + * @returns {Promise} + */ function outputChangelog (args, newVersion) { return new Promise((resolve, reject) => { createIfMissing(args) @@ -53,7 +64,10 @@ function outputChangelog (args, newVersion) { }) }) } - +/** + * @param {RuntimeConfig} args + * @returns {void} + */ function createIfMissing (args) { try { fs.accessSync(args.infile, fs.F_OK) diff --git a/lib/lifecycles/tag.js b/lib/lifecycles/tag.js index 5093990b8..574633f7a 100644 --- a/lib/lifecycles/tag.js +++ b/lib/lifecycles/tag.js @@ -1,5 +1,6 @@ const bump = require('../lifecycles/bump') -const chalk = require('chalk') +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) const checkpoint = require('../checkpoint') const figures = require('figures') const formatCommitMessage = require('../format-commit-message') @@ -7,6 +8,12 @@ const runExecFile = require('../run-execFile') const runLifecycleScript = require('../run-lifecycle-script') const { detectPMByLockFile } = require('../detect-package-manager') +/** + * @param {RuntimeConfig} args + * @param {boolean} pkgPrivate + * @param {string} newVersion + * @returns {Promise} + */ module.exports = async function (newVersion, pkgPrivate, args) { if (args.skip.tag) return await runLifecycleScript(args, 'pretag') @@ -14,12 +21,21 @@ module.exports = async function (newVersion, pkgPrivate, args) { await runLifecycleScript(args, 'posttag') } +/** + * @returns {Promise} + */ async function detectPublishHint () { const npmClientName = await detectPMByLockFile() const publishCommand = 'publish' return `${npmClientName} ${publishCommand}` } +/** + * @param {string} newVersion + * @param {boolean} pkgPrivate + * @param {RuntimeConfig} args + * @returns {Promise} + */ async function execTag (newVersion, pkgPrivate, args) { const tagOption = [] if (args.sign) { diff --git a/lib/preset-loader.js b/lib/preset-loader.js index a7c077281..032367cff 100644 --- a/lib/preset-loader.js +++ b/lib/preset-loader.js @@ -2,6 +2,10 @@ // describe in: https://github.com/conventional-changelog/conventional-changelog-config-spec const spec = require('conventional-changelog-config-spec') +/** + * @param {RuntimeConfig} args + * @returns {import('conventional-changelog-config-spec').Config} + */ module.exports = (args) => { const defaultPreset = require.resolve('conventional-changelog-conventionalcommits') let preset = args.preset || defaultPreset diff --git a/lib/run-lifecycle-script.js b/lib/run-lifecycle-script.js index a4c88c2e9..e72706d26 100644 --- a/lib/run-lifecycle-script.js +++ b/lib/run-lifecycle-script.js @@ -1,8 +1,17 @@ -const chalk = require('chalk') +/** @type {import('chalk').default} */ +const chalk = /** @type {any} */(require('chalk')) const checkpoint = require('./checkpoint') const figures = require('figures') const runExec = require('./run-exec') +/** @typedef {import('semver').ReleaseType} ReleaseType */ + +/** + * + * @param {RuntimeConfig} args + * @param {string} hookName + * @returns {Promise | Promise | Promise} + */ module.exports = function (args, hookName) { const scripts = args.scripts if (!scripts || !scripts[hookName]) return Promise.resolve() diff --git a/lib/updaters/index.js b/lib/updaters/index.js index 819733010..b9933510c 100644 --- a/lib/updaters/index.js +++ b/lib/updaters/index.js @@ -7,6 +7,19 @@ const updatersByType = { } const PLAIN_TEXT_BUMP_FILES = ['VERSION.txt', 'version.txt'] +/** + * @typedef {Object} Updater + * @property {(contents: string) => string} readVersion + * @property {(contents: string, version: string) => string} writeVersion + * @property {(contents: string) => boolean} [isPrivate] + * + * @typedef {keyof typeof updatersByType} UpdaterType + */ + +/** + * @param {UpdaterType} type + * @returns {Updater} + */ function getUpdaterByType (type) { const updater = updatersByType[type] if (!updater) { @@ -15,6 +28,10 @@ function getUpdaterByType (type) { return updater } +/** + * @param {string} filename + * @returns {Updater} + */ function getUpdaterByFilename (filename) { if (JSON_BUMP_FILES.includes(path.basename(filename))) { return getUpdaterByType('json') @@ -30,6 +47,11 @@ function getUpdaterByFilename (filename) { ) } +/** + * + * @param {string | Updater} updater + * @returns {Updater} + */ function getCustomUpdaterFromPath (updater) { if (typeof updater === 'string') { return require(path.resolve(process.cwd(), updater)) @@ -40,11 +62,15 @@ function getCustomUpdaterFromPath (updater) { ) { return updater } - throw new Error('Updater must be a string path or an object with readVersion and writeVersion methods') + throw new Error( + 'Updater must be a string path or an object with readVersion and writeVersion methods' + ) } /** * Simple check to determine if the object provided is a compatible updater. + * @param {unknown} obj + * @returns {obj is Updater} */ function isValidUpdater (obj) { return ( @@ -54,6 +80,10 @@ function isValidUpdater (obj) { ) } +/** + * @param {unknown} arg + * @returns {Updater | false} + */ module.exports.resolveUpdaterObjectFromArgument = function (arg) { /** * If an Object was not provided, we assume it's the path/filename @@ -78,8 +108,14 @@ module.exports.resolveUpdaterObjectFromArgument = function (arg) { } else { updater.updater = getUpdaterByFilename(updater.filename) } - } catch (err) { - if (err.code !== 'ENOENT') console.warn(`Unable to obtain updater for: ${JSON.stringify(arg)}\n - Error: ${err.message}\n - Skipping...`) + } catch (/** @type {any} */err) { + if (err.code !== 'ENOENT') { + console.warn( + `Unable to obtain updater for: ${JSON.stringify(arg)}\n - Error: ${ + err.message + }\n - Skipping...` + ) + } } } /** diff --git a/lib/updaters/types/gradle.js b/lib/updaters/types/gradle.js index 818922e3f..d0c78942a 100644 --- a/lib/updaters/types/gradle.js +++ b/lib/updaters/types/gradle.js @@ -1,5 +1,9 @@ const versionRegex = /^version\s+=\s+['"]([\d.]+)['"]/m +/** + * @param {string} contents + * @returns {string} + */ module.exports.readVersion = function (contents) { const matches = versionRegex.exec(contents) if (matches === null) { @@ -9,6 +13,11 @@ module.exports.readVersion = function (contents) { return matches[1] } +/** + * @param {string} contents + * @param {string} version + * @returns {string} + */ module.exports.writeVersion = function (contents, version) { return contents.replace(versionRegex, () => { return `version = "${version}"`