Always log when delegating to local wrangler install#2391
Conversation
🦋 Changeset detectedLatest commit: 4860c2d 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/runs/3675287393/npm-package-wrangler-2391You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/prs/2391/npm-package-wrangler-2391Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/runs/3675287393/npm-package-wrangler-2391 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/runs/3675287393/npm-package-cloudflare-pages-shared-2391 |
3213ed5 to
04ae257
Compare
|
LOL - eab9542 |
|
🤣 Ah... I would say this feature is more confusing than the debug message, as it's not what other Node CLI tools do, but we should probably discuss this. 😅 |
Codecov Report
@@ Coverage Diff @@
## main #2391 +/- ##
==========================================
+ Coverage 70.71% 70.74% +0.03%
==========================================
Files 153 153
Lines 9751 9751
Branches 2550 2550
==========================================
+ Hits 6895 6898 +3
+ Misses 2856 2853 -3
|
04ae257 to
4860c2d
Compare
|
Part of me wants to revisit this feature, but we implemented so teams could be sure that their commands run on the version specified in their package.json |
|
The problem is that some people just like to use the global version of stuff. This is really not a good idea for NodeJS packages. We should be strongly encouraging people to install the version locally and then use As long as people use global commands then the best we can do is this sneaky trick. |
+1 |
|
Just to note for future reference, I approved this so we'd get the debug log which will make it clear what Wrangler is doing (and encourage people to use |
Closes #2302.
When a global
wranglercommand is executed in a package directory withwranglerinstalled locally, the command is redirected to the localwranglerinstall. Whilst sometimes useful, this behaviour is contrary to most othernpmCLI packages (andnpx wrangler ...should already call the local version if detected). It also makes debugging issues more confusing, as it's not clear whichwranglerversion is being called. This PR replaces a debug log we already had for this with a regular log, so users (andwranglerdevelopers 😅) know what's going on.