From b0ac3775116dc196729a9cd2268d791d739dec47 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 00:43:15 +0000 Subject: [PATCH 1/3] chore(deps): remove hosted-git-info, meow, try-resolve - Parse "owner/repo" from GitHub remote URL with a small regexp instead of hosted-git-info - Use require.resolve instead of deprecated try-resolve - Use node:util parseArgs instead of meow - Keep existing options (--dry-run/-d, --labels/-l, --token, --allow-added-labels/-A, --addReleaseYml, --addReleaseYmlOutputPath) - Also accept camelCase --dryRun/--allowAddedLabels as meow did Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN --- bin/cmd.mjs | 95 ++++++----- package.json | 6 +- pnpm-lock.yaml | 326 +------------------------------------- src/github-label-setup.ts | 33 ++-- 4 files changed, 78 insertions(+), 382 deletions(-) diff --git a/bin/cmd.mjs b/bin/cmd.mjs index 67a4b51..9e759f9 100755 --- a/bin/cmd.mjs +++ b/bin/cmd.mjs @@ -1,24 +1,21 @@ #!/usr/bin/env node 'use strict'; -import meow from "meow"; -import path from "path"; +import { parseArgs } from "node:util"; +import { createRequire } from "node:module"; +import path from "node:path"; import { setupLabels } from "../lib/github-label-setup.js"; import { writeGitHubReleaseYaml } from "../lib/github-release-yml.js"; -/* - { - input: ['unicorns'], - flags: {rainbow: true}, - ... - } - */ -const cli = meow(` +const require = createRequire(import.meta.url); +const pkg = require("../package.json"); +const helpText = ` Usage $ github-label-setup --token xxx Options -h, --help [Boolean] output usage information + --version [Boolean] output the version number -l, --labels [Path:String] the path to look for the label configuration in. Default: labels.json --token [String] a GitHub access token (also settable with a GITHUB_TOKEN or GITHUB_ACCESS_TOKEN environment variable) -d, --dry-run [Boolean] calculate the required label changes but do not apply them @@ -37,48 +34,60 @@ const cli = meow(` # Add .github/release.yml to integrate with GitHub Releases $ github-label-setup --addReleaseYml -`, { - - importMeta: import.meta, - flags: { - dryRun: { - type: 'boolean', - alias: 'd' - }, - token: { - type: "string", - }, - labels: { - type: 'string', - alias: 'l' - }, - allowAddedLabels: { - type: 'boolean', - alias: 'A' - }, - addReleaseYml: { - type: "boolean", - default: false - }, - addReleaseYmlOutputPath: { - type: "string", - default: path.join(process.cwd(), ".github/release.yml") +`; +const showHelp = (exitCode = 2) => { + console.log(helpText); + process.exit(exitCode); +}; + +let values; +try { + ({ values } = parseArgs({ + options: { + help: { type: "boolean", short: "h" }, + version: { type: "boolean" }, + "dry-run": { type: "boolean", short: "d" }, + dryRun: { type: "boolean" }, + token: { type: "string" }, + labels: { type: "string", short: "l" }, + "allow-added-labels": { type: "boolean", short: "A" }, + allowAddedLabels: { type: "boolean" }, + addReleaseYml: { type: "boolean", default: false }, + addReleaseYmlOutputPath: { type: "string", default: path.join(process.cwd(), ".github/release.yml") } } - } -}); + })); +} catch (error) { + console.error(error.message); + showHelp(); +} +if (values.help) { + showHelp(0); +} +if (values.version) { + console.log(pkg.version); + process.exit(0); +} +const flags = { + dryRun: values["dry-run"] ?? values.dryRun, + token: values.token, + labels: values.labels, + allowAddedLabels: values["allow-added-labels"] ?? values.allowAddedLabels, + addReleaseYml: values.addReleaseYml, + addReleaseYmlOutputPath: values.addReleaseYmlOutputPath +}; -if (cli.flags.addReleaseYml) { - const outputPath = cli.flags.addReleaseYmlOutputPath; +if (flags.addReleaseYml) { + const outputPath = flags.addReleaseYmlOutputPath; if (!outputPath) { throw new Error("addReleaseYmlOutputPath must not be empty"); } writeGitHubReleaseYaml(outputPath).catch(function (error) { console.error(error); - cli.showHelp(); + showHelp(); }); } else { - setupLabels(cli.flags).catch(function (error) { + setupLabels(flags).catch(function (error) { console.error(error); - cli.showHelp(); + showHelp(); }); } diff --git a/package.json b/package.json index c2e0dae..a7b0299 100644 --- a/package.json +++ b/package.json @@ -40,14 +40,10 @@ }, "dependencies": { "git-remote-origin-url": "^4.0.0", - "github-label-sync": "^2.3.1", - "hosted-git-info": "^6.1.3", - "meow": "^11.0.0", - "try-resolve": "^1.0.1" + "github-label-sync": "^2.3.1" }, "devDependencies": { "@types/github-label-sync": "^2.3.3", - "@types/hosted-git-info": "^3.0.5", "@types/mocha": "^10.0.10", "@types/node": "^26.6.5", "mocha": "^12.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7a8fee1..80c1675 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,22 +14,10 @@ importers: github-label-sync: specifier: ^2.3.1 version: 2.3.1 - hosted-git-info: - specifier: ^6.1.3 - version: 6.1.3 - meow: - specifier: ^11.0.0 - version: 11.0.0 - try-resolve: - specifier: ^1.0.1 - version: 1.0.1 devDependencies: '@types/github-label-sync': specifier: ^2.3.3 version: 2.3.3 - '@types/hosted-git-info': - specifier: ^3.0.5 - version: 3.0.5 '@types/mocha': specifier: ^10.0.10 version: 10.0.10 @@ -74,7 +62,7 @@ packages: resolution: {integrity: sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==} '@jridgewell/trace-mapping@0.3.9': - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==, tarball: https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz} + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} '@sindresorhus/is@5.6.0': resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} @@ -99,15 +87,9 @@ packages: '@types/github-label-sync@2.3.3': resolution: {integrity: sha512-dyKwb9Tgkb5gBF2dnh7nahzXTYrcKX4VVpp81HyD0qirYZ16lf+ogIme8EuT5S8D+mlAVtCvZ7pvCluHIcY5/A==} - '@types/hosted-git-info@3.0.5': - resolution: {integrity: sha512-Dmngh7U003cOHPhKGyA7LWqrnvcTyILNgNPmNCxlx7j8MIi54iBliiT8XqVLIQ3GchoOjVAyBzNJVyuaJjqokg==} - '@types/http-cache-semantics@4.2.0': resolution: {integrity: sha512-L3LgimLHXtGkWikKnsPg0/VFx9OGZaC+eN1u4r+OB1XRqH3meBIAVC2zr1WdMH+RHmnRkqliQAOHNJ/E0j/e0Q==} - '@types/minimist@1.2.5': - resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} - '@types/mocha@10.0.10': resolution: {integrity: sha512-xPyYSz1cMPnJQhl0CLMH68j3gprKZaTjG3s5Vi+fDgx+uhG9NOXwbVt52eFS8ECyXhyKcjDLCBEqBExKuiZb7Q==} @@ -265,10 +247,6 @@ packages: argparse@3.0.3: resolution: {integrity: sha512-Sn98ftV3KfsO8xfLPHG6oT8y+b0yvbrLgZjgPDXsharNY15tTAjqIsIju4S32nl6/iEUNNE4v+yL2Zhm8ooP3w==} - arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} - asn1@0.2.6: resolution: {integrity: sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==} @@ -310,14 +288,6 @@ packages: resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} engines: {node: '>=14.16'} - camelcase-keys@8.0.2: - resolution: {integrity: sha512-qMKdlOfsjlezMqxkUGGMaWWs17i2HoL15tM+wtx8ld4nLrUwU58TFdvyGOz/piNP842KeO8yXvggVQSdQ828NA==} - engines: {node: '>=14.16'} - - camelcase@7.0.1: - resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} - engines: {node: '>=14.16'} - caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -345,7 +315,7 @@ packages: engines: {node: '>= 6'} core-util-is@1.0.2: - resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==, tarball: https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz} + resolution: {integrity: sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==} create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -363,18 +333,6 @@ packages: supports-color: optional: true - decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - - decamelize@6.0.1: - resolution: {integrity: sha512-G7Cqgaelq68XHJNGlZ7lrNQyhZGsFqpwtGFexqUv4IQdjKoSYF7ipZ9UuTJZUSQXFj/XaoBLuEVIVqr8EJngEQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -434,10 +392,6 @@ packages: resolution: {integrity: sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ==} engines: {node: '>=18'} - find-up@6.3.0: - resolution: {integrity: sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - forever-agent@0.6.1: resolution: {integrity: sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==} @@ -489,10 +443,6 @@ packages: engines: {node: '>=6'} deprecated: this library is no longer supported - hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -504,18 +454,6 @@ packages: hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - hosted-git-info@4.1.0: - resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} - engines: {node: '>=10'} - - hosted-git-info@5.2.1: - resolution: {integrity: sha512-xIcQYMnhcx2Nr4JTjsFmwwnr9vldugPy9uVm0o87bjqqWMv9GaqsTeT+i99wTl0mk1uLxJtHxLb8kymqTENQsw==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - - hosted-git-info@6.1.3: - resolution: {integrity: sha512-HVJyzUrLIL1c0QmviVh5E8VGyUS7xCFPS6yydaVd1UegW+ibV/CohqTH9MkOLDp5o+rb82DMo77PTuc9F/8GKw==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - http-cache-semantics@4.3.0: resolution: {integrity: sha512-M5t5LlJpS1UHMjvwRQVdFHvPISGeLAxNcrWuJkeGh0KxsqCHZ1O3NXZU/8x7cD0BDcGW8kapxMKTvwlqrNkHkA==} @@ -527,10 +465,6 @@ packages: resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} engines: {node: '>=10.19.0'} - indent-string@5.0.0: - resolution: {integrity: sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==} - engines: {node: '>=12'} - ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} @@ -545,10 +479,6 @@ packages: resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} engines: {node: '>=12'} - is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - is-typedarray@1.0.0: resolution: {integrity: sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==} @@ -578,7 +508,7 @@ packages: resolution: {integrity: sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==} json-buffer@3.0.1: - resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==, tarball: https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz} + resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} @@ -602,17 +532,9 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - kind-of@6.0.3: - resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} - engines: {node: '>=0.10.0'} - lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - locate-path@7.2.0: - resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - lowercase-keys@3.0.0: resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -621,29 +543,9 @@ packages: resolution: {integrity: sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==} engines: {node: 20 || >=22} - lru-cache@6.0.0: - resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} - engines: {node: '>=10'} - - lru-cache@7.18.3: - resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} - engines: {node: '>=12'} - make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - - map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - - meow@11.0.0: - resolution: {integrity: sha512-Cl0yeeIrko6d94KpUo1M+0X1sB14ikoaqlIGuTH1fW4I+E3+YljL54/hb/BWmVfrV9tTV9zU04+xjw08Fh2WkA==} - engines: {node: '>=14.16'} - mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -664,10 +566,6 @@ packages: resolution: {integrity: sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==} engines: {node: 18 || 20 || >=22} - minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - minipass@7.1.3: resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} engines: {node: '>=16 || 14 >=14.17'} @@ -687,14 +585,6 @@ packages: normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - normalize-package-data@3.0.3: - resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} - engines: {node: '>=10'} - - normalize-package-data@4.0.1: - resolution: {integrity: sha512-EBk5QKKuocMJhB3BILuKhmaPjI8vNRSpIfO9woLC6NyHVkKKdVEdAO1mrT0ZfxNR1lKwCcTkuZfmGIFdizZ8Pg==} - engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - normalize-url@8.1.1: resolution: {integrity: sha512-JYc0DPlpGWB40kH5g07gGTrYuMqV653k3uBKY6uITPWds3M0ov3GaWGp9lbE3Bzngx8+XkfzgvASb9vk9JDFXQ==} engines: {node: '>=14.16'} @@ -710,22 +600,10 @@ packages: resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} engines: {node: '>=12.20'} - p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - - p-locate@6.0.0: - resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} - path-exists@5.0.0: - resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -754,10 +632,6 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} - quick-lru@6.1.2: - resolution: {integrity: sha512-AAFUA5O1d83pIHEhJwWCq/RQcRukCkn/NSm2QsTEMle5f2hP0ChI2+3Xb051PZCkLryI/Ir1MVKviT2FIloaTQ==} - engines: {node: '>=12'} - randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -765,26 +639,14 @@ packages: resolution: {integrity: sha512-NoZh0jF9y99dAkf33tT0oX43drX8KUYiZvD1ZdVavLkpOkBaMP0YiSADNr35e50bvaB1jGpgs/zGarLk2Wcj9w==} hasBin: true - read-pkg-up@9.1.0: - resolution: {integrity: sha512-vaMRR1AC1nrd5CQM0PhlRsO5oc2AAigqr7cCrZ/MW/Rsaflz4RlgzkpL4qoU/z1F6wrbd85iFv1OQj/y5RdGvg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} - read-pkg@7.1.0: - resolution: {integrity: sha512-5iOehe+WF75IccPc30bWTbpdDQLOCc3Uu8bi3Dte3Eueij81yx1Mrufk8qBx/YAbR4uL1FdUr+7BKXDwEtisXg==} - engines: {node: '>=12.20'} - readdirp@5.1.1: resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} engines: {node: '>= 20.19.0'} - redent@4.0.0: - resolution: {integrity: sha512-tYkDkVVtYkSVhuQ4zBgfvciymHaeuel+zFKXShfDnFP5SyVEP7qo70Rf1jTOTCx3vGNAbnEi/xFkcfQVMIBWag==} - engines: {node: '>=12'} - request@2.88.2: resolution: {integrity: sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==} engines: {node: '>= 6'} @@ -816,11 +678,6 @@ packages: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true - semver@7.8.5: - resolution: {integrity: sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==} - engines: {node: '>=10'} - hasBin: true - serialize-javascript@7.1.2: resolution: {integrity: sha512-GL2BWwVa6JydKO6l/ljVgjAZF4QJ3S7dWDWi53s5GZT8PJzD2fNxi67HANQGKAqPrwEpL5ba7gUBGi0Ls/sEoQ==} engines: {node: '>=20.0.0'} @@ -845,10 +702,6 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - strip-indent@4.1.1: - resolution: {integrity: sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==} - engines: {node: '>=12'} - strip-json-comments@5.0.3: resolution: {integrity: sha512-1tB5mhVo7U+ETBKNf92xT4hrQa3pm0MZ0PQvuDnWgAAGHDsfp4lPSpiS6psrSiet87wyGPh9ft6wmhOMQ0hDiw==} engines: {node: '>=14.16'} @@ -869,14 +722,6 @@ packages: resolution: {integrity: sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==} engines: {node: '>=0.8'} - trim-newlines@4.1.1: - resolution: {integrity: sha512-jRKj0n0jXWo6kh62nA5TEh3+4igKDXLvzBJcPpiizP7oOolUrYIxmVBG9TOtHYFHoddUk6YvAkGeGoSVTXfQXQ==} - engines: {node: '>=12'} - - try-resolve@1.0.1: - resolution: {integrity: sha512-yHeaPjCBzVaXwWl5IMUapTaTC2rn/eBYg2fsG2L+CvJd+ttFbk0ylDnpTO3wVhosmE1tQEvcebbBeKLCwScQSQ==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - ts-node-test-register@10.0.0: resolution: {integrity: sha512-W8yzvufsG7/ulT65G1D218HMPf6uduojDXuSrGAaakkZlUtuLC+3pxphDktBe/N9w5Gi7teAxKCaTpBH5p6fkQ==} peerDependencies: @@ -906,14 +751,6 @@ packages: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} - type-fest@2.19.0: - resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} - engines: {node: '>=12.20'} - - type-fest@3.13.1: - resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} - engines: {node: '>=14.16'} - typescript@7.0.2: resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==} engines: {node: '>=16.20.0'} @@ -943,21 +780,10 @@ packages: workerpool@10.0.3: resolution: {integrity: sha512-6z2Iis68Wqth93/G/wJP9u+R3O+d2XTlgWChGCwuT1qLbBsOYueGRZuJ++v3mtDP5KjYdy+WzvWC+VWETSVXJA==} - yallist@4.0.0: - resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - - yargs-parser@21.1.1: - resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} - engines: {node: '>=12'} - yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} - yocto-queue@1.2.2: - resolution: {integrity: sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==} - engines: {node: '>=12.20'} - snapshots: '@babel/code-frame@7.29.7': @@ -999,12 +825,8 @@ snapshots: '@types/github-label-sync@2.3.3': {} - '@types/hosted-git-info@3.0.5': {} - '@types/http-cache-semantics@4.2.0': {} - '@types/minimist@1.2.5': {} - '@types/mocha@10.0.10': {} '@types/node@26.6.5': @@ -1105,8 +927,6 @@ snapshots: argparse@3.0.3: {} - arrify@1.0.1: {} - asn1@0.2.6: dependencies: safer-buffer: 2.1.2 @@ -1145,15 +965,6 @@ snapshots: normalize-url: 8.1.1 responselike: 3.0.0 - camelcase-keys@8.0.2: - dependencies: - camelcase: 7.0.1 - map-obj: 4.3.0 - quick-lru: 6.1.2 - type-fest: 2.19.0 - - camelcase@7.0.1: {} - caseless@0.12.0: {} chalk@4.1.2: @@ -1191,15 +1002,6 @@ snapshots: optionalDependencies: supports-color: 8.1.1 - decamelize-keys@1.1.1: - dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - - decamelize@1.2.0: {} - - decamelize@6.0.1: {} - decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 @@ -1239,11 +1041,6 @@ snapshots: find-up-simple@1.0.1: {} - find-up@6.3.0: - dependencies: - locate-path: 7.2.0 - path-exists: 5.0.0 - forever-agent@0.6.1: {} form-data-encoder@2.1.4: {} @@ -1308,8 +1105,6 @@ snapshots: ajv: 6.15.0 har-schema: 2.0.0 - hard-rejection@2.1.0: {} - has-flag@4.0.0: {} hasown@2.0.4: @@ -1318,18 +1113,6 @@ snapshots: hosted-git-info@2.8.9: {} - hosted-git-info@4.1.0: - dependencies: - lru-cache: 6.0.0 - - hosted-git-info@5.2.1: - dependencies: - lru-cache: 7.18.3 - - hosted-git-info@6.1.3: - dependencies: - lru-cache: 7.18.3 - http-cache-semantics@4.3.0: {} http-signature@1.2.0: @@ -1343,8 +1126,6 @@ snapshots: quick-lru: 5.1.1 resolve-alpn: 1.2.1 - indent-string@5.0.0: {} - ini@1.3.8: {} is-arrayish@0.2.1: {} @@ -1355,8 +1136,6 @@ snapshots: is-path-inside@4.0.0: {} - is-plain-obj@1.1.0: {} - is-typedarray@1.0.0: {} is-unicode-supported@0.1.0: {} @@ -1401,45 +1180,14 @@ snapshots: dependencies: json-buffer: 3.0.1 - kind-of@6.0.3: {} - lines-and-columns@1.2.4: {} - locate-path@7.2.0: - dependencies: - p-locate: 6.0.0 - lowercase-keys@3.0.0: {} lru-cache@11.5.3: {} - lru-cache@6.0.0: - dependencies: - yallist: 4.0.0 - - lru-cache@7.18.3: {} - make-error@1.3.6: {} - map-obj@1.0.1: {} - - map-obj@4.3.0: {} - - meow@11.0.0: - dependencies: - '@types/minimist': 1.2.5 - camelcase-keys: 8.0.2 - decamelize: 6.0.1 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 4.0.1 - read-pkg-up: 9.1.0 - redent: 4.0.0 - trim-newlines: 4.1.1 - type-fest: 3.13.1 - yargs-parser: 21.1.1 - mime-db@1.52.0: {} mime-types@2.1.35: @@ -1454,12 +1202,6 @@ snapshots: dependencies: brace-expansion: 5.0.12 - minimist-options@4.1.0: - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 - minipass@7.1.3: {} mocha@12.0.3: @@ -1495,20 +1237,6 @@ snapshots: semver: 5.7.2 validate-npm-package-license: 3.0.4 - normalize-package-data@3.0.3: - dependencies: - hosted-git-info: 4.1.0 - is-core-module: 2.17.0 - semver: 7.8.5 - validate-npm-package-license: 3.0.4 - - normalize-package-data@4.0.1: - dependencies: - hosted-git-info: 5.2.1 - is-core-module: 2.17.0 - semver: 7.8.5 - validate-npm-package-license: 3.0.4 - normalize-url@8.1.1: {} oauth-sign@0.9.0: {} @@ -1522,14 +1250,6 @@ snapshots: p-cancelable@3.0.0: {} - p-limit@4.0.0: - dependencies: - yocto-queue: 1.2.2 - - p-locate@6.0.0: - dependencies: - p-limit: 4.0.0 - parse-json@5.2.0: dependencies: '@babel/code-frame': 7.29.7 @@ -1537,8 +1257,6 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - path-exists@5.0.0: {} - path-parse@1.0.7: {} path-scurry@2.0.2: @@ -1560,8 +1278,6 @@ snapshots: quick-lru@5.1.1: {} - quick-lru@6.1.2: {} - randombytes@2.1.0: dependencies: safe-buffer: 5.2.1 @@ -1570,12 +1286,6 @@ snapshots: dependencies: randombytes: 2.1.0 - read-pkg-up@9.1.0: - dependencies: - find-up: 6.3.0 - read-pkg: 7.1.0 - type-fest: 2.19.0 - read-pkg@5.2.0: dependencies: '@types/normalize-package-data': 2.4.4 @@ -1583,20 +1293,8 @@ snapshots: parse-json: 5.2.0 type-fest: 0.6.0 - read-pkg@7.1.0: - dependencies: - '@types/normalize-package-data': 2.4.4 - normalize-package-data: 3.0.3 - parse-json: 5.2.0 - type-fest: 2.19.0 - readdirp@5.1.1: {} - redent@4.0.0: - dependencies: - indent-string: 5.0.0 - strip-indent: 4.1.1 - request@2.88.2: dependencies: aws-sign2: 0.7.0 @@ -1641,8 +1339,6 @@ snapshots: semver@5.7.2: {} - semver@7.8.5: {} - serialize-javascript@7.1.2: {} spdx-correct@3.2.0: @@ -1673,8 +1369,6 @@ snapshots: safer-buffer: 2.1.2 tweetnacl: 0.14.5 - strip-indent@4.1.1: {} - strip-json-comments@5.0.3: {} supports-color@7.2.0: @@ -1692,10 +1386,6 @@ snapshots: psl: 1.15.0 punycode: 2.3.1 - trim-newlines@4.1.1: {} - - try-resolve@1.0.1: {} - ts-node-test-register@10.0.0(ts-node@10.9.2(@types/node@26.6.5)(typescript@7.0.2)): dependencies: read-pkg: 5.2.0 @@ -1727,10 +1417,6 @@ snapshots: type-fest@0.6.0: {} - type-fest@2.19.0: {} - - type-fest@3.13.1: {} - typescript@7.0.2: optionalDependencies: '@typescript/typescript-aix-ppc64': 7.0.2 @@ -1777,10 +1463,4 @@ snapshots: workerpool@10.0.3: {} - yallist@4.0.0: {} - - yargs-parser@21.1.1: {} - yn@3.1.1: {} - - yocto-queue@1.2.2: {} diff --git a/src/github-label-setup.ts b/src/github-label-setup.ts index 14afa95..c542c70 100644 --- a/src/github-label-setup.ts +++ b/src/github-label-setup.ts @@ -1,9 +1,6 @@ import assert from "assert"; import githubLabelSync, { LabelInfo } from "github-label-sync"; import getRemoteOriginUrl from "git-remote-origin-url"; -// @ts-expect-error - no type -import tryResolve from "try-resolve"; -import hostGitInto from "hosted-git-info"; import url from "node:url"; import path from "node:path"; @@ -11,19 +8,33 @@ import { createRequire } from "module"; const require = createRequire(import.meta.url); const __filename__ = url.fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename__); -const { fromUrl } = hostGitInto; + +const tryResolve = (id: string): string | null => { + try { + return require.resolve(id); + } catch { + return null; + } +}; + +/** + * Parse "owner/repo" from GitHub remote URL + * e.g. git@github.com:owner/repo.git, https://github.com/owner/repo, ssh://git@github.com/owner/repo.git + */ +export const parseGitHubRepository = (remoteUrl: string): string | undefined => { + const match = remoteUrl.trim().match(/^(?:[\w+]+:\/\/)?(?:[^@/]+@)?github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/); + if (!match) { + return; + } + return `${match[1]}/${match[2]}`; +}; /** - * @returns {Promise.<{ owner: string|null, repo: string|null}>} + * @returns {Promise.} "owner/repo" */ const getRepositoryInfo = () => { return getRemoteOriginUrl().then(url => { - return fromUrl(url); - }).then(result => { - if (!result) { - return; - } - return `${result.user}/${result.project}`; + return parseGitHubRepository(url); }); }; From 3e1eeb3922ab7921c29eee68a495a37486535d9f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 14:04:14 +0000 Subject: [PATCH 2/3] fix: parse remote URL with URL API and accept negated flags - Use URL API for URL-style remotes so ports, www.github.com, query and fragment are handled - Keep a separate branch for SCP-like remotes (git@github.com:owner/repo.git) - Enable parseArgs allowNegative to accept --no-dry-run / --no-allow-added-labels Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN --- bin/cmd.mjs | 1 + src/github-label-setup.ts | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/cmd.mjs b/bin/cmd.mjs index 9e759f9..e552846 100755 --- a/bin/cmd.mjs +++ b/bin/cmd.mjs @@ -43,6 +43,7 @@ const showHelp = (exitCode = 2) => { let values; try { ({ values } = parseArgs({ + allowNegative: true, options: { help: { type: "boolean", short: "h" }, version: { type: "boolean" }, diff --git a/src/github-label-setup.ts b/src/github-label-setup.ts index c542c70..c803c88 100644 --- a/src/github-label-setup.ts +++ b/src/github-label-setup.ts @@ -19,10 +19,21 @@ const tryResolve = (id: string): string | null => { /** * Parse "owner/repo" from GitHub remote URL - * e.g. git@github.com:owner/repo.git, https://github.com/owner/repo, ssh://git@github.com/owner/repo.git + * e.g. git@github.com:owner/repo.git, https://github.com/owner/repo, ssh://git@github.com:22/owner/repo.git */ export const parseGitHubRepository = (remoteUrl: string): string | undefined => { - const match = remoteUrl.trim().match(/^(?:[\w+]+:\/\/)?(?:[^@/]+@)?github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/); + const trimmed = remoteUrl.trim(); + // SCP-like syntax: git@github.com:owner/repo.git + const scpLike = trimmed.match(/^(?:[^@/]+@)?(?:www\.)?github\.com:(?!\/)(.*)$/); + const pathname = scpLike ? scpLike[1].split(/[?#]/)[0] : (() => { + try { + const parsed = new URL(trimmed); + return ["github.com", "www.github.com"].includes(parsed.hostname) ? parsed.pathname : undefined; + } catch { + return; + } + })(); + const match = pathname?.match(/^\/?([^/]+)\/([^/]+?)(?:\.git)?\/?$/); if (!match) { return; } From 7b54f548710529f622c983f34842dcc42929f240 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Oct 2026 14:07:32 +0000 Subject: [PATCH 3/3] fix: normalize camelCase flags so the last flag wins Rewrite --dryRun / --allowAddedLabels (and --no-* forms) to dashed names before parseArgs, instead of defining them as separate options. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01HgKh95YqMvG1Q3AQ2aaqjN --- bin/cmd.mjs | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/bin/cmd.mjs b/bin/cmd.mjs index e552846..29f3b04 100755 --- a/bin/cmd.mjs +++ b/bin/cmd.mjs @@ -40,19 +40,34 @@ const showHelp = (exitCode = 2) => { process.exit(exitCode); }; +// meow accepted camelCase flags too. Normalize them to dashed names so the last one wins. +const camelCaseFlags = { + dryRun: "dry-run", + allowAddedLabels: "allow-added-labels" +}; +const terminatorIndex = process.argv.indexOf("--", 2); +const args = process.argv.slice(2).map((arg, index) => { + if (terminatorIndex !== -1 && index + 2 >= terminatorIndex) { + return arg; + } + const match = arg.match(/^--(no-)?([^=]+)(=.*)?$/); + if (!match || !Object.hasOwn(camelCaseFlags, match[2])) { + return arg; + } + return `--${match[1] ?? ""}${camelCaseFlags[match[2]]}${match[3] ?? ""}`; +}); let values; try { ({ values } = parseArgs({ + args, allowNegative: true, options: { help: { type: "boolean", short: "h" }, version: { type: "boolean" }, "dry-run": { type: "boolean", short: "d" }, - dryRun: { type: "boolean" }, token: { type: "string" }, labels: { type: "string", short: "l" }, "allow-added-labels": { type: "boolean", short: "A" }, - allowAddedLabels: { type: "boolean" }, addReleaseYml: { type: "boolean", default: false }, addReleaseYmlOutputPath: { type: "string", default: path.join(process.cwd(), ".github/release.yml") } } @@ -69,10 +84,10 @@ if (values.version) { process.exit(0); } const flags = { - dryRun: values["dry-run"] ?? values.dryRun, + dryRun: values["dry-run"], token: values.token, labels: values.labels, - allowAddedLabels: values["allow-added-labels"] ?? values.allowAddedLabels, + allowAddedLabels: values["allow-added-labels"], addReleaseYml: values.addReleaseYml, addReleaseYmlOutputPath: values.addReleaseYmlOutputPath };