fix: improve package.json detection#94
Conversation
|
@re-taro is attempting to deploy a commit to the Changesets Team on Vercel. A member of the Team first needs to authorize it. |
|
this should also resolve #82 |
|
@Andarist sorry for tagging you, but the original issue has been raised almost 2 years ago. Could we get this merged and released? |
| if (item.path.endsWith("/package.json")) { | ||
| if ( | ||
| item.path === "package.json" || | ||
| item.path.endsWith("/package.json") |
There was a problem hiding this comment.
when you use slashes like this it will not work on windows machines, you should either use path.SEP or path.join, whichever suits the situation more
There was a problem hiding this comment.
here you could also do
path.basename(item.path) === "package.json"There was a problem hiding this comment.
Oops, I missed Windows support. Fixed now.
eb4d3a9 to
ba0b88d
Compare
| continue; | ||
| } | ||
| if (item.path.endsWith("/package.json")) { | ||
| if (nodePath.basename(item.path) === "package.json") { |
There was a problem hiding this comment.
It would be great to understand better your workspace layout to determine if this is the proper fix. How your packages are laid out and how your workspaces patterns are configured? what exactly doesnt work right now and what is the expected result with your fix in?
There was a problem hiding this comment.
I described one example in more detail as part of #82
There was a problem hiding this comment.
yeah, that looks right, there's one more case that this didn't fix, I opened #111 to address it
Summary
package.jsonwas not being detecteditem.path.endsWith("/package.json")doesn't matchpackage.jsonat the root directory, so addeditem.path === "package.json"checkChanges
get-changed-packages.ts: Add condition to properly detect root-levelpackage.json