Skip to content
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

Roots should throw an error if package.json version differs from local version #656

Open
hhsnopek opened this issue Jul 20, 2015 · 8 comments

Comments

@hhsnopek
Copy link
Contributor

For instance if I'm running v3.1.0 but the package.json for a site uses v3.0.x there could be a breaking change. Roots should check the projects package.json to verify that we are using the same version or same minor version (so long as roots follows semver, which I'm unsure if it does or doesn't)

@jescalan
Copy link
Owner

I'm not sure I understand. Do you mean comparing the version you are using globally to produce the actual site, and if you have installed roots locally also by chance, comparing it against that?

The issue I see here is that you don't actually need to install it locally... we only do this because of netlify's pipeline. I suppose we could add a check at some point, like perhaps before deploy, if it is present as a local install though.

@hhsnopek
Copy link
Contributor Author

You got it on the spot, but the use cases could go beyond using netlify for deployment. It's more of a helper so that your global version & project version are the same so if it is specified within the package.json you know you're okay

@jescalan
Copy link
Owner

I'm ok with having it, but not at the expensive of speed at any time, or with any possibility that it could be annoying. Integration would need to be designed carefully.

@hhsnopek
Copy link
Contributor Author

it would just be a simple check at the beginning of the root watching or compiling a project, shouldn't slow roots down at all as it's not compiling anything, just checking the version - probably can just read the projects package.json then use the same method for printing roots -v and compare them

@Arshad3
Copy link

Arshad3 commented Jul 23, 2015

Update lollipop 5.1.1 resurrection 5.5.1 after root not complete root permission how to plz help me

@jescalan
Copy link
Owner

@Arshad3 I think you might be in the wrong place...

@SevereOverfl0w
Copy link
Contributor

@Jenius in light of the recent image issue, this seems required.

Gulp does this, lines of interest are:
https://github.com/gulpjs/gulp/blob/v3.9.0/bin/gulp.js#L99 this compares the provided version from local, to the known global one.

As the CLI builds on liftoff, to build the "modulePackage" part of the environment, all that does is recursively look up from where it is for package.json, and require it: https://github.com/js-cli/js-liftoff/blob/0226211f1f260b87f9c829971b3f30322435c9c7/index.js#L89

I imagine the place to hook for this is here: https://github.com/jenius/roots/blob/83dce34b86e3b061b7a43c8813a48eb98670538c/lib/cli/index.coffee#L46 but I have no idea if roots.base is accessible at this point, but I imagine a solution can be found.

Alternatively, we could try switching to Liftoff to handle our CLI stuff.

@jescalan
Copy link
Owner

I am interested in the concept, but don't have the time to tackle this kind of issue at the moment. I'm really sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants