Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove looping hack, as checkbox.required is now a thing #23

Merged
merged 2 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions generator/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,16 @@ if (options.configFile) {
}
}
} else {
// workaround as there's validate is not currently supported on checkbox
// https://github.com/SBoudrias/Inquirer.js/issues/1257
while (!options.pools?.length === true) {
options.pools = await checkbox({
message: 'Chains this proposal targets',
choices: POOLS.map((v) => ({name: v, value: v})),
// validate(input) {
// // currently ignored due to a bug
// if (input.length == 0) return 'You must target at least one chain in your proposal!';
// return true;
// },
});
}
options.pools = await checkbox({
message: 'Chains this proposal targets',
choices: POOLS.map((v) => ({name: v, value: v})),
required: true,
// validate(input) {
// // currently ignored due to a bug
// if (input.length == 0) return 'You must target at least one chain in your proposal!';
// return true;
// },
});

if (!options.title) {
options.title = await input({
Expand Down
1 change: 1 addition & 0 deletions generator/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export async function booleanSelect<T extends boolean>({
const value = await select({
message,
choices: choices,
default: defaultValue,
});
return translateJsBoolToSol(value) as T extends true
? Exclude<BooleanSelectValues, 'KEEP_CURRENT'>
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"vitest": "^0.34.6"
},
"dependencies": {
"@bgd-labs/aave-address-book": "^2.8.0",
"@bgd-labs/aave-address-book": "^2.11.0",
"@bgd-labs/aave-cli": "0.1.0",
"@inquirer/prompts": "^3.2.0",
"@inquirer/testing": "^2.1.8",
"commander": "^11.0.0",
"tsx": "^3.13.0",
"viem": "^1.16.6"
"@inquirer/prompts": "^3.3.0",
"@inquirer/testing": "^2.1.9",
"commander": "^11.1.0",
"tsx": "^3.14.0",
"viem": "^1.18.9"
}
}
170 changes: 15 additions & 155 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.10.0.tgz#19873ec0edf9ee1f1a5539162e6092b0a2b2c4b4"
integrity sha512-DVglkDCYUf7etb6mnCziIY2HPgap4X3AnC/1tC0ZqpXFrhO0lQzWBiMeWy20r1x/b81iHMQa02ULaco3LhdeVw==

"@bgd-labs/aave-address-book@^2.8.0":
version "2.8.0"
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.8.0.tgz#6d4169c5b8e70bc9b847f5173b4ea2ca59f7a21b"
integrity sha512-oBcoPtwxnMZ310iYZHLqViuKAy4Q8hvwq6enW33LdqDL5Y+iU7c8TptKl6KdsojxwlluNZ1sahW5PfKNUT0jIQ==
"@bgd-labs/aave-address-book@^2.11.0":
version "2.11.0"
resolved "https://registry.yarnpkg.com/@bgd-labs/aave-address-book/-/aave-address-book-2.11.0.tgz#63ad103265c72f3f99f180f9ea2fcc37f5954cbc"
integrity sha512-xCIIibH0zmcT5DXFmd4CAPlSJJ7EG7kHqmVO2/S+5FmcvTbrhVXHRvW6kFWxZD2WiZPXvyl5WYCiTyYSXIIvhA==

"@bgd-labs/[email protected]":
version "0.1.0"
Expand Down Expand Up @@ -180,17 +180,6 @@
resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d"
integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==

"@inquirer/checkbox@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-1.4.0.tgz#9e583188be55f22ed624d2829421a3354d3d8c1a"
integrity sha512-7YcekwCvMTjrgjUursrH6AGZUSPw7gKPMvp0VhM3iq9mL46a7AeCfOTQTW0UPeiIfWmZK8wHyAD6wIhfDyLHpw==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
ansi-escapes "^4.3.2"
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/checkbox@^1.5.0":
version "1.5.0"
resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-1.5.0.tgz#05869b4ee81e2c8d523799ef350d57cabd556bfa"
Expand All @@ -202,15 +191,6 @@
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/confirm@^2.0.14":
version "2.0.14"
resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.14.tgz#b87fcdf218d0ce687bd021623e091d3a80744e9e"
integrity sha512-Elzo5VX5lO1q9xy8CChDtDQNVLaucufdZBAM12qdfX1L3NQ+TypnZytGmWDXHBTpBTwuhEuwxNvUw7B0HCURkw==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/confirm@^2.0.15":
version "2.0.15"
resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-2.0.15.tgz#b5512ed190efd8c5b96e0969115756b48546ab36"
Expand All @@ -220,26 +200,6 @@
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/core@^5.1.0":
version "5.1.0"
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.1.0.tgz#2e3f6abf1dee93eae60cd85a5168c52400f73c9c"
integrity sha512-EVnific72BhMOMo8mElvrYhGFWJZ73X6j0I+fITIPTsdAz6Z9A3w3csKy+XaH87/5QAEIQHR7RSCVXvQpIqNdQ==
dependencies:
"@inquirer/type" "^1.1.5"
"@types/mute-stream" "^0.0.2"
"@types/node" "^20.8.2"
"@types/wrap-ansi" "^3.0.0"
ansi-escapes "^4.3.2"
chalk "^4.1.2"
cli-spinners "^2.9.1"
cli-width "^4.1.0"
figures "^3.2.0"
mute-stream "^1.0.0"
run-async "^3.0.0"
signal-exit "^4.1.0"
strip-ansi "^6.0.1"
wrap-ansi "^6.2.0"

"@inquirer/core@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-5.1.1.tgz#849d4846aea68371c133df6ec9059f5e5bd30d30"
Expand All @@ -260,16 +220,6 @@
strip-ansi "^6.0.1"
wrap-ansi "^6.2.0"

"@inquirer/editor@^1.2.12":
version "1.2.12"
resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-1.2.12.tgz#3dfa72253e8a9d915b43f3c8dbc8df85e3c627ff"
integrity sha512-Y7zXQqcglPbbPkx0DPwx6HQFstJR5uex4hoQprjpdxSj8+Bf04+Og6mK/FNxoQbPvoNecegtmMGxDC+hVcMJZA==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"
external-editor "^3.1.0"

"@inquirer/editor@^1.2.13":
version "1.2.13"
resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-1.2.13.tgz#94bddeeabc043d4a05fbde8523add4db221555d5"
Expand All @@ -280,16 +230,6 @@
chalk "^4.1.2"
external-editor "^3.1.0"

"@inquirer/expand@^1.1.13":
version "1.1.13"
resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-1.1.13.tgz#921d36274c0b143f7bf6cefb42f002be9cd1646f"
integrity sha512-/+7CGCa7iyJIpli0NtukEAjSI7+wGgjYzsByLVSSAk3U696ZlCCP6iPtsWx6d1qfmaMmCzejcjylOj6OAeu4bA==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/expand@^1.1.14":
version "1.1.14"
resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-1.1.14.tgz#d315014939d0bb82ed2b769907db5bd1922fb823"
Expand All @@ -300,15 +240,6 @@
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/input@^1.2.13":
version "1.2.13"
resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.13.tgz#27ee5826e2988735a78f50510c9652d2ef29e39a"
integrity sha512-gALuvSpZRYfqygPjlYWodMZ4TXwALvw7Pk4tRFhE1oMN79rLVlg88Z/X6JCUh+uV2qLaxxgbeP+cgPWTvuWsCg==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/input@^1.2.14":
version "1.2.14"
resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.14.tgz#8951867618bb5cd16dd096e02404eec225a92207"
Expand All @@ -318,16 +249,6 @@
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/password@^1.1.13":
version "1.1.13"
resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.13.tgz#b7f0a0f7feed90e01630a9df4a14eab09697fcd6"
integrity sha512-6STGbL4Vm6ohE2yDBOSENCpCeywnvPux5psZVpvblGDop1oPiZkdsVI+NhsA0c4BE6YT0fNVK8Oqxf5Dgt5k7g==
dependencies:
"@inquirer/input" "^1.2.13"
"@inquirer/type" "^1.1.5"
ansi-escapes "^4.3.2"
chalk "^4.1.2"

"@inquirer/password@^1.1.14":
version "1.1.14"
resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.14.tgz#c1fc139efe84a38986870a1bcf80718050f82bbf"
Expand All @@ -338,21 +259,6 @@
ansi-escapes "^4.3.2"
chalk "^4.1.2"

"@inquirer/prompts@^3.2.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-3.2.0.tgz#8f4feaa81560d22e77b55c676e9296a108daf5b1"
integrity sha512-sfT7eDoveChXr8iIfwUYkoVBjUcKqXluhjM0EVhRhN59ZuJCc5DAdnuKwaFXomwESDoN0f+2zHy+MpxUg+EZuQ==
dependencies:
"@inquirer/checkbox" "^1.4.0"
"@inquirer/confirm" "^2.0.14"
"@inquirer/core" "^5.1.0"
"@inquirer/editor" "^1.2.12"
"@inquirer/expand" "^1.1.13"
"@inquirer/input" "^1.2.13"
"@inquirer/password" "^1.1.13"
"@inquirer/rawlist" "^1.2.13"
"@inquirer/select" "^1.3.0"

"@inquirer/prompts@^3.3.0":
version "3.3.0"
resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-3.3.0.tgz#1324881d207e37b1162f174fb9726b9ecb4c475c"
Expand All @@ -368,15 +274,6 @@
"@inquirer/rawlist" "^1.2.14"
"@inquirer/select" "^1.3.1"

"@inquirer/rawlist@^1.2.13":
version "1.2.13"
resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-1.2.13.tgz#e74f003d417add415fea8c349d186eef7cda5032"
integrity sha512-f+bASrCY2x2F90MrBYX7nUSetL6FsVLfskhGWEyVwj6VIXzc9T878z3v7KU3V10D1trWrCVHOdeqEcbnO68yhg==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/rawlist@^1.2.14":
version "1.2.14"
resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-1.2.14.tgz#7fac491345a984bafad96817a4f5ae45fb6b0c96"
Expand All @@ -386,17 +283,6 @@
"@inquirer/type" "^1.1.5"
chalk "^4.1.2"

"@inquirer/select@^1.3.0":
version "1.3.0"
resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-1.3.0.tgz#00dfa5068bea85bffeb7aa7c402407bb590c8cd4"
integrity sha512-3sL5odCDYI+i+piAFqFa5ULDUKEpc0U1zEY4Wm6gjP6nMAHWM8r1UzMlpQXCyHny91Tz+oeSLeKinAde0z6R7w==
dependencies:
"@inquirer/core" "^5.1.0"
"@inquirer/type" "^1.1.5"
ansi-escapes "^4.3.2"
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/select@^1.3.1":
version "1.3.1"
resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-1.3.1.tgz#b10bb8d4ba72f08eb887b3d948eb734d680897c6"
Expand All @@ -408,14 +294,14 @@
chalk "^4.1.2"
figures "^3.2.0"

"@inquirer/testing@^2.1.8":
version "2.1.8"
resolved "https://registry.yarnpkg.com/@inquirer/testing/-/testing-2.1.8.tgz#809dffe6a4891100c54eee02ae99e3cd26b8425e"
integrity sha512-PPCiS5wN/MDjeJRQuMZa3cUDwsVmmB9wwbWNSNoC3ciPUwhX8fHdC0Um/gKMlF7EnaZaPa+AOrA8zLo/zJLjPw==
"@inquirer/testing@^2.1.9":
version "2.1.9"
resolved "https://registry.yarnpkg.com/@inquirer/testing/-/testing-2.1.9.tgz#47534987079fba467001e1a4850ddfd49de04f9e"
integrity sha512-WOE84gVft9p8C7i5HVFybHYdtocRWTXYe+95/D60Z+DS3TcZpD0ph33BC3Y8tv8m9YHcmQaLAVA3PusMp0j+9g==
dependencies:
"@inquirer/type" "^1.1.5"
"@types/mute-stream" "^0.0.2"
"@types/node" "^20.8.2"
"@types/mute-stream" "^0.0.4"
"@types/node" "^20.9.0"
ansi-escapes "^4.3.2"
mute-stream "^1.0.0"
strip-ansi "^6.0.1"
Expand Down Expand Up @@ -563,21 +449,14 @@
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.3.tgz#dd249cef80c6fff2ba6a0d4e5beca913e04e25f8"
integrity sha512-ZYFzrvyWUNhaPomn80dsMNgMeXxNWZBdkuG/hWlUvXvbdUH8ZERNBGXnU87McuGcWDsyzX2aChCv/SVN348k3A==

"@types/mute-stream@^0.0.2":
version "0.0.2"
resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.2.tgz#5a011b17307364e48591ac6829a8e40e1c10c6b0"
integrity sha512-FpiGjk6+IOrN0lZEfUUjdra1csU1VxwYFj4S0Zj+TJpu5x5mZW30RkEZojTadrNZHNmpCHgoE62IQZAH0OeuIA==
dependencies:
"@types/node" "*"

"@types/mute-stream@^0.0.4":
version "0.0.4"
resolved "https://registry.yarnpkg.com/@types/mute-stream/-/mute-stream-0.0.4.tgz#77208e56a08767af6c5e1237be8888e2f255c478"
integrity sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==
dependencies:
"@types/node" "*"

"@types/node@*", "@types/node@>=13.7.0", "@types/node@^20.8.2":
"@types/node@*", "@types/node@>=13.7.0":
version "20.8.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.4.tgz#0e9ebb2ff29d5c3302fc84477d066fa7c6b441aa"
integrity sha512-ZVPnqU58giiCjSxjVUESDtdPk4QR5WQhhINbc9UBrKLU68MX5BF6kbQzTrkwbolyr0X8ChBpXfavr5mZFKZQ5A==
Expand Down Expand Up @@ -873,11 +752,6 @@ color-name@~1.1.4:
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==

commander@^11.0.0:
version "11.0.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-11.0.0.tgz#43e19c25dbedc8256203538e8d7e9346877a6f67"
integrity sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==

commander@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-11.1.0.tgz#62fdce76006a68e5c1ab3314dc92e800eb83d906"
Expand Down Expand Up @@ -1881,10 +1755,10 @@ trim-newlines@^3.0.0:
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-3.0.1.tgz#260a5d962d8b752425b32f3a7db0dcacd176c144"
integrity sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==

tsx@^3.13.0:
version "3.13.0"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.13.0.tgz#f860e511b33fcb41d74df87d7ba239a0b4012dbb"
integrity sha512-rjmRpTu3as/5fjNq/kOkOtihgLxuIz6pbKdj9xwP4J5jOLkBxw/rjN5ANw+KyrrOXV5uB7HC8+SrrSJxT65y+A==
tsx@^3.14.0:
version "3.14.0"
resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.14.0.tgz#be6e2176b6f210fe8f48124fb6e22e0f075e927b"
integrity sha512-xHtFaKtHxM9LOklMmJdI3BEnQq/D5F73Of2E1GDrITi9sgoVkvIsrQUTY1G8FlmGtA+awCI4EBlTRRYxkL2sRg==
dependencies:
esbuild "~0.18.20"
get-tsconfig "^4.7.2"
Expand Down Expand Up @@ -1969,20 +1843,6 @@ varint@^6.0.0:
resolved "https://registry.yarnpkg.com/varint/-/varint-6.0.0.tgz#9881eb0ce8feaea6512439d19ddf84bf551661d0"
integrity sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==

viem@^1.16.6:
version "1.16.6"
resolved "https://registry.yarnpkg.com/viem/-/viem-1.16.6.tgz#78118c9269506a59e2bc4deab13f1646e113d3fc"
integrity sha512-jcWcFQ+xzIfDwexwPJRvCuCRJKEkK9iHTStG7mpU5MmuSBpACs4nATBDyXNFtUiyYTFzLlVEwWkt68K0nCSImg==
dependencies:
"@adraffy/ens-normalize" "1.9.4"
"@noble/curves" "1.2.0"
"@noble/hashes" "1.3.2"
"@scure/bip32" "1.3.2"
"@scure/bip39" "1.2.1"
abitype "0.9.8"
isows "1.0.3"
ws "8.13.0"

viem@^1.18.9:
version "1.18.9"
resolved "https://registry.yarnpkg.com/viem/-/viem-1.18.9.tgz#8be8fe3148b1c6c3bccc853001df98f91a8aeb30"
Expand Down