-
Notifications
You must be signed in to change notification settings - Fork 224
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
Oclif core migration #2144
Oclif core migration #2144
Conversation
|
||
export default class AuthToken extends Command { | ||
static description = `outputs current CLI authentication token. | ||
By default, the CLI auth token is only valid for 1 year. To generate a long-lived token, use heroku authorizations:create` | ||
|
||
static flags = { | ||
static flags: Interfaces.FlagInput = { |
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.
Not sure we need this with the additionalHelpFlags specified in package.json for -h. otoh, it probably won't hurt anything to leave as is
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.
Awesome work. Some questions:
- Seems like a lot of API changes come with oclif. Will this change we're doing impact customer custom commands/packages that extend the heroku CLI? If so, do we need to do any customer communication about this?
- We updated node to minimally require v12. Did we stop there because additional work is needed for v14? v12 was eol'd last year (https://github.com/nodejs/release#release-schedule).. I'm fine, btw, deferring getting to v14 to our other project workstream if that's what makes sense.
- We've added a lot of
await
s it seems. Did this impact the performance of commands at all?
Thanks for the review!
|
* wip: first step to remove all dependencies importing pre core. * chore: remove all imports of @oclif/core@2 * chore: remove @oclif/plugin-legacy and it's pre-core dependencies. * chore: remove confusing yarn version. Remove boostrap line from readme.
@@ -52,7 +52,6 @@ describeOrSkip('@acceptance smoke tests', () => { | |||
const cmd = await run('plugins --core') | |||
expect(cmd.stdout).to.contain('@oclif/plugin-commands') | |||
expect(cmd.stdout).to.contain('@oclif/plugin-help') |
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.
Will these first two items actually be included in the output? They are both now part of oclif/core.
* Revert "v8.0.1 (#2231)" This reverts commit d973836. * Revert "fix: don't run deb scripts in PR" This reverts commit 8fc7fc8. * Revert "fix: yarn downgrade for oclif linux release fixes (#2230)" This reverts commit d0f9234. * Revert "chore: add skipLibCheck to tsconfig for buildpacks and pipelines (#2229)" This reverts commit c8737ca. * Revert "chore: upgrade oclif version to 3.6.1 (#2228)" This reverts commit c5d476d. * Revert "chore: upgrade lerna and remove oclif readme command (#2227)" This reverts commit ed11841. * Revert "v8.0.0 (#2225)" This reverts commit 52372ab. * Revert "Oclif core migration (#2144)" This reverts commit a1f4604. * Revert "chore: fix snyk GH Action syntax (#2216)" This reverts commit 3175402. * Revert "refactor: Upgrade from yarn v1 to v3 (#2207)" This reverts commit 0589573. * Revert "move snyk to cron job (#2212)" This reverts commit d8711d5. * Revert "Revert "move snyk to cron job (#2212)"" This reverts commit b9f6885.
Purpose
The purpose of this PR is to upgrade the Heroku CLI to use the newer @oclif/core utilities and remove dependencies on the following older, deprecated utilities:
@oclif/dev-cli
while we were completing this upgrade)@oclif/core migration guide
GUS epic: Migrate to OCLIF core
Changes
Upgrading required Node version
@oclif/core requires that we use at least version 12 of Node. We had previously set the Node version for the packages at 10, so we needed to upgrade the minimum required version to 12. We are running the unit tests against versions 14 and 16 in the CI as well.
Types and Typescript
Previously, some of our variable types had come from the @oclif/config package. We had to switch these to use types from @oclif/core instead.
This upgrade required us to also upgrade our Typescript version from 3.7.5 to 4.8.4. This resulted in several necessary typing changes in the code.
Code changes
Tables
Several of our packages were using an earlier version of the cli-ux package. More recent versions had changed the parameters expected by the
table()
function. In order to upgrade to @oclif/core, we had to update the parameters we provide to thetable()
function to match the newer requirements.Spinner fixes
In the apps and webhooks packages, we were having trouble with getting the unit tests to pass with the new
CliUx.ux.action.start()
andCliUx.ux.action.stop()
functions. For some reason with these tests, thestart()
function was instantiating the spinner class before thestdout
andstderr
could be mocked. We updated several files in each of these packages to instantiate the spinner class directly, rather than going through thestart()
function, allowing the tests to pass. Internal folks who want more info on this can find it in this Slack thread.Test expectations
The formats for some of the returns from @oclif/core functions changed a little, so we did need to update the expected returns in some of the unit tests.
Additional dependency removals and updates
This upgrade allowed us to also remove dependencies on:
Other necessary version updates across all packages include:
Additional dependencies were also added to or upgraded in several individual packages as necessary.