-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat(GHA): workflow file creation onboarding #577
feat(GHA): workflow file creation onboarding #577
Conversation
doing this so we can preserve the `this` scope
after thinking about it some more, this doesn't feel necessary since we can just grab it from the current package. it also might cause issues if we create a broken workflow file due to breaking changes. instead we should add a dependabot config.
i like this way just in case the opts string is empty (which is unlikely but w/e)
not sure why these are failing 🤔
Tests were failing because we had defined our regex expressions globally
this will be a lot faster when writing tests for other suites
this way we can mock out our package version easily and we don't need to update our snapshots every time we bump our package version 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback: #577 (comment) Co-Authored-By: Jon Ursenbach <[email protected]>
unfortunately this isn't exactly where we want it to be—we still have to manually add the `--github` arg to the command definitions. also adding some tests for this new functionality. feedback: #577 (comment) Co-Authored-By: Jon Ursenbach <[email protected]>
@@ -12,6 +13,7 @@ export type Options = { | |||
folder?: string; | |||
}; | |||
|
|||
@supportsGHA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diffs in these files are way cleaner now @erunion :chefs-kiss:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this! Would love to encapsulate the getGithubArg
stuff into the decorator at some point (because we can probably do a @authRequired
one too) but I don't think it's worth the --help
refactor it's going to require right now.
CmdClass: SingleCustomPageCommand, | ||
opts: { key, filePath: './custompages/rdme.md' }, | ||
}, | ||
])('$cmd', ({ cmd, CmdClass, opts }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat I didn't know you could do $cmd
like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i also learned about this today 😌
also removed the unnecessary boolean return value since it's a void function
🧰 Changes
The Linear ticket has all the details on what we're trying to do here!
Must Haves:
validate
openapi
docs
(and friends1)validate
openapi
docs
(and friends1)validate
openapi
docs
.github/workflows
directory createdconfigstore
when we ask if they'd like to set it up so we annoy them with too many asksNice to haves:
Archive
🧬 QA & Testing
I've added a metric ton of tests for all of this, but I think once this is merged, we should play around with it in a beta release just to make sure it functions as expected.
If you'd like to play around with this work yourself, check out this branch and run the following commands:
I used
validate
above since that one is the quickest to test (i.e. doesn't require auth), but you can also test any of the following commands as well:openapi
docs
docs:single
changelogs
changelogs:single
custompages
custompages:single
If you follow the prompts, you'll end up with a brand-spankin'-new GitHub Actions workflow file that contains that command 🪄
Footnotes
changelogs
,custompages
, etc... it's fairly easy to add new commands! I'll probably just write E2E tests for thedocs
command since the other ones are just super lightweight wrappers around thedocs
logic ↩ ↩2(this seems like it could be very prone to breakage... not gonna do it but I'll list it here for posterity) ↩