Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Check validity of version before making fake pkg #18852

Closed
wants to merge 2 commits into from
Closed

Check validity of version before making fake pkg #18852

wants to merge 2 commits into from

Conversation

joshclow
Copy link
Contributor

Cheking the version against semver here ensures that a fake pkg with URL/path data in its version field doesn’t get created (if that happens, then that will propagate down into the version field of any refreshed package.json, overwriting whatever version should actually be there)

This resolves #17858 without violating the spec for package-lock.json (mea culpa!)

Cheking the version against semver here ensures that a fake pkg with URL/path data in its version field doesn’t get created (if that happens, then that will propagate down into the version field of any refreshed package.json, overwriting whatever version should actually be there)
@joshclow joshclow requested a review from a team as a code owner October 16, 2017 01:50
@iarna
Copy link
Contributor

iarna commented Oct 16, 2017

This would disable fake children for git urls and http tarball urls… which ok, we can do as an interum measure, though I'd like to restore it.

I'm a bit confused as to how this is related to #17858, however and maybe I just missed that discussion? The bug reported in #17858 involves unbuild being called on a package entry where name isn't defined, which… I don't get how a fake child in this case would have an empty name field because the version was non-semver?

@iarna
Copy link
Contributor

iarna commented Oct 16, 2017

Also, I encourage you to drop by the https://package.community/ discord server and we can chat real time about this, 'cause I'd like to get this out. =)

@joshclow
Copy link
Contributor Author

joshclow commented Oct 17, 2017

I'll jump in there as soon as I can. Mostly, I've been looking at making minimally invasive changes on principle, but I'm 100% prepared to believe this one really wants something more sophisticated.

@joshclow
Copy link
Contributor Author

Proper fix was in refresh-package-json.js

@joshclow joshclow closed this Oct 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot read property '0' of undefined
2 participants