-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: throw errors if version POST fails found an interesting bug... if someone creates a version but the request is invalid for any reason, we just swallow the request and call it a day 😬 This slightly refactors the logic so we actually digest the request and then use the data from its response, rather than the raw input from the user. * chore: small refactor to align patterns * feat: first pass at migration version selection ... over to prompts library this also entailed removing some unnecessary types * refactor: wrap prompts in exit handler * temp: why isn't this working 🧐 I've isolated a test here to demonstrate some weirdness going on... basically the generatePrompts() function isn't being called from this test at all, but it works fine when I run the command locally * Revert "temp: why isn't this working 🧐" This reverts commit 9c529f6. * fix: properly add onState function Since `questions` can be either an object or an array, we have to be a little smarter about how we tack on the `onState` function * test: stricter test for testing version prompt I'm so mad lol I hate enquirer (also tysm @erunion for finding this stupid mock that was ruining everything) * test: update version selection tests * feat: migrate oas selection to prompts lib I continue to be so mad at how nice prompts is * test: more resilient version selection tests * feat: API definition id in description * chore: small logic removal our openapi test coverage is officially 💯 i literally have no idea how to even get to this point in the logic * refactor: better return types I think this is better? VSCode seems to flag stuff better this way... * refactor: consolidate version opts * docs: add JSDoc for getVersionArg * refactor(version): consolidate opt types, stricter jeez, this one was wild. i noticed we had a lot of duplicate type definitions, so i consolidated all of them in the `versions:create` command. easy enough right? well I noticed we had union boolean/string definitions for `isPublic`, `main`, etc. even though the opts were only being created as strings—turns out we only had them defined as booleans because of our paltry tests. I typed those opts as string enums and separated them out into which command they're being used for so it's a little bit more clear. * refactor: migrate `createVersionPrompt` to prompts * test: far better tests for prompts honestly I don't think these were working properly before at all... but now they are! * test(version:create): far better tests * fix: correct type this was holdover from a bad `createVersionPrompt` test. this should always be a boolean. * chore: clearer question * fix: document some missing parameters Also as part of this, I'm moving the `newVersion` param to only live in the `VersionUpdateOptions` type since that's technically only an opt for that command. Also doing some slight rearranging of the opts in our object destructuring so it aligns with the order of the opt definitions. * test(version:update): overhauling test suite god these commands are a mess * chore: remove redundant catch * test(versions:create): more coverage * fix(createVersionPrompt): validation * test: add TODO * chore(deps): rip out enquirer 🚮 * feat(login): use prompts as part of this, i swapped out read for enquirer and isemail for validator * chore: shorten debug command * feat: cuter goodbye 👋 * chore: PR feedback Co-Authored-By: Jon Ursenbach <[email protected]> * docs: add command attribute descriptions Co-authored-by: Jon Ursenbach <[email protected]>
- Loading branch information
1 parent
0057dab
commit 8714967
Showing
19 changed files
with
546 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ | |
|
||
exports[`rdme login should post to /login on the API 1`] = `"Successfully logged in as [email protected] to the subdomain project."`; | ||
|
||
exports[`rdme login should post to /login on the API if passing in project via opt 1`] = `"Successfully logged in as [email protected] to the subdomain project."`; | ||
|
||
exports[`rdme login should send 2fa token if provided 1`] = `"Successfully logged in as [email protected] to the subdomain project."`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.