-
Notifications
You must be signed in to change notification settings - Fork 803
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
fix: correctly find the latest version of create-cloudflare #4771
fix: correctly find the latest version of create-cloudflare #4771
Conversation
🦋 Changeset detectedLatest commit: b697d6f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7646321039/npm-package-wrangler-4771 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/4771/npm-package-wrangler-4771 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7646321039/npm-package-wrangler-4771 dev path/to/script.js Additional artifacts:npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7646321039/npm-package-create-cloudflare-4771 --no-auto-update npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7646321039/npm-package-miniflare-4771 npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/7646321039/npm-package-cloudflare-pages-shared-4771 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
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.
Nice! 🤩👍
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4771 +/- ##
==========================================
+ Coverage 70.56% 70.58% +0.01%
==========================================
Files 290 290
Lines 15089 15100 +11
Branches 3828 3832 +4
==========================================
+ Hits 10648 10658 +10
- Misses 4441 4442 +1
|
e7cd02f
to
34b1846
Compare
!process.env.VITEST && | ||
!process.env.CI && | ||
isInteractive() && |
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 moved these checks here to make it easier to test the isUpdateAvailable()
function but also because it is not really nice having checks like that hidden deep down in the code.
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.
Love the tests!
5588bd9
to
bade19d
Compare
bade19d
to
5fb0ec0
Compare
186bc43
to
f344b61
Compare
When create-cloudflare starts up, it checks to see if the version being run is the latest available on npm. Previously this check used `npm info` to look up the version. But was prone to failing if that command returned additional unexpected output such as warnings. Now we make a fetch request to the npm REST API directly for the latest version, which does not have the problem of unexpected warnings. Since the same approach is used to compute the latest version of workerd, the function to do this has been put into a helper. Fixes #4729
The yargs help info is set to error, so this makes it consistent and simpler to spy on in tests.
8006e0b
to
b697d6f
Compare
When create-cloudflare starts up, it checks to see if the version being run is the latest available on npm.
What this PR solves / how to test:
Previously this check used
npm info
to look up the version. But was prone to failing if that command returned additional unexpected output such as warnings.Now we make a fetch request to the npm REST API directly for the latest version, which does not have the problem of unexpected warnings.
Since the same approach is used to compute the latest version of workerd, the function to do this has been put into a helper.
Fixes #4729
Author has addressed the following: