diff --git a/deno.jsonc b/deno.json similarity index 88% rename from deno.jsonc rename to deno.json index abd2d60..c63697d 100644 --- a/deno.jsonc +++ b/deno.json @@ -1,11 +1,13 @@ { "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json", + "version": "v0.1.5", "imports": { "@/": "./src/", "@schemas/": "./schemas/", "@test/": "./test/", "cliffy-command": "https://deno.land/x/cliffy@v1.0.0-rc.3/command/mod.ts", "cliffy-table": "https://deno.land/x/cliffy@v1.0.0-rc.3/table/mod.ts", + "@polyseam/cliffy-provider-gh-releases": "jsr:@polyseam/cliffy-provider-gh-releases@^0.3.0", "log": "https://deno.land/std@0.204.0/log/mod.ts", "path": "https://deno.land/std@0.204.0/path/mod.ts", "sqlite": "https://deno.land/x/sqlite@v3.8/mod.ts", diff --git a/deno.lock b/deno.lock index 952d658..b4f4acb 100644 --- a/deno.lock +++ b/deno.lock @@ -2,17 +2,396 @@ "version": "3", "packages": { "specifiers": { + "jsr:@cliffy/ansi@^1.0.0-rc.4": "jsr:@cliffy/ansi@1.0.0-rc.4", + "jsr:@cliffy/command@^1.0.0-rc.4": "jsr:@cliffy/command@1.0.0-rc.4", + "jsr:@cliffy/flags@1.0.0-rc.4": "jsr:@cliffy/flags@1.0.0-rc.4", + "jsr:@cliffy/table@1.0.0-rc.4": "jsr:@cliffy/table@1.0.0-rc.4", + "jsr:@polyseam/cliffy-provider-gh-releases@^0.3.0": "jsr:@polyseam/cliffy-provider-gh-releases@0.3.0", + "jsr:@polyseam/inflate-response@^1.1.2": "jsr:@polyseam/inflate-response@1.1.2", + "jsr:@std/archive@0.214.0": "jsr:@std/archive@0.214.0", + "jsr:@std/assert@^0.214.0": "jsr:@std/assert@0.214.0", + "jsr:@std/assert@^0.221.0": "jsr:@std/assert@0.221.0", + "jsr:@std/bytes@^0.214.0": "jsr:@std/bytes@0.214.0", + "jsr:@std/cli@^0.221.0": "jsr:@std/cli@0.221.0", + "jsr:@std/console@0.221": "jsr:@std/console@0.221.0", + "jsr:@std/encoding@0.221": "jsr:@std/encoding@0.221.0", + "jsr:@std/fmt@0.221": "jsr:@std/fmt@0.221.0", + "jsr:@std/fs@0.214.0": "jsr:@std/fs@0.214.0", + "jsr:@std/fs@^0.221.0": "jsr:@std/fs@0.221.0", + "jsr:@std/io@0.214.0": "jsr:@std/io@0.214.0", + "jsr:@std/io@0.221": "jsr:@std/io@0.221.0", + "jsr:@std/io@^0.214.0": "jsr:@std/io@0.214.0", + "jsr:@std/path@0.214.0": "jsr:@std/path@0.214.0", + "jsr:@std/path@^0.214.0": "jsr:@std/path@0.214.0", + "jsr:@std/path@^0.221.0": "jsr:@std/path@0.221.0", + "jsr:@std/semver@^0.221.0": "jsr:@std/semver@0.221.0", + "jsr:@std/text@0.221": "jsr:@std/text@0.221.0", + "npm:@octokit/types@^13.4.1": "npm:@octokit/types@13.5.0", "npm:@scure/base@1.1.3": "npm:@scure/base@1.1.3", "npm:ejs@3.1.9": "npm:ejs@3.1.9", "npm:jsonpatch@3.1.0": "npm:jsonpatch@3.1.0", "npm:jsonschema@1.4.1": "npm:jsonschema@1.4.1", - "npm:just-diff@6.0.2": "npm:just-diff@6.0.2" + "npm:just-diff@6.0.2": "npm:just-diff@6.0.2", + "npm:octokit@^3.1.2": "npm:octokit@3.2.0_@octokit+core@5.2.0" + }, + "jsr": { + "@cliffy/ansi@1.0.0-rc.4": { + "integrity": "df561b6a69bb5177c31618c027274504ed24b996b854fa072eb7d0a380e41ac1", + "dependencies": [ + "jsr:@std/encoding@0.221", + "jsr:@std/fmt@0.221", + "jsr:@std/io@0.221" + ] + }, + "@cliffy/command@1.0.0-rc.4": { + "integrity": "709884ffe0f53ce3edafa92b58223634397878fbf6dcabe0c74ea0108273b9f7", + "dependencies": [ + "jsr:@cliffy/flags@1.0.0-rc.4", + "jsr:@cliffy/table@1.0.0-rc.4", + "jsr:@std/fmt@0.221", + "jsr:@std/text@0.221" + ] + }, + "@cliffy/flags@1.0.0-rc.4": { + "integrity": "29f370ade4ddf6e150a4d25fc44661234c19870ffcf7fb07cd100f1843fcd6e1" + }, + "@cliffy/table@1.0.0-rc.4": { + "integrity": "990e4e0b3910e6c9cf7a5b4318b8f5e121cf681494c94fd113febb9b4d4c0741", + "dependencies": [ + "jsr:@std/console@0.221" + ] + }, + "@polyseam/cliffy-provider-gh-releases@0.3.0": { + "integrity": "52254879592ae6b293c1387252fecafe06afbfad803239e60a54897e16585907", + "dependencies": [ + "jsr:@cliffy/ansi@^1.0.0-rc.4", + "jsr:@cliffy/command@^1.0.0-rc.4", + "jsr:@polyseam/inflate-response@^1.1.2", + "jsr:@std/cli@^0.221.0", + "jsr:@std/fs@^0.221.0", + "jsr:@std/semver@^0.221.0", + "npm:@octokit/types@^13.4.1", + "npm:octokit@^3.1.2" + ] + }, + "@polyseam/inflate-response@1.1.2": { + "integrity": "ef7e85c4528b36b7649cfa4f4ca44215eec4c690b6d5c376cfa2e037d4af4385", + "dependencies": [ + "jsr:@std/archive@0.214.0", + "jsr:@std/fs@0.214.0", + "jsr:@std/io@0.214.0", + "jsr:@std/path@0.214.0" + ] + }, + "@std/archive@0.214.0": { + "integrity": "298d3f1f820cac72dfbc4a716e058655758015385ad116a247b9605c7103d89f", + "dependencies": [ + "jsr:@std/io@^0.214.0" + ] + }, + "@std/assert@0.214.0": { + "integrity": "55d398de76a9828fd3b1aa653f4dba3eee4c6985d90c514865d2be9bd082b140" + }, + "@std/assert@0.221.0": { + "integrity": "a5f1aa6e7909dbea271754fd4ab3f4e687aeff4873b4cef9a320af813adb489a" + }, + "@std/bytes@0.214.0": { + "integrity": "eba2a06824fd22b9cb1214c53988ad57431177497e6198ba0ff8ab207dae996f" + }, + "@std/cli@0.221.0": { + "integrity": "157c2f881f0f85a73d994e7668754aeeccdf597680bd9c65de9c6bcd670416ac" + }, + "@std/console@0.221.0": { + "integrity": "8f2afc1f3f14f5d6039c0c767f057e4aa1897d2210e167c4667cb155cafb9d11" + }, + "@std/encoding@0.221.0": { + "integrity": "d1dd76ef0dc5d14088411e6dc1dede53bf8308c95d1537df1214c97137208e45" + }, + "@std/fmt@0.221.0": { + "integrity": "379fed69bdd9731110f26b9085aeb740606b20428ce6af31ef6bd45ef8efa62a" + }, + "@std/fs@0.214.0": { + "integrity": "bc880fea0be120cb1550b1ed7faf92fe071003d83f2456a1e129b39193d85bea", + "dependencies": [ + "jsr:@std/path@^0.214.0" + ] + }, + "@std/fs@0.221.0": { + "integrity": "028044450299de8ed5a716ade4e6d524399f035513b85913794f4e81f07da286", + "dependencies": [ + "jsr:@std/assert@^0.221.0", + "jsr:@std/path@^0.221.0" + ] + }, + "@std/io@0.214.0": { + "integrity": "81563289d48830f966a5c607841fb5b7048874e0368f873d6148776de0a1e890", + "dependencies": [ + "jsr:@std/bytes@^0.214.0" + ] + }, + "@std/io@0.221.0": { + "integrity": "faf7f8700d46ab527fa05cc6167f4b97701a06c413024431c6b4d207caa010da" + }, + "@std/path@0.214.0": { + "integrity": "d5577c0b8d66f7e8e3586d864ebdf178bb326145a3611da5a51c961740300285", + "dependencies": [ + "jsr:@std/assert@^0.214.0" + ] + }, + "@std/path@0.221.0": { + "integrity": "0a36f6b17314ef653a3a1649740cc8db51b25a133ecfe838f20b79a56ebe0095" + }, + "@std/semver@0.221.0": { + "integrity": "836a446cd1d054d08c7498c243199ddf0b604740d72dec56df96e2833413f039" + }, + "@std/text@0.221.0": { + "integrity": "a2f89ceb0d8851cd33e6774064621a1da9fbc36578cf4f02c5b5bcd7e8c84b67" + } }, "npm": { + "@octokit/app@14.1.0_@octokit+core@5.2.0": { + "integrity": "sha512-g3uEsGOQCBl1+W1rgfwoRFUIR6PtvB2T1E4RpygeUU5LrLvlOqcxrt5lfykIeRpUPpupreGJUYl70fqMDXdTpw==", + "dependencies": { + "@octokit/auth-app": "@octokit/auth-app@6.1.1", + "@octokit/auth-unauthenticated": "@octokit/auth-unauthenticated@5.0.1", + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/oauth-app": "@octokit/oauth-app@6.1.0", + "@octokit/plugin-paginate-rest": "@octokit/plugin-paginate-rest@9.2.1_@octokit+core@5.2.0", + "@octokit/types": "@octokit/types@12.6.0", + "@octokit/webhooks": "@octokit/webhooks@12.2.0" + } + }, + "@octokit/auth-app@6.1.1": { + "integrity": "sha512-VrTtzRpyuT5nYGUWeGWQqH//hqEZDV+/yb6+w5wmWpmmUA1Tx950XsAc2mBBfvusfcdF2E7w8jZ1r1WwvfZ9pA==", + "dependencies": { + "@octokit/auth-oauth-app": "@octokit/auth-oauth-app@7.1.0", + "@octokit/auth-oauth-user": "@octokit/auth-oauth-user@4.1.0", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@13.5.0", + "deprecation": "deprecation@2.3.1", + "lru-cache": "lru-cache@10.2.2", + "universal-github-app-jwt": "universal-github-app-jwt@1.1.2", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/auth-oauth-app@7.1.0": { + "integrity": "sha512-w+SyJN/b0l/HEb4EOPRudo7uUOSW51jcK1jwLa+4r7PA8FPFpoxEnHBHMITqCsc/3Vo2qqFjgQfz/xUUvsSQnA==", + "dependencies": { + "@octokit/auth-oauth-device": "@octokit/auth-oauth-device@6.1.0", + "@octokit/auth-oauth-user": "@octokit/auth-oauth-user@4.1.0", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/types": "@octokit/types@13.5.0", + "@types/btoa-lite": "@types/btoa-lite@1.0.2", + "btoa-lite": "btoa-lite@1.0.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/auth-oauth-device@6.1.0": { + "integrity": "sha512-FNQ7cb8kASufd6Ej4gnJ3f1QB5vJitkoV1O0/g6e6lUsQ7+VsSNRHRmFScN2tV4IgKA12frrr/cegUs0t+0/Lw==", + "dependencies": { + "@octokit/oauth-methods": "@octokit/oauth-methods@4.1.0", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/types": "@octokit/types@13.5.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/auth-oauth-user@4.1.0": { + "integrity": "sha512-FrEp8mtFuS/BrJyjpur+4GARteUCrPeR/tZJzD8YourzoVhRics7u7we/aDcKv+yywRNwNi/P4fRi631rG/OyQ==", + "dependencies": { + "@octokit/auth-oauth-device": "@octokit/auth-oauth-device@6.1.0", + "@octokit/oauth-methods": "@octokit/oauth-methods@4.1.0", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/types": "@octokit/types@13.5.0", + "btoa-lite": "btoa-lite@1.0.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/auth-token@4.0.0": { + "integrity": "sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==", + "dependencies": {} + }, + "@octokit/auth-unauthenticated@5.0.1": { + "integrity": "sha512-oxeWzmBFxWd+XolxKTc4zr+h3mt+yofn4r7OfoIkR/Cj/o70eEGmPsFbueyJE2iBAGpjgTnEOKM3pnuEGVmiqg==", + "dependencies": { + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@12.6.0" + } + }, + "@octokit/core@5.2.0": { + "integrity": "sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==", + "dependencies": { + "@octokit/auth-token": "@octokit/auth-token@4.0.0", + "@octokit/graphql": "@octokit/graphql@7.1.0", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@13.5.0", + "before-after-hook": "before-after-hook@2.2.3", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/endpoint@9.0.5": { + "integrity": "sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==", + "dependencies": { + "@octokit/types": "@octokit/types@13.5.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/graphql@7.1.0": { + "integrity": "sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==", + "dependencies": { + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/types": "@octokit/types@13.5.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/oauth-app@6.1.0": { + "integrity": "sha512-nIn/8eUJ/BKUVzxUXd5vpzl1rwaVxMyYbQkNZjHrF7Vk/yu98/YDF/N2KeWO7uZ0g3b5EyiFXFkZI8rJ+DH1/g==", + "dependencies": { + "@octokit/auth-oauth-app": "@octokit/auth-oauth-app@7.1.0", + "@octokit/auth-oauth-user": "@octokit/auth-oauth-user@4.1.0", + "@octokit/auth-unauthenticated": "@octokit/auth-unauthenticated@5.0.1", + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/oauth-authorization-url": "@octokit/oauth-authorization-url@6.0.2", + "@octokit/oauth-methods": "@octokit/oauth-methods@4.1.0", + "@types/aws-lambda": "@types/aws-lambda@8.10.137", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/oauth-authorization-url@6.0.2": { + "integrity": "sha512-CdoJukjXXxqLNK4y/VOiVzQVjibqoj/xHgInekviUJV73y/BSIcwvJ/4aNHPBPKcPWFnd4/lO9uqRV65jXhcLA==", + "dependencies": {} + }, + "@octokit/oauth-methods@4.1.0": { + "integrity": "sha512-4tuKnCRecJ6CG6gr0XcEXdZtkTDbfbnD5oaHBmLERTjTMZNi2CbfEHZxPU41xXLDG4DfKf+sonu00zvKI9NSbw==", + "dependencies": { + "@octokit/oauth-authorization-url": "@octokit/oauth-authorization-url@6.0.2", + "@octokit/request": "@octokit/request@8.4.0", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@13.5.0", + "btoa-lite": "btoa-lite@1.0.0" + } + }, + "@octokit/openapi-types@20.0.0": { + "integrity": "sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==", + "dependencies": {} + }, + "@octokit/openapi-types@22.2.0": { + "integrity": "sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==", + "dependencies": {} + }, + "@octokit/plugin-paginate-graphql@4.0.1_@octokit+core@5.2.0": { + "integrity": "sha512-R8ZQNmrIKKpHWC6V2gum4x9LG2qF1RxRjo27gjQcG3j+vf2tLsEfE7I/wRWEPzYMaenr1M+qDAtNcwZve1ce1A==", + "dependencies": { + "@octokit/core": "@octokit/core@5.2.0" + } + }, + "@octokit/plugin-paginate-rest@9.2.1_@octokit+core@5.2.0": { + "integrity": "sha512-wfGhE/TAkXZRLjksFXuDZdmGnJQHvtU/joFQdweXUgzo1XwvBCD4o4+75NtFfjfLK5IwLf9vHTfSiU3sLRYpRw==", + "dependencies": { + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/types": "@octokit/types@12.6.0" + } + }, + "@octokit/plugin-rest-endpoint-methods@10.4.1_@octokit+core@5.2.0": { + "integrity": "sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==", + "dependencies": { + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/types": "@octokit/types@12.6.0" + } + }, + "@octokit/plugin-retry@6.0.1_@octokit+core@5.2.0": { + "integrity": "sha512-SKs+Tz9oj0g4p28qkZwl/topGcb0k0qPNX/i7vBKmDsjoeqnVfFUquqrE/O9oJY7+oLzdCtkiWSXLpLjvl6uog==", + "dependencies": { + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@12.6.0", + "bottleneck": "bottleneck@2.19.5" + } + }, + "@octokit/plugin-throttling@8.2.0_@octokit+core@5.2.0": { + "integrity": "sha512-nOpWtLayKFpgqmgD0y3GqXafMFuKcA4tRPZIfu7BArd2lEZeb1988nhWhwx4aZWmjDmUfdgVf7W+Tt4AmvRmMQ==", + "dependencies": { + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/types": "@octokit/types@12.6.0", + "bottleneck": "bottleneck@2.19.5" + } + }, + "@octokit/request-error@5.1.0": { + "integrity": "sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==", + "dependencies": { + "@octokit/types": "@octokit/types@13.5.0", + "deprecation": "deprecation@2.3.1", + "once": "once@1.4.0" + } + }, + "@octokit/request@8.4.0": { + "integrity": "sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==", + "dependencies": { + "@octokit/endpoint": "@octokit/endpoint@9.0.5", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@13.5.0", + "universal-user-agent": "universal-user-agent@6.0.1" + } + }, + "@octokit/types@12.6.0": { + "integrity": "sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==", + "dependencies": { + "@octokit/openapi-types": "@octokit/openapi-types@20.0.0" + } + }, + "@octokit/types@13.5.0": { + "integrity": "sha512-HdqWTf5Z3qwDVlzCrP8UJquMwunpDiMPt5er+QjGzL4hqr/vBVY/MauQgS1xWxCDT1oMx1EULyqxncdCY/NVSQ==", + "dependencies": { + "@octokit/openapi-types": "@octokit/openapi-types@22.2.0" + } + }, + "@octokit/webhooks-methods@4.1.0": { + "integrity": "sha512-zoQyKw8h9STNPqtm28UGOYFE7O6D4Il8VJwhAtMHFt2C4L0VQT1qGKLeefUOqHNs1mNRYSadVv7x0z8U2yyeWQ==", + "dependencies": {} + }, + "@octokit/webhooks-types@7.4.0": { + "integrity": "sha512-FE2V+QZ2UYlh+9wWd5BPLNXG+J/XUD/PPq0ovS+nCcGX4+3qVbi3jYOmCTW48hg9SBBLtInx9+o7fFt4H5iP0Q==", + "dependencies": {} + }, + "@octokit/webhooks@12.2.0": { + "integrity": "sha512-CyuLJ0/P7bKZ+kIYw+fnkeVdhUzNuDKgNSI7pU/m7Nod0T7kP+s4s2f0pNmG9HL8/RZN1S0ZWTDll3VTMrFLAw==", + "dependencies": { + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/webhooks-methods": "@octokit/webhooks-methods@4.1.0", + "@octokit/webhooks-types": "@octokit/webhooks-types@7.4.0", + "aggregate-error": "aggregate-error@3.1.0" + } + }, "@scure/base@1.1.3": { "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", "dependencies": {} }, + "@types/aws-lambda@8.10.137": { + "integrity": "sha512-YNFwzVarXAOXkjuFxONyDw1vgRNzyH8AuyN19s0bM+ChSu/bzxb5XPxYFLXoqoM+tvgzwR3k7fXcEOW125yJxg==", + "dependencies": {} + }, + "@types/btoa-lite@1.0.2": { + "integrity": "sha512-ZYbcE2x7yrvNFJiU7xJGrpF/ihpkM7zKgw8bha3LNJSesvTtUNxbpzaT7WXBIryf6jovisrxTBvymxMeLLj1Mg==", + "dependencies": {} + }, + "@types/jsonwebtoken@9.0.6": { + "integrity": "sha512-/5hndP5dCjloafCXns6SZyESp3Ldq7YjH3zwzwczYnjxIT0Fqzk5ROSYVGfFyczIue7IUEj8hkvLbPoLQ18vQw==", + "dependencies": { + "@types/node": "@types/node@18.16.19" + } + }, + "@types/node@18.16.19": { + "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", + "dependencies": {} + }, + "aggregate-error@3.1.0": { + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dependencies": { + "clean-stack": "clean-stack@2.2.0", + "indent-string": "indent-string@4.0.0" + } + }, "ansi-styles@4.3.0": { "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": { @@ -27,6 +406,14 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dependencies": {} }, + "before-after-hook@2.2.3": { + "integrity": "sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==", + "dependencies": {} + }, + "bottleneck@2.19.5": { + "integrity": "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==", + "dependencies": {} + }, "brace-expansion@1.1.11": { "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dependencies": { @@ -40,6 +427,14 @@ "balanced-match": "balanced-match@1.0.2" } }, + "btoa-lite@1.0.0": { + "integrity": "sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA==", + "dependencies": {} + }, + "buffer-equal-constant-time@1.0.1": { + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "dependencies": {} + }, "chalk@4.1.2": { "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dependencies": { @@ -47,6 +442,10 @@ "supports-color": "supports-color@7.2.0" } }, + "clean-stack@2.2.0": { + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dependencies": {} + }, "color-convert@2.0.1": { "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": { @@ -61,6 +460,16 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dependencies": {} }, + "deprecation@2.3.1": { + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dependencies": {} + }, + "ecdsa-sig-formatter@1.0.11": { + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "safe-buffer@5.2.1" + } + }, "ejs@3.1.9": { "integrity": "sha512-rC+QVNMJWv+MtPgkt0y+0rVEIdbtxVADApW9JXrUVlzHetgcyczP/E7DJmWJ4fJCZF2cPcBk0laWO9ZHMG3DmQ==", "dependencies": { @@ -77,6 +486,10 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dependencies": {} }, + "indent-string@4.0.0": { + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dependencies": {} + }, "jake@10.8.7": { "integrity": "sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==", "dependencies": { @@ -94,10 +507,78 @@ "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", "dependencies": {} }, + "jsonwebtoken@9.0.2": { + "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", + "dependencies": { + "jws": "jws@3.2.2", + "lodash.includes": "lodash.includes@4.3.0", + "lodash.isboolean": "lodash.isboolean@3.0.3", + "lodash.isinteger": "lodash.isinteger@4.0.4", + "lodash.isnumber": "lodash.isnumber@3.0.3", + "lodash.isplainobject": "lodash.isplainobject@4.0.6", + "lodash.isstring": "lodash.isstring@4.0.1", + "lodash.once": "lodash.once@4.1.1", + "ms": "ms@2.1.3", + "semver": "semver@7.6.0" + } + }, "just-diff@6.0.2": { "integrity": "sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==", "dependencies": {} }, + "jwa@1.4.1": { + "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + "dependencies": { + "buffer-equal-constant-time": "buffer-equal-constant-time@1.0.1", + "ecdsa-sig-formatter": "ecdsa-sig-formatter@1.0.11", + "safe-buffer": "safe-buffer@5.2.1" + } + }, + "jws@3.2.2": { + "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + "dependencies": { + "jwa": "jwa@1.4.1", + "safe-buffer": "safe-buffer@5.2.1" + } + }, + "lodash.includes@4.3.0": { + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "dependencies": {} + }, + "lodash.isboolean@3.0.3": { + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "dependencies": {} + }, + "lodash.isinteger@4.0.4": { + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "dependencies": {} + }, + "lodash.isnumber@3.0.3": { + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "dependencies": {} + }, + "lodash.isplainobject@4.0.6": { + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "dependencies": {} + }, + "lodash.isstring@4.0.1": { + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "dependencies": {} + }, + "lodash.once@4.1.1": { + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dependencies": {} + }, + "lru-cache@10.2.2": { + "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", + "dependencies": {} + }, + "lru-cache@6.0.0": { + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "yallist@4.0.0" + } + }, "minimatch@3.1.2": { "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { @@ -110,11 +591,65 @@ "brace-expansion": "brace-expansion@2.0.1" } }, + "ms@2.1.3": { + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dependencies": {} + }, + "octokit@3.2.0_@octokit+core@5.2.0": { + "integrity": "sha512-f25eJ/8ITwF2BdwymOjK9I5ll9Azt8UbfHE2u5ho0gVdgfpIZkUgMGbQjbvgOYGbtIAYxh7ghH3BUbZrYal1Gw==", + "dependencies": { + "@octokit/app": "@octokit/app@14.1.0_@octokit+core@5.2.0", + "@octokit/core": "@octokit/core@5.2.0", + "@octokit/oauth-app": "@octokit/oauth-app@6.1.0", + "@octokit/plugin-paginate-graphql": "@octokit/plugin-paginate-graphql@4.0.1_@octokit+core@5.2.0", + "@octokit/plugin-paginate-rest": "@octokit/plugin-paginate-rest@9.2.1_@octokit+core@5.2.0", + "@octokit/plugin-rest-endpoint-methods": "@octokit/plugin-rest-endpoint-methods@10.4.1_@octokit+core@5.2.0", + "@octokit/plugin-retry": "@octokit/plugin-retry@6.0.1_@octokit+core@5.2.0", + "@octokit/plugin-throttling": "@octokit/plugin-throttling@8.2.0_@octokit+core@5.2.0", + "@octokit/request-error": "@octokit/request-error@5.1.0", + "@octokit/types": "@octokit/types@12.6.0" + } + }, + "once@1.4.0": { + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "wrappy@1.0.2" + } + }, + "safe-buffer@5.2.1": { + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dependencies": {} + }, + "semver@7.6.0": { + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "lru-cache@6.0.0" + } + }, "supports-color@7.2.0": { "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": { "has-flag": "has-flag@4.0.0" } + }, + "universal-github-app-jwt@1.1.2": { + "integrity": "sha512-t1iB2FmLFE+yyJY9+3wMx0ejB+MQpEVkH0gQv7dR6FZyltyq+ZZO0uDpbopxhrZ3SLEO4dCEkIujOMldEQ2iOA==", + "dependencies": { + "@types/jsonwebtoken": "@types/jsonwebtoken@9.0.6", + "jsonwebtoken": "jsonwebtoken@9.0.2" + } + }, + "universal-user-agent@6.0.1": { + "integrity": "sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==", + "dependencies": {} + }, + "wrappy@1.0.2": { + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dependencies": {} + }, + "yallist@4.0.0": { + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dependencies": {} } } }, @@ -307,6 +842,7 @@ }, "workspace": { "dependencies": [ + "jsr:@polyseam/cliffy-provider-gh-releases@^0.3.0", "npm:@scure/base@1.1.3", "npm:ejs@3.1.9", "npm:jsonpatch@3.1.0", diff --git a/main.ts b/main.ts index fd722a9..a4a0242 100644 --- a/main.ts +++ b/main.ts @@ -1,5 +1,7 @@ import { Command, CompletionsCommand } from "cliffy-command"; +import { version } from "./deno.json" with { type: "json" }; + import { getConfig } from "@/api/mod.ts"; import { setupLogger } from "@/jcli/logger.ts"; @@ -17,13 +19,17 @@ import cloneCommand from "@/subcommands/clone/mod.ts"; import generateCommand from "@/subcommands/generate/mod.ts"; import pluginCommand from "@/subcommands/plugin/mod.ts"; import linkCommand from "@/subcommands/link/mod.ts"; +import createUpgradeCommand from "@/subcommands/upgrade/mod.ts"; const DEFAULT_LOG_LEVEL = "INFO"; const { logLevel = DEFAULT_LOG_LEVEL } = await getConfig().get(); setupLogger(logLevel); +const upgradeCommand = await createUpgradeCommand(); + await new Command() .name("jcli") + .version(version) .description("Jet command-line tool") .globalOption("-d, --debug", "Enable debug output.", { action: globalOptionAction, @@ -40,5 +46,6 @@ await new Command() .command("generate", generateCommand) .command("plugins", pluginCommand) .command("link", linkCommand) + .command("upgrade", upgradeCommand as unknown as Command) .command("completions", new CompletionsCommand()) .parse(Deno.args); diff --git a/src/subcommands/upgrade/mod.ts b/src/subcommands/upgrade/mod.ts new file mode 100644 index 0000000..4ddbd5f --- /dev/null +++ b/src/subcommands/upgrade/mod.ts @@ -0,0 +1,55 @@ +import { + GHRError, + GithubReleasesProvider, + GithubReleasesUpgradeCommand, +} from "@polyseam/cliffy-provider-gh-releases"; +import { dirname } from "path"; + +const getOsAssetMap = () => { + const { os, arch } = Deno.build; + const osSuffixMap: { [key: string]: string } = { + linux: `${arch}-unknown-linux-gnu`, + darwin: `${arch}-apple-darwin`, + }; + + if (!(os in osSuffixMap)) { + throw new Error(`Unsupported operating system ${os}`); + } + + return { [os]: `jcli-${osSuffixMap[os]}.tar.gz` }; +}; + +const getDestinationDir = async (executableName: string) => { + const command = new Deno.Command("which", { + args: [executableName], + stdout: "piped", + stderr: "piped", + }); + + const { stdout } = await command.output(); + const fullPath = new TextDecoder().decode(stdout); + return dirname(fullPath.trim()); +}; + +export default async function createUpgradeCommand(): Promise< + GithubReleasesUpgradeCommand +> { + const osAssetMap = getOsAssetMap(); + const destinationDir = await getDestinationDir("jcli"); + + return new GithubReleasesUpgradeCommand({ + provider: new GithubReleasesProvider({ + repository: "byzanteam/jcli", + destinationDir: destinationDir, + osAssetMap: osAssetMap, + onError: (error: GHRError) => { + const exit_code = parseInt(`${error.code}`); + console.error("Error occurred during upgrade:", error); + Deno.exit(exit_code); + }, + onComplete: (_info) => { + Deno.exit(0); + }, + }), + }); +}