Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GHA): workflow file creation onboarding (#577)
* fix: make command type more specific * refactor: consolidate `key` opt definition * fix: stricter type definition * chore: small copy change * refactor: small function change doing this so we can preserve the `this` scope * fix: lint * feat: first pass at GHA generation * feat: add `--github` flag * fix: allow user to not pass in spec path * chore: small copy change * fix: cleaning up a type, adding a smol doc * test: add coverage for if user says no * refactor: new function signature, better typings * test: smol refactor * test: remove unused mock * fix: better type * fix: remove unused async * refactor: remove github API fetch 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. * refactor: better command string construction i like this way just in case the opts string is empty (which is unlikely but w/e) * chore: some base file copy updates * refactor: make isGitHub file more generic * refactor: consolidate CI checks into shared function * feat: prevent user from running --github in CI env * feat: first pass at git detection * test: add some test cases not sure why these are failing 🤔 * chore: skip failing tests to see if CI passes * fix: move regex to inside function Tests were failing because we had defined our regex expressions globally * test:: smol refactor * test: refactor to describe.each() this will be a lot faster when writing tests for other suites * test: add test for git check failure * feat: add openapi command extension also some basic tests * fix: shorten github search * test: oops * test: add workflow file schema validation * test: reorganizing test bed a bit * chore: better test coverage, smol nits * fix: better filename input validation also adding some small nits and a few more tests * chore: clean up unused interfaces i really don't understand what's going on here lol * fix(openapi): add `update` param to ignored params * fix: use `.yml` instead of `.yaml` Maybe I'm overthinking this, but I feel like GitHub likes `.yml` more than `.yaml`... my evidence: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#about-yaml-syntax-for-workflows https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file https://docs.github.com/en/actions/using-workflows/about-workflows#create-an-example-workflow In all of these examples, GitHub uses `.yml` either first or exclusively :monocle: * test: more CI tests * refactor: move helper function to separate file * chore: different language updating tests and snapshots * test: stronger test * chore: smol refactor * test(validate): e2e tests * chore: rename function * fix: use JS string instead of YAML file wrote about why we're doing this in the comments, but yay for snapshot testing because this yields the exact same results! * fix: handle directory creation * chore: smol link comment * feat: configstore to ensure we don't ask user too many times * test: fix tests * chore: command comment * chore(openapi): update args * chore: clean up some comments * refactor: stricter types also slightly updating file name question per feedback from @RyanGWU82 * feat: support for docs/index * feat: add GHA functionality for docs-adjacent cmds * fix: clean up command name prior to using as YAML keys g*d bless tests y'all * test: add tests for docs-adjacent cmds * test: consolidate certain test mocks * fix(openapi): parameter logic fixes this also includes E2E tests that ended up exposing some cracks in the `ignoredGHAParameters` logic I had originally written. * fix: lint * fix: console.log that i forgot to commit lol * test: smol refactor * feat: do major version check for configstore * fix: separate out package version retrieval into function 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 😬 * chore: error message language * docs: github **actions** workflow, not github action (singular) * docs: better intro language * docs: better success language * chore: fix snapshot, de-localize docs link * chore: smol language update per Spang * test: don't fetch schema from URL #577 (comment) * test: update broken test * test(GHA): extract setup/teardowns into common lib Feedback: #577 (comment) * test: better describe.each signature Feedback: #577 (comment) Co-Authored-By: Jon Ursenbach <[email protected]> * chore: debug statements * fix: weird flaky TS error * refactor: use decorator 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]> * chore(mock/fs): clearer var names also removed the unnecessary boolean return value since it's a void function Co-authored-by: Jon Ursenbach <[email protected]>
- Loading branch information