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

update check #763

Merged
merged 1 commit into from
Apr 8, 2022
Merged

update check #763

merged 1 commit into from
Apr 8, 2022

Conversation

JacobMGEvans
Copy link
Contributor

feat: Added the update check that will check the package once a day against the beta release, distTag can be changed later, then prints the latest beta version to the user.

resolves #762

@JacobMGEvans JacobMGEvans added the polish Small improvements to the experience label Apr 5, 2022
@changeset-bot
Copy link

changeset-bot bot commented Apr 5, 2022

🦋 Changeset detected

Latest commit: ad13740

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Apr 5, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2103676389/npm-package-wrangler-763

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/763/npm-package-wrangler-763

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2103676389/npm-package-wrangler-763 dev path/to/script.js

import { main } from ".";

try {
initReporting();
void updateCheck();
Copy link
Contributor Author

@JacobMGEvans JacobMGEvans Apr 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having this inside the try is probably redundant because it has a try/catch in the updateCheck

@JacobMGEvans
Copy link
Contributor Author

Alternatively, I started using Ink to improve the UI of this output. I think if we do that it would need to be called around the same place as yargs.parse()

@JacobMGEvans
Copy link
Contributor Author

JacobMGEvans commented Apr 5, 2022

I added a new line to create some space, it looked a little cramped in this screenshot
Screen Shot 2022-04-05 at 1 31 05 PM

@JacobMGEvans
Copy link
Contributor Author

JacobMGEvans commented Apr 5, 2022

This is with the Ink, implementation I spent some time on.

Screen Shot 2022-04-05 at 2 57 51 PM

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not use ink for this just yet.

distTag: "beta",
});
} catch (err) {
console.error(`Failed to check for updates: ${err}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a silent failure

console.error(`Failed to check for updates: ${err}`);
}

if (update)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we'll always show this message if there's an update? Do you suppose we only want to show this message once a day?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default is it checks once a day.

@threepointone
Copy link
Contributor

Another idea is to include inside printWranglerBanner(), so it's less aggressive. ⛅️ wrangler 0.0.24 (update available 0.0.25). What do you think?

@JacobMGEvans
Copy link
Contributor Author

JacobMGEvans commented Apr 6, 2022

Another idea is to include inside printWranglerBanner(), so it's less aggressive. ⛅️ wrangler 0.0.24 (update available 0.0.25). What do you think?

I think it is a good idea, we can always pivot later if we want something more like what NPM or similar packages do for their update messaging.

Screen Shot 2022-04-06 at 11 11 42 AM

Screen Shot 2022-04-06 at 11 12 26 AM

…gainst the beta release, distTag can be changed later, then prints the latest

beta version to the user.

resolves #762
Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good for now, let's land it and iterate on it based on feedback. Thank you!

@threepointone threepointone merged commit f72c943 into main Apr 8, 2022
@threepointone threepointone deleted the update-check branch April 8, 2022 12:41
@github-actions github-actions bot mentioned this pull request Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
polish Small improvements to the experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: update checker
2 participants