Allow @changesets/cli/changelog to be resolved even when homed in global node_modules#1500
Allow @changesets/cli/changelog to be resolved even when homed in global node_modules#1500cefn wants to merge 1 commit intochangesets:mainfrom
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1500 +/- ##
==========================================
- Coverage 81.04% 80.94% -0.11%
==========================================
Files 54 54
Lines 2221 2225 +4
Branches 657 662 +5
==========================================
+ Hits 1800 1801 +1
- Misses 417 420 +3
Partials 4 4 ☔ View full report in Codecov by Sentry. |
|
I cannot add a Changeset because |
|
Missing changeset |
@Netail see #1500 (comment) changesets is failing in my environment as shown. Changesets cannot be added. |
Ahh that's what you meant by that, they did push some new changes regarding changeset add, could give it a try |
|
I forked your repo and tried adding a changeset myself, did seem to work |
| changelogPath = resolveFrom(changesetPath, config.changelog[0]); | ||
| } catch (error) { | ||
| const { execSync } = require("child_process"); | ||
| const globalNodeModules = execSync("npm root -g", { |
There was a problem hiding this comment.
Not sure about this execSync, you could have a runtime without npm
There was a problem hiding this comment.
Yeah, I don't like this either. I think passing down __dirname obtained by @changesets/cli should allow us to call resolveFrom(changesetPath, callerDir);
|
This work was pulled into #1562 and landed as part of it. I'm sorry for not getting to your PR on time |
As described in the thread linked below, there is an edge case when using a
npm install -gversion of @changesets/cli because the bespoke resolution algorithm to resolve@changesets/cli/changelogbreaks - it assumes the module must only exist relative to the changeset package root rather than the global node_modules.This is impactful because changesets are among the things you want to calculate in a pipeline step without doing a full npm install (e.g. to reason about identities for docker images and what not). The difference in some cases could be minutes of performance.
Fixes #566