From c0cbd230fb9df0894826a260af7d4e486f69cc79 Mon Sep 17 00:00:00 2001 From: Proudust Date: Wed, 9 Oct 2024 22:58:30 +0900 Subject: [PATCH] :arrow_up: Bump cliffy from 1.0.0-rc.3 to 1.0.0-rc.7 --- _compile.ts | 1 + cli/cli.ts | 4 +- deno.lock | 115 +++--- dist/cli.js | 1022 ++++++++++++++++++++------------------------------- 4 files changed, 438 insertions(+), 704 deletions(-) diff --git a/_compile.ts b/_compile.ts index e981d55..b6558e1 100644 --- a/_compile.ts +++ b/_compile.ts @@ -15,6 +15,7 @@ await esbuild({ define: { "globalThis.version": `"${describe}"`, }, + external: ["jsr:@cliffy/ansi@1.0.0-rc.7/colors", "jsr:@cliffy/command@1.0.0-rc.7"], }); for ( diff --git a/cli/cli.ts b/cli/cli.ts index b37ed77..1a7af0d 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -1,5 +1,5 @@ -import { colors } from "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/mod.ts"; -import { Command, EnumType } from "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts"; +import { colors } from "jsr:@cliffy/ansi@1.0.0-rc.7/colors"; +import { Command, EnumType } from "jsr:@cliffy/command@1.0.0-rc.7"; import { ghDescribe, GhDescribeError } from "../core/mod.ts"; interface GhDescribeCliArgs { diff --git a/deno.lock b/deno.lock index 5bde27f..346e8bb 100644 --- a/deno.lock +++ b/deno.lock @@ -2,6 +2,11 @@ "version": "3", "packages": { "specifiers": { + "jsr:@cliffy/ansi@1.0.0-rc.7": "jsr:@cliffy/ansi@1.0.0-rc.7", + "jsr:@cliffy/command@1.0.0-rc.7": "jsr:@cliffy/command@1.0.0-rc.7", + "jsr:@cliffy/flags@1.0.0-rc.7": "jsr:@cliffy/flags@1.0.0-rc.7", + "jsr:@cliffy/internal@1.0.0-rc.7": "jsr:@cliffy/internal@1.0.0-rc.7", + "jsr:@cliffy/table@1.0.0-rc.7": "jsr:@cliffy/table@1.0.0-rc.7", "jsr:@david/code-block-writer@^13.0.2": "jsr:@david/code-block-writer@13.0.3", "jsr:@david/dax@0.42.0": "jsr:@david/dax@0.42.0", "jsr:@david/path@0.2": "jsr:@david/path@0.2.0", @@ -16,6 +21,7 @@ "jsr:@std/bytes@^0.223.0": "jsr:@std/bytes@0.223.0", "jsr:@std/fmt@1": "jsr:@std/fmt@1.0.2", "jsr:@std/fmt@^0.223": "jsr:@std/fmt@0.223.0", + "jsr:@std/fmt@~1.0.2": "jsr:@std/fmt@1.0.2", "jsr:@std/fs@1": "jsr:@std/fs@1.0.4", "jsr:@std/fs@^0.223": "jsr:@std/fs@0.223.0", "jsr:@std/fs@^0.229.3": "jsr:@std/fs@0.229.3", @@ -30,11 +36,43 @@ "jsr:@std/path@^1": "jsr:@std/path@1.0.6", "jsr:@std/path@^1.0.6": "jsr:@std/path@1.0.6", "jsr:@std/streams@0.221": "jsr:@std/streams@0.221.0", + "jsr:@std/text@~1.0.7": "jsr:@std/text@1.0.7", "jsr:@ts-morph/bootstrap@^0.24.0": "jsr:@ts-morph/bootstrap@0.24.0", "jsr:@ts-morph/common@^0.24.0": "jsr:@ts-morph/common@0.24.0", "npm:@actions/core@1.10.1": "npm:@actions/core@1.10.1" }, "jsr": { + "@cliffy/ansi@1.0.0-rc.7": { + "integrity": "f71c921cce224c13d322e5cedba4f38e8f7354c7d855c9cb22729362a53f25aa", + "dependencies": [ + "jsr:@std/fmt@~1.0.2" + ] + }, + "@cliffy/command@1.0.0-rc.7": { + "integrity": "1288808d7a3cd18b86c24c2f920e47a6d954b7e23cadc35c8cbd78f8be41f0cd", + "dependencies": [ + "jsr:@cliffy/flags@1.0.0-rc.7", + "jsr:@cliffy/internal@1.0.0-rc.7", + "jsr:@cliffy/table@1.0.0-rc.7", + "jsr:@std/fmt@~1.0.2", + "jsr:@std/text@~1.0.7" + ] + }, + "@cliffy/flags@1.0.0-rc.7": { + "integrity": "318d9be98f6a6417b108e03dec427dea96cdd41a15beb21d2554ae6da450a781", + "dependencies": [ + "jsr:@std/text@~1.0.7" + ] + }, + "@cliffy/internal@1.0.0-rc.7": { + "integrity": "10412636ab3e67517d448be9eaab1b70c88eba9be22617b5d146257a11cc9b17" + }, + "@cliffy/table@1.0.0-rc.7": { + "integrity": "9fdd9776eda28a0b397981c400eeb1aa36da2371b43eefe12e6ff555290e3180", + "dependencies": [ + "jsr:@std/fmt@~1.0.2" + ] + }, "@david/code-block-writer@13.0.3": { "integrity": "f98c77d320f5957899a61bfb7a9bead7c6d83ad1515daee92dbacc861e13bb7f" }, @@ -158,6 +196,9 @@ "jsr:@std/io@^0.221.0" ] }, + "@std/text@1.0.7": { + "integrity": "344a820af99fde81ae1d4f9ce586da3f47a58cda25ac4c4dd688166cf5ed97f1" + }, "@ts-morph/bootstrap@0.24.0": { "integrity": "a826a2ef7fa8a7c3f1042df2c034d20744d94da2ee32bf29275bcd4dffd3c060", "dependencies": [ @@ -208,13 +249,6 @@ } }, "remote": { - "https://deno.land/std@0.196.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.196.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.196.0/console/_data.json": "cf2cc9d039a192b3adbfe64627167c7e6212704c888c25c769fc8f1709e1e1b8", - "https://deno.land/std@0.196.0/console/_rle.ts": "56668d5c44f964f1b4ff93f21c9896df42d6ee4394e814db52d6d13f5bb247c7", - "https://deno.land/std@0.196.0/console/unicode_width.ts": "10661c0f2eeab802d16b8b85ed8825bbc573991bbfb6affed32dc1ff994f54f9", - "https://deno.land/std@0.196.0/encoding/base64.ts": "144ae6234c1fbe5b68666c711dc15b1e9ee2aef6d42b3b4345bf9a6c91d70d0d", - "https://deno.land/std@0.196.0/fmt/colors.ts": "a7eecffdf3d1d54db890723b303847b6e0a1ab4b528ba6958b8f2e754cf1b3bc", "https://deno.land/std@0.213.0/assert/_constants.ts": "a271e8ef5a573f1df8e822a6eb9d09df064ad66a4390f21b3e31f820a38e0975", "https://deno.land/std@0.213.0/assert/_diff.ts": "dcc63d94ca289aec80644030cf88ccbf7acaa6fbd7b0f22add93616b36593840", "https://deno.land/std@0.213.0/assert/_format.ts": "0ba808961bf678437fb486b56405b6fefad2cf87b5809667c781ddee8c32aff4", @@ -329,73 +363,6 @@ "https://deno.land/std@0.213.0/path/windows/to_file_url.ts": "1cd63fd35ec8d1370feaa4752eccc4cc05ea5362a878be8dc7db733650995484", "https://deno.land/std@0.213.0/path/windows/to_namespaced_path.ts": "4ffa4fb6fae321448d5fe810b3ca741d84df4d7897e61ee29be961a6aac89a4c", "https://deno.land/std@0.213.0/testing/asserts.ts": "0cb9c745d9b157bed062a4aa8647168d2221f6456c385a548b0ca24de9e0f3ca", - "https://deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi.ts": "481e382126922ff686dd664f4bae6bc44df44bc5ed883c0f5f8a8b3776e5a983", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.ts": "193b3c3a4e520274bd8322ca4cab1c3ce38070bed1898cb2ade12a585dddd7c9", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/chain.ts": "eca61b1b64cad7b9799490c12c7aa5538d0f63ac65a73ddb6acac8b35f0a5323", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/colors.ts": "328916ea1627c202b39f2ed0f1ca65a573cfb75fa8986aa3dbcc0b7463911005", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/cursor_position.ts": "caa008d29f7a904908bda514f9839bfbb7a93f2d5f5580501675b646d26a87ff", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/deps.ts": "f48ae5d066684793f4a203524db2a9fd61f514527934b458006f3e57363c0215", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/mod.ts": "8713c4babbb279615d325e386c318674650fe61855388e2f8a5b4809fdaf4d00", - "https://deno.land/x/cliffy@v1.0.0-rc.3/ansi/tty.ts": "155aacdcb7dc00f3f95352616a2415c622ffb88db51c5934e5d2e8341eab010b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_argument_types.ts": "ab269dacea2030f865a07c2a1e953ec437a64419a05bad1f1ddaab3f99752ead", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.ts": "12d513ff401020287a344e0830e1297ce1c80c077ecb91e0ac5db44d04a6019c", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_spread.ts": "0cc6eb70a6df97b5d7d26008822d39f3e8a1232ee0a27f395aa19e68de738245", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_type_utils.ts": "820004a59bc858e355b11f80e5b3ff1be2c87e66f31f53f253610170795602f0", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/_utils.ts": "3c88ff4f36eba298beb07de08068fdce5e5cb7b9d82c8a319f09596d8279be64", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts": "ae690745759524082776b7f271f66d5b93933170b1b132f888bd4ac12e9fdd7d", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_bash_completions_generator.ts": "0c6cb1df4d378d22f001155781d97a9c3519fd10c48187a198fef2cc63b0f84a", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_fish_completions_generator.ts": "8ba4455f7f76a756e05c3db4ce35332b2951af65a2891f2750b530e06880f495", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/_zsh_completions_generator.ts": "c74525feaf570fe8c14433c30d192622c25603f1fc64694ef69f2a218b41f230", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/bash.ts": "53fe78994eb2359110dc4fa79235bdd86800a38c1d6b1c4fe673c81756f3a0e2", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/complete.ts": "58df61caa5e6220ff2768636a69337923ad9d4b8c1932aeb27165081c4d07d8b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/completions_command.ts": "506f97f1c6b0b1c3e9956e5069070028b818942310600d4157f64c9b644d3c49", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/fish.ts": "6f0b44b4067740b2931c9ec8863b6619b1d3410fea0c5a3988525a4c53059197", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/mod.ts": "8dda715ca25f3f66d5ec232b76d7c9a96dd4c64b5029feff91738cc0c9586fb1", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/completions/zsh.ts": "f1263c3946975e090d4aadc8681db811d86b52a8ae680f246e03248025885c21", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/deprecated.ts": "bbe6670f1d645b773d04b725b8b8e7814c862c9f1afba460c4d599ffe9d4983c", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/deps.ts": "7473ebd5625bf901becd7ff80afdde3b8a50ae5d1bbfa2f43805cfacf4559d5a", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/_help_generator.ts": "532dd4a928baab8b45ce46bb6d20e2ebacfdf3da141ce9d12da796652b1de478", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/help_command.ts": "fbbf0c0827dd21d3cec7bcc68c00c20b55f53e2b621032891b9d23ac4191231c", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/help/mod.ts": "8369b292761dcc9ddaf41f2d34bfb06fb6800b69efe80da4fc9752c3b890275b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts": "4b708df1b97152522bee0e3828f06abbbc1d2250168910e5cf454950d7b7404b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/type.ts": "f588f5d9635b79100044e62aced4b00e510e75b83801f9b089c40c2d98674de2", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types.ts": "bc9ff7459b9cc1079eeb95ff101690a51b4b4afa4af5623340076ee361d08dbb", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/action_list.ts": "33c98d449617c7a563a535c9ceb3741bde9f6363353fd492f90a74570c611c27", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/boolean.ts": "3879ec16092b4b5b1a0acb8675f8c9250c0b8a972e1e4c7adfba8335bd2263ed", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/child_command.ts": "f1fca390c7fbfa7a713ca15ef55c2c7656bcbb394d50e8ef54085bdf6dc22559", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/command.ts": "325d0382e383b725fd8d0ef34ebaeae082c5b76a1f6f2e843fee5dbb1a4fe3ac", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/enum.ts": "8a7cd2898e03089234083bb78c8b1d9b7172254c53c32d4710321638165a48ec", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/file.ts": "8618f16ac9015c8589cbd946b3de1988cc4899b90ea251f3325c93c46745140e", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/integer.ts": "29864725fd48738579d18123d7ee78fed37515e6dc62146c7544c98a82f1778d", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/number.ts": "aeba96e6f470309317a16b308c82e0e4138a830ec79c9877e4622c682012bc1f", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/types/string.ts": "e4dadb08a11795474871c7967beab954593813bb53d9f69ea5f9b734e43dc0e0", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/_check_version.ts": "6cfa7dc26bc0dc46381500e8d4b130fb224f4c5456152dada15bd3793edca89b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/mod.ts": "4eff69c489467be17dea27fb95a795396111ee385d170ac0cbcc82f0ea38156c", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider.ts": "c23253334097dc4b8a147ccdeb3aa44f5a95aa953a6386cb5396f830d95d77a5", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/deno_land.ts": "24f8d82e38c51e09be989f30f8ad21f9dd41ac1bb1973b443a13883e8ba06d6d", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/github.ts": "99e1b133dd446c6aa79f69e69c46eb8bc1c968dd331c2a7d4064514a317c7b59", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/provider/nest_land.ts": "0e07936cea04fa41ac9297f32d87f39152ea873970c54cb5b4934b12fee1885e", - "https://deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/upgrade_command.ts": "3640a287d914190241ea1e636774b1b4b0e1828fa75119971dd5304784061e05", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_errors.ts": "f1fbb6bfa009e7950508c9d491cfb4a5551027d9f453389606adb3f2327d048f", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_utils.ts": "340d3ecab43cde9489187e1f176504d2c58485df6652d1cdd907c0e9c3ce4cc2", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/_validate_flags.ts": "e60b9038c0136ab7e6bd1baf0e993a07bf23f18afbfb6e12c59adf665a622957", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/deprecated.ts": "a72a35de3cc7314e5ebea605ca23d08385b218ef171c32a3f135fb4318b08126", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/flags.ts": "3e62c4a9756b5705aada29e7e94847001356b3a83cd18ad56f4207387a71cf51", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types.ts": "9e2f75edff2217d972fc711a21676a59dfd88378da2f1ace440ea84c07db1dcc", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/boolean.ts": "4c026dd66ec9c5436860dc6d0241427bdb8d8e07337ad71b33c08193428a2236", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/integer.ts": "b60d4d590f309ddddf066782d43e4dc3799f0e7d08e5ede7dc62a5ee94b9a6d9", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/number.ts": "610936e2d29de7c8c304b65489a75ebae17b005c6122c24e791fbed12444d51e", - "https://deno.land/x/cliffy@v1.0.0-rc.3/flags/types/string.ts": "e89b6a5ce322f65a894edecdc48b44956ec246a1d881f03e97bbda90dd8638c5", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/_layout.ts": "e4a518da28333de95ad791208b9930025987c8b93d5f8b7f30b377b3e26b24e1", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/_utils.ts": "fd48d1a524a42e72aa3ad2eec858a92f5a00728d306c7e8436fba6c34314fee6", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/border.ts": "5c6e9ef5078c6930169aacb668b274bdbb498461c724a7693ac9270fe9d3f5d5", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/cell.ts": "1ffabd43b6b7fddfac9625cb0d015532e144702a9bfed03b358b79375115d06b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/column.ts": "cf14009f2cb14bad156f879946186c1893acdc6a2fee6845db152edddb6a2714", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/consume_words.ts": "456e75755fdf6966abdefb8b783df2855e2a8bad6ddbdf21bd748547c5fc1d4b", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/deps.ts": "1226c4d39d53edc81d7c3e661fb8a79f2e704937c276c60355cd4947a0fe9153", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/row.ts": "79eb1468aafdd951e5963898cdafe0752d4ab4c519d5f847f3d8ecb8fe857d4f", - "https://deno.land/x/cliffy@v1.0.0-rc.3/table/table.ts": "298671e72e61f1ab18b42ae36643181993f79e29b39dc411fdc6ffd53aa04684", "https://deno.land/x/denoflate@1.2.1/mod.ts": "f5628e44b80b3d80ed525afa2ba0f12408e3849db817d47a883b801f9ce69dd6", "https://deno.land/x/denoflate@1.2.1/pkg/denoflate.js": "b9f9ad9457d3f12f28b1fb35c555f57443427f74decb403113d67364e4f2caf4", "https://deno.land/x/denoflate@1.2.1/pkg/denoflate_bg.wasm.js": "d581956245407a2115a3d7e8d85a9641c032940a8e810acbd59ca86afd34d44d", diff --git a/dist/cli.js b/dist/cli.js index 935e9da..ddd9b4f 100644 --- a/dist/cli.js +++ b/dist/cli.js @@ -449,8 +449,8 @@ var require_write = __commonJS({ var fs = __importStar(require("fs")); var util_1 = require("util"); var nodeWrite = (0, util_1.promisify)(fs.write); - var write = async (fd, data) => { - const { bytesWritten } = await nodeWrite(fd, data); + var write = async (fd, data2) => { + const { bytesWritten } = await nodeWrite(fd, data2); return bytesWritten; }; exports2.write = write; @@ -998,10 +998,10 @@ var require_std = __commonJS({ process.stdin.once("readable", () => { var _a; process.stdin.off("error", onerror); - const data = (_a = process.stdin.read(p.length)) !== null && _a !== void 0 ? _a : process.stdin.read(); - if (data) { - p.set(data); - resolve3(data.length > 0 ? data.length : null); + const data2 = (_a = process.stdin.read(p.length)) !== null && _a !== void 0 ? _a : process.stdin.read(); + if (data2) { + p.set(data2); + resolve3(data2.length > 0 ? data2.length : null); } else { resolve3(null); } @@ -1053,8 +1053,8 @@ var require_std = __commonJS({ } return stdoutWritable; }, - writeSync(data) { - return (0, writeSync_js_1.writeSync)(this.rid, data); + writeSync(data2) { + return (0, writeSync_js_1.writeSync)(this.rid, data2); }, close() { process.stdout.destroy(); @@ -1082,8 +1082,8 @@ var require_std = __commonJS({ } return stderrWritable; }, - writeSync(data) { - return (0, writeSync_js_1.writeSync)(this.rid, data); + writeSync(data2) { + return (0, writeSync_js_1.writeSync)(this.rid, data2); }, close() { process.stderr.destroy(); @@ -2248,10 +2248,10 @@ var require_exit = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.exit = void 0; - var exit = function exit2(code2) { + var exit2 = function exit3(code2) { return process.exit(code2); }; - exports2.exit = exit; + exports2.exit = exit2; } }); @@ -2959,7 +2959,7 @@ var require_writeTextFile = __commonJS({ var fs = __importStar(require("fs/promises")); var errorMap_js_1 = __importDefault(require_errorMap()); var fs_flags_js_1 = require_fs_flags(); - var writeTextFile = async function writeTextFile2(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) { + var writeTextFile = async function writeTextFile2(path, data2, { append = false, create = true, createNew = false, mode, signal } = {}) { const truncate = create && !append; const flag = (0, fs_flags_js_1.getFsFlag)({ append, @@ -2969,7 +2969,7 @@ var require_writeTextFile = __commonJS({ write: true }); try { - await fs.writeFile(path, data, { flag, mode, signal }); + await fs.writeFile(path, data2, { flag, mode, signal }); if (mode !== void 0) await fs.chmod(path, mode); } catch (error) { @@ -3037,10 +3037,10 @@ var require_writeTextFileSync = __commonJS({ exports2.writeTextFileSync = void 0; var fs = __importStar(require("fs")); var errorMap_js_1 = __importDefault(require_errorMap()); - var writeTextFileSync = (path, data, { append = false, create = true, mode } = {}) => { + var writeTextFileSync = (path, data2, { append = false, create = true, mode } = {}) => { const flag = create ? append ? "a" : "w" : "r+"; try { - fs.writeFileSync(path, data, { flag, mode }); + fs.writeFileSync(path, data2, { flag, mode }); if (mode !== void 0) fs.chmodSync(path, mode); } catch (error) { @@ -3836,7 +3836,7 @@ var require_run = __commonJS({ } const process2 = child_process_1.default.spawn(commandName, args, { cwd: options.cwd, - env: getEnv(options), + env: getEnv2(options), uid: options.uid, gid: options.gid, shell: false, @@ -3879,7 +3879,7 @@ var require_run = __commonJS({ return firstArg; } } - function getEnv(options) { + function getEnv2(options) { var _a; const env = (_a = options.env) !== null && _a !== void 0 ? _a : {}; for (const name in process.env) { @@ -4541,11 +4541,11 @@ var require_writeFile = __commonJS({ var fs = __importStar(require("fs/promises")); var errorMap_js_1 = __importDefault(require_errorMap()); var fs_flags_js_1 = require_fs_flags(); - var writeFile = async function writeFile2(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) { + var writeFile = async function writeFile2(path, data2, { append = false, create = true, createNew = false, mode, signal } = {}) { const truncate = create && !append; const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, createNew, truncate, write: true }); try { - await fs.writeFile(path, data, { flag, signal }); + await fs.writeFile(path, data2, { flag, signal }); if (mode != null) await fs.chmod(path, mode); } catch (error) { @@ -4570,7 +4570,7 @@ var require_writeFileSync = __commonJS({ var errorMap_js_1 = __importDefault(require_errorMap()); var statSync_js_1 = require_statSync(); var chmodSync_js_1 = require_chmodSync(); - var writeFileSync = function writeFileSync2(path, data, options = {}) { + var writeFileSync = function writeFileSync2(path, data2, options = {}) { try { if (options.create !== void 0) { const create = !!options.create; @@ -4590,8 +4590,8 @@ var require_writeFileSync = __commonJS({ (0, chmodSync_js_1.chmodSync)(path, options.mode); } let nwritten = 0; - while (nwritten < data.length) { - nwritten += file.writeSync(data.subarray(nwritten)); + while (nwritten < data2.length) { + nwritten += file.writeSync(data2.subarray(nwritten)); } file.close(); } catch (e) { @@ -5704,291 +5704,7 @@ async function revParse(options) { return await exec(args); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.js -var ansi_escapes_exports = {}; -__export(ansi_escapes_exports, { - bel: () => bel, - clearScreen: () => clearScreen, - clearTerminal: () => clearTerminal, - cursorBackward: () => cursorBackward, - cursorDown: () => cursorDown, - cursorForward: () => cursorForward, - cursorHide: () => cursorHide, - cursorLeft: () => cursorLeft, - cursorMove: () => cursorMove, - cursorNextLine: () => cursorNextLine, - cursorPosition: () => cursorPosition, - cursorPrevLine: () => cursorPrevLine, - cursorRestore: () => cursorRestore, - cursorSave: () => cursorSave, - cursorShow: () => cursorShow, - cursorTo: () => cursorTo, - cursorUp: () => cursorUp, - eraseDown: () => eraseDown, - eraseLine: () => eraseLine, - eraseLineEnd: () => eraseLineEnd, - eraseLineStart: () => eraseLineStart, - eraseLines: () => eraseLines, - eraseScreen: () => eraseScreen, - eraseUp: () => eraseUp, - image: () => image, - link: () => link, - scrollDown: () => scrollDown, - scrollUp: () => scrollUp -}); - -// dist/dnt/esm/deps/deno.land/std@0.196.0/encoding/base64.js -var base64abc = [ - "A", - "B", - "C", - "D", - "E", - "F", - "G", - "H", - "I", - "J", - "K", - "L", - "M", - "N", - "O", - "P", - "Q", - "R", - "S", - "T", - "U", - "V", - "W", - "X", - "Y", - "Z", - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "+", - "/" -]; -function encode(data) { - const uint8 = typeof data === "string" ? new TextEncoder().encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data); - let result = "", i; - const l = uint8.length; - for (i = 2; i < l; i += 3) { - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[(uint8[i - 2] & 3) << 4 | uint8[i - 1] >> 4]; - result += base64abc[(uint8[i - 1] & 15) << 2 | uint8[i] >> 6]; - result += base64abc[uint8[i] & 63]; - } - if (i === l + 1) { - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[(uint8[i - 2] & 3) << 4]; - result += "=="; - } - if (i === l) { - result += base64abc[uint8[i - 2] >> 2]; - result += base64abc[(uint8[i - 2] & 3) << 4 | uint8[i - 1] >> 4]; - result += base64abc[(uint8[i - 1] & 15) << 2]; - result += "="; - } - return result; -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi_escapes.js -var ESC = "\x1B"; -var CSI = `${ESC}[`; -var OSC = `${ESC}]`; -var SEP = ";"; -var bel = "\x07"; -var cursorPosition = `${CSI}6n`; -function cursorTo(x, y) { - if (typeof y !== "number") { - return `${CSI}${x}G`; - } - return `${CSI}${y};${x}H`; -} -function cursorMove(x, y) { - let ret = ""; - if (x < 0) { - ret += `${CSI}${-x}D`; - } else if (x > 0) { - ret += `${CSI}${x}C`; - } - if (y < 0) { - ret += `${CSI}${-y}A`; - } else if (y > 0) { - ret += `${CSI}${y}B`; - } - return ret; -} -function cursorUp(count = 1) { - return `${CSI}${count}A`; -} -function cursorDown(count = 1) { - return `${CSI}${count}B`; -} -function cursorForward(count = 1) { - return `${CSI}${count}C`; -} -function cursorBackward(count = 1) { - return `${CSI}${count}D`; -} -function cursorNextLine(count = 1) { - return `${CSI}E`.repeat(count); -} -function cursorPrevLine(count = 1) { - return `${CSI}F`.repeat(count); -} -var cursorLeft = `${CSI}G`; -var cursorHide = `${CSI}?25l`; -var cursorShow = `${CSI}?25h`; -var cursorSave = `${ESC}7`; -var cursorRestore = `${ESC}8`; -function scrollUp(count = 1) { - return `${CSI}S`.repeat(count); -} -function scrollDown(count = 1) { - return `${CSI}T`.repeat(count); -} -var eraseScreen = `${CSI}2J`; -function eraseUp(count = 1) { - return `${CSI}1J`.repeat(count); -} -function eraseDown(count = 1) { - return `${CSI}0J`.repeat(count); -} -var eraseLine = `${CSI}2K`; -var eraseLineEnd = `${CSI}0K`; -var eraseLineStart = `${CSI}1K`; -function eraseLines(count) { - let clear = ""; - for (let i = 0; i < count; i++) { - clear += eraseLine + (i < count - 1 ? cursorUp() : ""); - } - clear += cursorLeft; - return clear; -} -var clearScreen = "\x1Bc"; -var clearTerminal = import_shim_deno2.Deno.build.os === "windows" ? `${eraseScreen}${CSI}0f` : `${eraseScreen}${CSI}3J${CSI}H`; -function link(text, url) { - return [ - OSC, - "8", - SEP, - SEP, - url, - bel, - text, - OSC, - "8", - SEP, - SEP, - bel - ].join(""); -} -function image(buffer, options) { - let ret = `${OSC}1337;File=inline=1`; - if (options?.width) { - ret += `;width=${options.width}`; - } - if (options?.height) { - ret += `;height=${options.height}`; - } - if (options?.preserveAspectRatio === false) { - ret += ";preserveAspectRatio=0"; - } - return ret + ":" + encode(buffer) + bel; -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/ansi.js -var ansi = factory(); -var encoder = new TextEncoder(); -function factory() { - let result = []; - let stack = []; - const ansi2 = function(...args) { - if (this) { - if (args.length) { - update(args); - return this; - } - return this.toString(); - } - return factory(); - }; - ansi2.text = function(text) { - stack.push([text, []]); - return this; - }; - ansi2.toArray = function() { - update(); - const ret = result; - result = []; - return ret; - }; - ansi2.toString = function() { - return this.toArray().join(""); - }; - ansi2.bytes = function() { - return encoder.encode(this.toString()); - }; - const methodList = Object.entries(ansi_escapes_exports); - for (const [name, method] of methodList) { - Object.defineProperty(ansi2, name, { - get() { - stack.push([method, []]); - return this; - } - }); - } - return ansi2; - function update(args) { - if (!stack.length) { - return; - } - if (args) { - stack[stack.length - 1][1] = args; - } - result.push(...stack.map(([prop, args2]) => typeof prop === "string" ? prop : prop.call(ansi2, ...args2))); - stack = []; - } -} - -// dist/dnt/esm/deps/deno.land/std@0.196.0/fmt/colors.js +// dist/dnt/esm/deps/jsr.io/@std/fmt/1.0.2/colors.js var colors_exports = {}; __export(colors_exports, { bgBlack: () => bgBlack, @@ -6035,7 +5751,7 @@ __export(colors_exports, { rgb8: () => rgb8, setColorEnabled: () => setColorEnabled, strikethrough: () => strikethrough, - stripColor: () => stripColor, + stripAnsiCode: () => stripAnsiCode, underline: () => underline, white: () => white, yellow: () => yellow @@ -6220,13 +5936,13 @@ function bgRgb24(str, color) { } var ANSI_PATTERN = new RegExp([ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", - "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))" + "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TXZcf-nq-uy=><~]))" ].join("|"), "g"); -function stripColor(string2) { +function stripAnsiCode(string2) { return string2.replace(ANSI_PATTERN, ""); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/colors.js +// dist/dnt/esm/deps/jsr.io/@cliffy/ansi/1.0.0-rc.7/colors.js var proto = /* @__PURE__ */ Object.create(null); var methodNames = Object.keys(colors_exports); for (const name of methodNames) { @@ -6235,12 +5951,12 @@ for (const name of methodNames) { } Object.defineProperty(proto, name, { get() { - return factory2([...this._stack, name]); + return factory([...this._stack, name]); } }); } -var colors = factory2(); -function factory2(stack = []) { +var colors = factory(); +function factory(stack = []) { const colors2 = function(str, ...args) { if (typeof str !== "undefined") { const lastIndex = stack.length - 1; @@ -6248,108 +5964,138 @@ function factory2(stack = []) { } const tmp = stack.slice(); stack = []; - return factory2(tmp); + return factory(tmp); }; Object.setPrototypeOf(colors2, proto); colors2._stack = stack; return colors2; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/cursor_position.js -var encoder2 = new TextEncoder(); -var decoder = new TextDecoder(); -function getCursorPosition({ reader = import_shim_deno2.Deno.stdin, writer = import_shim_deno2.Deno.stdout } = {}) { - const data = new Uint8Array(8); - reader.setRaw(true); - writer.writeSync(encoder2.encode(cursorPosition)); - reader.readSync(data); - reader.setRaw(false); - const [y, x] = decoder.decode(data).match(/\[(\d+);(\d+)R/)?.slice(1, 3).map(Number) ?? [0, 0]; - return { x, y }; -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/ansi/tty.js -var tty = factory3(); -var encoder3 = new TextEncoder(); -function factory3(options) { - let result = ""; - let stack = []; - const writer = options?.writer ?? import_shim_deno2.Deno.stdout; - const reader = options?.reader ?? import_shim_deno2.Deno.stdin; - const tty2 = function(...args) { - if (this) { - update(args); - writer.writeSync(encoder3.encode(result)); - return this; - } - return factory3(args[0] ?? options); - }; - tty2.text = function(text) { - stack.push([text, []]); - update(); - writer.writeSync(encoder3.encode(result)); - return this; - }; - tty2.getCursorPosition = () => getCursorPosition({ writer, reader }); - const methodList = Object.entries(ansi_escapes_exports); - for (const [name, method] of methodList) { - if (name === "cursorPosition") { - continue; - } - Object.defineProperty(tty2, name, { - get() { - stack.push([method, []]); - return this; - } - }); - } - return tty2; - function update(args) { - if (!stack.length) { - return; - } - if (args) { - stack[stack.length - 1][1] = args; - } - result = stack.reduce((prev, [cur, args2]) => prev + (typeof cur === "string" ? cur : cur.call(tty2, ...args2)), ""); - stack = []; - } -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/_utils/distance.js -function distance(a, b) { - if (a.length == 0) { - return b.length; - } - if (b.length == 0) { - return a.length; - } - const matrix = []; - for (let i = 0; i <= b.length; i++) { - matrix[i] = [i]; - } - for (let j = 0; j <= a.length; j++) { - matrix[0][j] = j; - } - for (let i = 1; i <= b.length; i++) { - for (let j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) == a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); - } - } - } - return matrix[b.length][a.length]; -} - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_utils.js +// dist/dnt/esm/deps/jsr.io/@std/text/1.0.7/levenshtein_distance.js +var { ceil } = Math; +var peq = new Uint32Array(1114112); +function myers32(t, p) { + const n = t.length; + const m = p.length; + for (let i = 0; i < m; i++) { + peq[p[i].codePointAt(0)] |= 1 << i; + } + const last = m - 1; + let pv = -1; + let mv = 0; + let score = m; + for (let j = 0; j < n; j++) { + const eq = peq[t[j].codePointAt(0)]; + const xv = eq | mv; + const xh = (eq & pv) + pv ^ pv | eq; + let ph = mv | ~(xh | pv); + let mh = pv & xh; + score += (ph >>> last & 1) - (mh >>> last & 1); + ph = ph << 1 | 1; + mh = mh << 1; + pv = mh | ~(xv | ph); + mv = ph & xv; + } + for (let i = 0; i < m; i++) { + peq[p[i].codePointAt(0)] = 0; + } + return score; +} +function myersX(t, p) { + const n = t.length; + const m = p.length; + const h = new Int8Array(n).fill(1); + const bmax = ceil(m / 32) - 1; + for (let b = 0; b < bmax; b++) { + const start2 = b * 32; + const end = (b + 1) * 32; + for (let i = start2; i < end; i++) { + peq[p[i].codePointAt(0)] |= 1 << i; + } + let pv2 = -1; + let mv2 = 0; + for (let j = 0; j < n; j++) { + const hin = h[j]; + let eq = peq[t[j].codePointAt(0)]; + const xv = eq | mv2; + eq |= hin >>> 31; + const xh = (eq & pv2) + pv2 ^ pv2 | eq; + let ph = mv2 | ~(xh | pv2); + let mh = pv2 & xh; + h[j] = (ph >>> 31) - (mh >>> 31); + ph = ph << 1 | -hin >>> 31; + mh = mh << 1 | hin >>> 31; + pv2 = mh | ~(xv | ph); + mv2 = ph & xv; + } + for (let i = start2; i < end; i++) { + peq[p[i].codePointAt(0)] = 0; + } + } + const start = bmax * 32; + for (let i = start; i < m; i++) { + peq[p[i].codePointAt(0)] |= 1 << i; + } + const last = m - 1; + let pv = -1; + let mv = 0; + let score = m; + for (let j = 0; j < n; j++) { + const hin = h[j]; + let eq = peq[t[j].codePointAt(0)]; + const xv = eq | mv; + eq |= hin >>> 31; + const xh = (eq & pv) + pv ^ pv | eq; + let ph = mv | ~(xh | pv); + let mh = pv & xh; + score += (ph >>> last & 1) - (mh >>> last & 1); + ph = ph << 1 | -hin >>> 31; + mh = mh << 1 | hin >>> 31; + pv = mh | ~(xv | ph); + mv = ph & xv; + } + for (let i = start; i < m; i++) { + peq[p[i].codePointAt(0)] = 0; + } + return score; +} +function levenshteinDistance(str1, str2) { + let t = [...str1]; + let p = [...str2]; + if (t.length < p.length) { + [p, t] = [t, p]; + } + if (p.length === 0) { + return t.length; + } + return p.length <= 32 ? myers32(t, p) : myersX(t, p); +} + +// dist/dnt/esm/deps/jsr.io/@std/text/1.0.7/closest_string.js +function closestString(givenWord, possibleWords, options) { + if (possibleWords.length === 0) { + throw new TypeError("When using closestString(), the possibleWords array must contain at least one word"); + } + const { caseSensitive, compareFn = levenshteinDistance } = { ...options }; + if (!caseSensitive) { + givenWord = givenWord.toLowerCase(); + } + let nearestWord = possibleWords[0]; + let closestStringDistance = Infinity; + for (const each of possibleWords) { + const distance = caseSensitive ? compareFn(givenWord, each) : compareFn(givenWord, each.toLowerCase()); + if (distance < closestStringDistance) { + nearestWord = each; + closestStringDistance = distance; + } + } + return nearestWord; +} + +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/_utils.js function paramCaseToCamelCase(str) { return str.replace(/-([a-z])/g, (g) => g[1].toUpperCase()); } -function underscoreToCamelCase(str) { - return str.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase().replace(/_([a-z])/g, (g) => g[1].toUpperCase()); -} function getOption(flags, name) { while (name[0] === "-") { name = name.slice(1); @@ -6369,7 +6115,7 @@ function didYouMeanType(type, types) { return didYouMean(" Did you mean type", type, types); } function didYouMean(message, type, types) { - const match = closest(type, types); + const match = types.length ? closestString(type, types) : void 0; return match ? `${message} "${match}"?` : ""; } function getFlag(name) { @@ -6411,23 +6157,11 @@ function matchWildCardOption(name, option) { } return option; } -function closest(str, arr) { - let minDistance = Infinity; - let minIndex = 0; - for (let i = 0; i < arr.length; i++) { - const dist = distance(str, arr[i]); - if (dist < minDistance) { - minDistance = dist; - minIndex = i; - } - } - return arr[minIndex]; -} function getDefaultValue(option) { return typeof option.default === "function" ? option.default() : option.default; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_errors.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/_errors.js var FlagsError = class _FlagsError extends Error { constructor(message) { super(message); @@ -6537,7 +6271,7 @@ var InvalidTypeError = class extends ValidationError { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/deprecated.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/deprecated.js var OptionType; (function(OptionType2) { OptionType2["STRING"] = "string"; @@ -6546,7 +6280,7 @@ var OptionType; OptionType2["BOOLEAN"] = "boolean"; })(OptionType || (OptionType = {})); -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/boolean.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/types/boolean.js var boolean = (type) => { if (~["1", "true"].indexOf(type.value)) { return true; @@ -6557,7 +6291,7 @@ var boolean = (type) => { throw new InvalidTypeError(type, ["true", "false", "1", "0"]); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/number.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/types/number.js var number = (type) => { const value = Number(type.value); if (Number.isFinite(value)) { @@ -6566,12 +6300,12 @@ var number = (type) => { throw new InvalidTypeError(type); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/string.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/types/string.js var string = ({ value }) => { return value; }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/_validate_flags.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/_validate_flags.js function validateFlags(ctx, opts, options = /* @__PURE__ */ new Map()) { if (!opts.flags) { return; @@ -6699,7 +6433,7 @@ function isset(flagName, flags) { return typeof flags[name] !== "undefined"; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/types/integer.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/types/integer.js var integer = (type) => { const value = Number(type.value); if (Number.isInteger(value)) { @@ -6708,7 +6442,7 @@ var integer = (type) => { throw new InvalidTypeError(type); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/flags/flags.js +// dist/dnt/esm/deps/jsr.io/@cliffy/flags/1.0.0-rc.7/flags.js var DefaultTypes = { string, number, @@ -7022,10 +6756,23 @@ function parseDefaultType(option, arg, value) { }); } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/_utils.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/_utils.js +function getFlag2(name) { + if (name.startsWith("-")) { + return name; + } + if (name.length > 1) { + return `--${name}`; + } + return `-${name}`; +} +function didYouMean2(message, type, types) { + const match = types.length ? closestString(type, types) : void 0; + return match ? `${message} "${match}"?` : ""; +} function didYouMeanCommand(command, commands, excludes = []) { const commandNames = commands.map((command2) => command2.getName()).filter((command2) => !excludes.includes(command2)); - return didYouMean(" Did you mean command", command, commandNames); + return didYouMean2(" Did you mean command", command, commandNames); } var ARGUMENT_REGEX = /^[<\[].+[\]>]$/; var ARGUMENT_DETAILS_REGEX = /[<\[:>\]]/; @@ -7103,8 +6850,11 @@ function dedent(str) { function getDescription(description, short) { return short ? description.trim().split("\n", 1)[0].trim() : dedent(description); } +function underscoreToCamelCase(str) { + return str.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase().replace(/_([a-z])/g, (g) => g[1].toUpperCase()); +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/_errors.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/_errors.js var CommandError = class _CommandError extends Error { constructor(message) { super(message); @@ -7132,7 +6882,7 @@ var ValidationError2 = class _ValidationError extends CommandError { }; var DuplicateOptionNameError = class _DuplicateOptionNameError extends CommandError { constructor(optionName, commandName) { - super(`An option with name '${bold(getFlag(optionName))}' is already registered on command '${bold(commandName)}'. If it is intended to override the option, set the '${bold("override")}' option of the '${bold("option")}' method to true.`); + super(`An option with name '${bold(getFlag2(optionName))}' is already registered on command '${bold(commandName)}'. If it is intended to override the option, set the '${bold("override")}' option of the '${bold("option")}' method to true.`); Object.setPrototypeOf(this, _DuplicateOptionNameError.prototype); } }; @@ -7214,12 +6964,6 @@ var DefaultCommandNotFoundError = class _DefaultCommandNotFoundError extends Com Object.setPrototypeOf(this, _DefaultCommandNotFoundError.prototype); } }; -var CommandExecutableNotFoundError = class _CommandExecutableNotFoundError extends CommandError { - constructor(name) { - super(`Command executable not found: ${name}`); - Object.setPrototypeOf(this, _CommandExecutableNotFoundError.prototype); - } -}; var UnknownCommandError = class _UnknownCommandError extends ValidationError2 { constructor(name, commands, excluded) { super(`Unknown command "${name}".${didYouMeanCommand(name, commands, excluded)}`); @@ -7251,54 +6995,34 @@ var TooManyArgumentsError = class _TooManyArgumentsError extends ValidationError } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/type.js -var Type = class { -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/boolean.js -var BooleanType = class extends Type { - /** Parse boolean type. */ - parse(type) { - return boolean(type); +// dist/dnt/esm/deps/jsr.io/@cliffy/internal/1.0.0-rc.7/runtime/exit.js +function exit(code2) { + const { Deno: Deno4, process: process2 } = dntGlobalThis; + const exit2 = Deno4?.exit ?? process2?.exit; + if (exit2) { + exit2(code2); } - /** Complete boolean type. */ - complete() { - return ["true", "false"]; - } -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/string.js -var StringType = class extends Type { - /** Complete string type. */ - parse(type) { - return string(type); - } -}; - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/file.js -var FileType = class extends StringType { - constructor() { - super(); - } -}; + throw new Error("unsupported runtime"); +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/integer.js -var IntegerType = class extends Type { - /** Parse integer type. */ - parse(type) { - return integer(type); - } -}; +// dist/dnt/esm/deps/jsr.io/@cliffy/internal/1.0.0-rc.7/runtime/get_args.js +function getArgs() { + const { Deno: Deno4, process: process2 } = dntGlobalThis; + return Deno4?.args ?? process2?.argv.slice(2) ?? []; +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/number.js -var NumberType = class extends Type { - /** Parse number type. */ - parse(type) { - return number(type); +// dist/dnt/esm/deps/jsr.io/@cliffy/internal/1.0.0-rc.7/runtime/get_env.js +function getEnv(name) { + const { Deno: Deno4, process: process2 } = dntGlobalThis; + if (Deno4) { + return Deno4.env.get(name); + } else if (process2) { + return process2.env[name]; } -}; + throw new Error("unsupported runtime"); +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/border.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/border.js var border = { top: "\u2500", topMid: "\u252C", @@ -7317,12 +7041,22 @@ var border = { middle: "\u2502" }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/cell.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/cell.js var Cell = class _Cell { /** Get cell length. */ get length() { return this.toString().length; } + /** + * Any unterminated ANSI formatting overflowed from previous lines of a + * multi-line cell. + */ + get unclosedAnsiRuns() { + return this.options.unclosedAnsiRuns ?? ""; + } + set unclosedAnsiRuns(val) { + this.options.unclosedAnsiRuns = val; + } /** * Create a new cell. If value is a cell, the value and all options of the cell * will be copied to the new cell. @@ -7487,7 +7221,7 @@ var Cell = class _Cell { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/column.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/column.js var Column = class _Column { constructor() { Object.defineProperty(this, "opts", { @@ -7557,8 +7291,9 @@ var Column = class _Column { } }; -// dist/dnt/esm/deps/deno.land/std@0.196.0/console/_data.js -var data_default = { +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/unicode_width.js +var tables = null; +var data = { "UNICODE_VERSION": "15.0.0", "tables": [ { @@ -7575,23 +7310,9 @@ var data_default = { } ] }; - -// dist/dnt/esm/deps/deno.land/std@0.196.0/console/_rle.js -function runLengthDecode({ d, r }) { - const data = atob(d); - const runLengths = atob(r); - let out = ""; - for (const [i, ch] of [...runLengths].entries()) { - out += data[i].repeat(ch.codePointAt(0)); - } - return Uint8Array.from([...out].map((x) => x.codePointAt(0))); -} - -// dist/dnt/esm/deps/deno.land/std@0.196.0/console/unicode_width.js -var tables = null; function lookupWidth(cp) { if (!tables) - tables = data_default.tables.map(runLengthDecode); + tables = data.tables.map(runLengthDecode); const t1Offset = tables[0][cp >> 13 & 255]; const t2Offset = tables[1][128 * t1Offset + (cp >> 6 & 127)]; const packedWidths = tables[2][16 * t2Offset + (cp >> 2 & 15)]; @@ -7599,26 +7320,35 @@ function lookupWidth(cp) { return width === 3 ? 1 : width; } var cache = /* @__PURE__ */ new Map(); -function charWidth(ch) { - if (cache.has(ch)) - return cache.get(ch); - const cp = ch.codePointAt(0); - let v = null; - if (cp < 127) { - v = cp >= 32 ? 1 : cp === 0 ? 0 : null; - } else if (cp >= 160) { - v = lookupWidth(cp); +function charWidth(char) { + if (cache.has(char)) + return cache.get(char); + const codePoint = char.codePointAt(0); + let width = null; + if (codePoint < 127) { + width = codePoint >= 32 ? 1 : codePoint === 0 ? 0 : null; + } else if (codePoint >= 160) { + width = lookupWidth(codePoint); } else { - v = null; + width = null; } - cache.set(ch, v); - return v; + cache.set(char, width); + return width; } function unicodeWidth(str) { return [...str].map((ch) => charWidth(ch) ?? 0).reduce((a, b) => a + b, 0); } +function runLengthDecode({ d, r }) { + const data2 = atob(d); + const runLengths = atob(r); + let out = ""; + for (const [i, ch] of [...runLengths].entries()) { + out += data2[i].repeat(ch.codePointAt(0)); + } + return Uint8Array.from([...out].map((x) => x.codePointAt(0))); +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/_utils.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/_utils.js function longest(index, rows, maxWidth) { const cellLengths = rows.map((row) => { const cell = row[index]; @@ -7631,10 +7361,37 @@ function longest(index, rows, maxWidth) { return Math.max(...cellLengths); } var strLength = (str) => { - return unicodeWidth(stripColor(str)); + return unicodeWidth(stripAnsiCode(str)); }; +var ansiRegexSource = ( + // deno-lint-ignore no-control-regex + /\x1b\[(?:(?<_0>0)|(?<_22>1|2|22)|(?<_23>3|23)|(?<_24>4|24)|(?<_27>7|27)|(?<_28>8|28)|(?<_29>9|29)|(?<_39>30|31|32|33|34|35|36|37|38;2;\d+;\d+;\d+|38;5;\d+|39|90|91|92|93|94|95|96|97)|(?<_49>40|41|42|43|44|45|46|47|48;2;\d+;\d+;\d+|48;5;\d+|49|100|101|102|103|104|105|106|107))m/.source +); +function getUnclosedAnsiRuns(text) { + const tokens = []; + for (const { groups } of text.matchAll(new RegExp(ansiRegexSource, "g"))) { + const [_kind, content] = Object.entries(groups).find(([_, val]) => val); + tokens.push({ kind: _kind.slice(1), content }); + } + let unclosed = []; + for (const token of tokens) { + unclosed = [...unclosed.filter((y) => y.kind !== token.kind), token]; + } + unclosed = unclosed.filter(({ content, kind }) => content !== kind); + const currentSuffix = unclosed.map(({ kind }) => `\x1B[${kind}m`).reverse().join(""); + const nextPrefix = unclosed.map(({ content }) => `\x1B[${content}m`).join(""); + return { + /** The suffix to be appended to the text to close all unclosed runs. */ + currentSuffix, + /** + * The prefix to be appended to the next segment to continue unclosed + * runs if the input text forms the first segment of a multi-line string. + */ + nextPrefix + }; +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/consume_words.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/consume_words.js function consumeWords(length, content) { let consumed = ""; const words = content.split("\n")[0]?.split(/ /g); @@ -7651,8 +7408,25 @@ function consumeWords(length, content) { } return consumed; } +function consumeChars(length, content) { + let consumed = ""; + const chars = [ + ...content.split("\n")[0].matchAll(new RegExp(`(?:${ansiRegexSource})+|.`, "gu")) + ].map(([match]) => match); + for (const char of chars) { + if (consumed) { + const nextLength = strLength(char); + const consumedLength = strLength(consumed); + if (consumedLength + nextLength > length) { + break; + } + } + consumed += char; + } + return consumed; +} -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/row.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/row.js var Row = class _Row extends Array { constructor() { super(...arguments); @@ -7726,7 +7500,7 @@ var Row = class _Row extends Array { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/_layout.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/_layout.js var __classPrivateFieldGet = function(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); @@ -7975,7 +7749,7 @@ var TableLayout = class { } } const { current, next } = this.renderCellValue(cell, maxLength); - row[colIndex].setValue(next.getValue()); + row[colIndex].setValue(next); if (opts.hasBorder) { result += " ".repeat(opts.padding[colIndex]); } @@ -7996,9 +7770,13 @@ var TableLayout = class { let words = consumeWords(length, cell.toString()); const breakWord = strLength(words) > length; if (breakWord) { - words = words.slice(0, length); + words = consumeChars(length, words); } const next = cell.toString().slice(words.length + (breakWord ? 0 : 1)); + words = cell.unclosedAnsiRuns + words; + const { currentSuffix, nextPrefix } = getUnclosedAnsiRuns(words); + words += currentSuffix; + cell.unclosedAnsiRuns = nextPrefix; const fillLength = maxLength - strLength(words); const align = cell.getAlign(); let current; @@ -8013,10 +7791,7 @@ var TableLayout = class { } else { throw new Error("Unknown direction: " + align); } - return { - current, - next: cell.clone(next) - }; + return { current, next }; } /** * Render border row. @@ -8193,7 +7968,7 @@ _TableLayout_instances = /* @__PURE__ */ new WeakSet(), _TableLayout_getRows = f }); }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/table/table.js +// dist/dnt/esm/deps/jsr.io/@cliffy/table/1.0.0-rc.7/table.js var Table = class _Table extends Array { constructor() { super(...arguments); @@ -8471,7 +8246,17 @@ Object.defineProperty(Table, "_chars", { value: { ...border } }); -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/help/_help_generator.js +// dist/dnt/esm/deps/jsr.io/@cliffy/internal/1.0.0-rc.7/runtime/inspect.js +function inspect(value, colors2) { + const { Deno: Deno4 } = dntGlobalThis; + return Deno4?.inspect(value, { depth: 1, colors: colors2, trailingComma: false }) ?? JSON.stringify(value, null, 2); +} + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/type.js +var Type = class { +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/help/_help_generator.js var HelpGenerator = class _HelpGenerator { /** Generate help text for given command. */ static generate(cmd, options) { @@ -8645,7 +8430,7 @@ var HelpGenerator = class _HelpGenerator { return ""; } return this.label("Examples") + Table.from(examples.map((example) => [ - dim(bold(`${capitalize(example.name)}:`)), + dim(bold(example.name)), dedent(example.description) ])).padding(1).indent(this.indent).maxColWidth(150).toString() + "\n"; } @@ -8656,13 +8441,13 @@ var HelpGenerator = class _HelpGenerator { const hints = []; option.required && hints.push(yellow(`required`)); if (typeof option.default !== "undefined") { - const defaultValue = getDefaultValue(option); + const defaultValue = typeof option.default === "function" ? option.default() : option.default; if (typeof defaultValue !== "undefined") { hints.push(bold(`Default: `) + inspect(defaultValue, this.options.colors)); } } - option.depends?.length && hints.push(yellow(bold(`Depends: `)) + italic(option.depends.map(getFlag).join(", "))); - option.conflicts?.length && hints.push(red(bold(`Conflicts: `)) + italic(option.conflicts.map(getFlag).join(", "))); + option.depends?.length && hints.push(yellow(bold(`Depends: `)) + italic(option.depends.map(getFlag2).join(", "))); + option.conflicts?.length && hints.push(red(bold(`Conflicts: `)) + italic(option.conflicts.map(getFlag2).join(", "))); const type = this.cmd.getType(option.args[0]?.type)?.handler; if (type instanceof Type) { const possibleValues = type.values?.(this.cmd, this.cmd.getParent()); @@ -8679,16 +8464,6 @@ var HelpGenerator = class _HelpGenerator { return "\n" + bold(`${label}:`) + "\n\n"; } }; -function capitalize(string2) { - return string2?.charAt(0).toUpperCase() + string2.slice(1); -} -function inspect(value, colors2) { - return import_shim_deno2.Deno.inspect( - value, - // deno < 1.4.3 doesn't support the colors property. - { depth: 1, colors: colors2, trailingComma: false } - ); -} function highlightArguments(argsDefinition, types = true) { if (!argsDefinition) { return ""; @@ -8716,7 +8491,50 @@ function highlightArgumentDetails(arg, types = true) { return str; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/upgrade/_check_version.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/boolean.js +var BooleanType = class extends Type { + /** Parse boolean type. */ + parse(type) { + return boolean(type); + } + /** Complete boolean type. */ + complete() { + return ["true", "false"]; + } +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/string.js +var StringType = class extends Type { + /** Complete string type. */ + parse(type) { + return string(type); + } +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/file.js +var FileType = class extends StringType { + constructor() { + super(); + } +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/integer.js +var IntegerType = class extends Type { + /** Parse integer type. */ + parse(type) { + return integer(type); + } +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/number.js +var NumberType = class extends Type { + /** Parse number type. */ + parse(type) { + return number(type); + } +}; + +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/upgrade/_check_version.js async function checkVersion(cmd) { const mainCommand = cmd.getMainCommand(); const upgradeCommand = mainCommand.getCommand("upgrade"); @@ -8725,7 +8543,7 @@ async function checkVersion(cmd) { } const latestVersion = await upgradeCommand.getLatestVersion(); const currentVersion = mainCommand.getVersion(); - if (currentVersion === latestVersion) { + if (!currentVersion || currentVersion === latestVersion) { return; } const versionHelpText = `(New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`; @@ -8735,7 +8553,7 @@ function isUpgradeCommand(command) { return command instanceof Command && "getLatestVersion" in command; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/command.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/command.js var Command = class _Command { constructor() { Object.defineProperty(this, "types", { @@ -8852,12 +8670,6 @@ var Command = class _Command { writable: true, value: void 0 }); - Object.defineProperty(this, "isExecutable", { - enumerable: true, - configurable: true, - writable: true, - value: false - }); Object.defineProperty(this, "throwOnError", { enumerable: true, configurable: true, @@ -9140,15 +8952,10 @@ var Command = class _Command { this.cmd.isGlobal = true; return this; } - /** Make command executable. */ - executable() { - this.cmd.isExecutable = true; - return this; - } /** - * Set command arguments: + * Set command arguments. * - * [optionalArg: number] [...restArgs:string] + * Syntax: ` [optionalArg: number] [...restArgs:string]` */ arguments(args) { this.cmd.argsDefinition = args; @@ -9267,7 +9074,7 @@ var Command = class _Command { return this; } /** - * Throw validation errors instead of calling `Deno.exit()` to handle + * Throw validation errors instead of calling `exit()` to handle * validation errors manually. * * A validation error is thrown when the command is wrongly used by the user. @@ -9316,7 +9123,7 @@ var Command = class _Command { return this.errorHandler ?? this._parent?.errorHandler; } /** - * Same as `.throwErrors()` but also prevents calling `Deno.exit` after + * Same as `.throwErrors()` but also prevents calling `exit()` after * printing help or version with the --help and --version option. */ noExit() { @@ -9476,7 +9283,7 @@ var Command = class _Command { * * @param args Command line args to parse. Ex: `cmd.parse( Deno.args )` */ - parse(args = import_shim_deno2.Deno.args) { + parse(args = getArgs()) { const ctx = { unknown: args.slice(), flags: {}, @@ -9494,10 +9301,7 @@ var Command = class _Command { this.reset(); this.registerDefaults(); this.rawArgs = ctx.unknown.slice(); - if (this.isExecutable) { - await this.executeExecutable(ctx.unknown); - return { options: {}, args: [], cmd: this, literal: [] }; - } else if (this._useRawArgs) { + if (this._useRawArgs) { await this.parseEnvVars(ctx, this.envVars); return await this.execute(ctx.env, ctx.unknown); } @@ -9527,14 +9331,14 @@ var Command = class _Command { this.literalArgs = ctx.literal; if (ctx.actions.length) { await Promise.all(ctx.actions.map((action) => action.call(this, options, ...args))); - } - if (ctx.standalone) { - return { - options, - args, - cmd: this, - literal: this.literalArgs - }; + if (ctx.standalone) { + return { + options, + args, + cmd: this, + literal: this.literalArgs + }; + } } return await this.execute(options, args); } catch (error) { @@ -9655,28 +9459,6 @@ var Command = class _Command { } await this.globalActionHandler?.(options, ...args); } - /** - * Execute external sub-command. - * @param args Raw command line arguments. - */ - async executeExecutable(args) { - const command = this.getPath().replace(/\s+/g, "-"); - await import_shim_deno2.Deno.permissions.request({ name: "run", command }); - try { - const cmd = new import_shim_deno2.Deno.Command(command, { - args - }); - const output = await cmd.output(); - if (!output.success) { - import_shim_deno2.Deno.exit(output.code); - } - } catch (error) { - if (error instanceof import_shim_deno2.Deno.errors.NotFound) { - throw new CommandExecutableNotFoundError(command); - } - throw error; - } - } /** Parse raw command line arguments. */ parseOptions(ctx, options, { stopEarly = this._stopEarly, stopOnUnknown = false, dotted = true } = {}) { parseFlags(ctx, { @@ -9736,12 +9518,12 @@ var Command = class _Command { } async findEnvVar(names) { for (const name of names) { - const status = await import_shim_deno2.Deno.permissions.query({ + const status = await dntGlobalThis.Deno?.permissions.query({ name: "env", variable: name }); - if (status.state === "granted") { - const value = import_shim_deno2.Deno.env.get(name); + if (!status || status.state === "granted") { + const value = getEnv(name); if (value) { return { name, value }; } @@ -9822,7 +9604,7 @@ var Command = class _Command { } /** * Handle error. If `throwErrors` is enabled the error will be thrown, - * otherwise a formatted error message will be printed and `Deno.exit(1)` + * otherwise a formatted error message will be printed and `exit(1)` * will be called. This will also trigger registered error handlers. * * @param error The error to handle. @@ -9838,7 +9620,7 @@ var Command = class _Command { this.showHelp(); console.error(red(` ${bold("error")}: ${error.message} `)); - import_shim_deno2.Deno.exit(error instanceof ValidationError2 ? error.exitCode : 1); + exit(error instanceof ValidationError2 ? error.exitCode : 1); } /***************************************************************************** **** GETTER ***************************************************************** @@ -9957,7 +9739,7 @@ ${bold(k)} ${brightBlue(v)}`).join(""); } exit(code2 = 0) { if (this.shouldExit()) { - import_shim_deno2.Deno.exit(code2); + exit(code2); } } /***************************************************************************** @@ -10421,11 +10203,11 @@ function findFlag(flags) { return flags[0]; } -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/child_command.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/child_command.js var _ChildCommandType_cmd; _ChildCommandType_cmd = /* @__PURE__ */ new WeakMap(); -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/types/enum.js +// dist/dnt/esm/deps/jsr.io/@cliffy/command/1.0.0-rc.7/types/enum.js var EnumType = class extends Type { constructor(values) { super(); @@ -10453,22 +10235,6 @@ var EnumType = class extends Type { } }; -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/bash.js -var _BashCompletionsCommand_cmd; -_BashCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/fish.js -var _FishCompletionsCommand_cmd; -_FishCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/zsh.js -var _ZshCompletionsCommand_cmd; -_ZshCompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - -// dist/dnt/esm/deps/deno.land/x/cliffy@v1.0.0-rc.3/command/completions/completions_command.js -var _CompletionsCommand_cmd; -_CompletionsCommand_cmd = /* @__PURE__ */ new WeakMap(); - // dist/dnt/esm/gh-wrapper/exec.js async function exec2(args) { const process2 = import_shim_deno2.Deno.run({ @@ -10756,13 +10522,13 @@ async function resolveRepo(repo) { // dist/dnt/esm/core/search_tags.js async function searchTag(tags, histories) { if (0 < tags.size) { - let distance2 = 0; + let distance = 0; for await (const commit of histories) { const tag = tags.get(commit); if (tag) { - return { tag, distance: distance2 }; + return { tag, distance }; } else { - distance2++; + distance++; } } } @@ -10778,11 +10544,11 @@ function MSB(x) { } return r; } -function createDescribe(tag, distance2, sha, shortShaChars) { - if (distance2 === 0) { +function createDescribe(tag, distance, sha, shortShaChars) { + if (distance === 0) { return tag; } else { - return `${tag}-${distance2}-g${sha.substring(0, shortShaChars)}`; + return `${tag}-${distance}-g${sha.substring(0, shortShaChars)}`; } } async function ghDescribe(options) { @@ -10794,23 +10560,23 @@ async function ghDescribe(options) { const sha2 = await fetchSha({ owner, repo, host, sha: commitish }); const histories2 = fetchHistory({ owner, repo, host, sha: sha2 }); const commitCount = await fetchTotalCommit({ owner, repo, host, sha: sha2 }); - const distance3 = MSB(commitCount) + 1; - const shortShaChars2 = Math.max(7, Math.round((distance3 + 1) / 2)); + const distance2 = MSB(commitCount) + 1; + const shortShaChars2 = Math.max(7, Math.round((distance2 + 1) / 2)); return { sha: sha2, histories: histories2, shortShaChars: shortShaChars2 }; })() ]); - const { distance: distance2, tag } = await searchTag(tags, histories) || { + const { distance, tag } = await searchTag(tags, histories) || { distance: 0, tag: defaultTag }; if (!tag) { throw new GhDescribeError("No names found, cannot describe anything."); } - const describe2 = createDescribe(tag, distance2, sha, shortShaChars); + const describe2 = createDescribe(tag, distance, sha, shortShaChars); return { describe: describe2, tag, - distance: distance2, + distance, sha, shortSha: sha.substring(0, shortShaChars) };