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

Feature request: support for the custom node_modules/ and bower_components/ location #10

Closed
ocrest opened this issue Mar 31, 2015 · 7 comments

Comments

@ocrest
Copy link

ocrest commented Mar 31, 2015

There is a possibility (both for npm and Bower) to install packages to the custom folder:

npm local install package to custom location
How to change bower's default components folder?

— I think it would be great to introduce a new option, which will set the depsDir variable:

https://github.com/mzgol/check-dependencies/blob/master/lib/check-dependencies.js#L104

@mgol
Copy link
Owner

mgol commented Mar 31, 2015

For npm this only concerns global packages which are beyond the scope of this module. For local packages this is unsupported and there have been public declarations that it's not ever planned.

For Bower I already support this configuration in .bowerrc - just specify it and it should work.

Am I missing something?

@ocrest
Copy link
Author

ocrest commented Mar 31, 2015

For npm this only concerns global packages which are beyond the scope of this module. For local packages this is unsupported and there have been public declarations that it's not ever planned.

Sorry, I missed this information about npm.

For Bower I already support this configuration in .bowerrc - just specify it and it should work.

Before I wrote this issue, I've tested this by guess in my project (where bower dependencies are already installed), and got the wrong result "depsWereOk: false", when it should be true. So I decided that your library simply ignores .bowerrc... But now I looked more closely, and found this:

My bower.json

{
  ...
  "devDependencies": {
    "susy": "2.2.0.beta.3",
    "sass-meyer-reset": "*",
    "breakpoint-sass": "~2.5.0"
  }
}

The check-dependencies verbose output:

susy: installed: undefined, expected: 2.2.0.beta.3
sass-meyer-reset: installed: undefined, expected: *
Invoke bower install to install missing packages

The content of the susy's .bower.json

{
  "name": "susy",
...
  "devDependencies": {
    "true": "2.0.0.alpha.3"
  },
  "_release": "2.2.0.beta.3",
  "_resolution": {
    "type": "tag",
    "tag": "2.2.0.beta.3",
    "commit": "8677fb51a4513b22db41d0d43f48c8a36ee937f4"
  },
  "_source": "git://github.com/ericam/susy.git",
  "_target": "2.2.0.beta.3",
  "_originalSource": "susy"
}

The content of the sass-meyer-reset's .bower.json

{
  "name": "sass-meyer-reset",
  "homepage": "https://github.com/ryanburnette/sass-meyer-reset",
  "_release": "1dc79b9776",
  "_resolution": {
    "type": "branch",
    "branch": "master",
    "commit": "1dc79b977685b4240f8971987293938fbb4e602c"
  },
  "_source": "git://github.com/ryanburnette/sass-meyer-reset.git",
  "_target": "*",
  "_originalSource": "sass-meyer-reset",
  "_direct": true
}

— there is some problem with matching versions of installed packages.

@mgol
Copy link
Owner

mgol commented Mar 31, 2015

The problem seems to be that in .bower.json for sass-meyer-reset there is no version field. Do you have an idea why? Perhaps they should add it? Or maybe Bower should auto-generate it since it knows which version it installs?

@mgol
Copy link
Owner

mgol commented Mar 31, 2015

I could ignore packages with unspecified version and just warn in the console but I would hope such packages don't exist...

@ocrest
Copy link
Author

ocrest commented Mar 31, 2015

Do you have an idea why? Perhaps they should add it?

It seems that repository, from which I installed this package, doesn't contain a bower.json at all:

https://github.com/ryanburnette/sass-meyer-reset

But nonetheless, this package is registered in Bower:

bower search reset | grep meyer
    meyer-reset git://github.com/adamstac/meyer-reset.git
    sass-meyer-reset git://github.com/ryanburnette/sass-meyer-reset.git
    competent-meyerweb-reset git://github.com/competent/meyerweb-reset.git
    bower-meyer-reset git://github.com/andysolomon/meyer-reset.git

P. S. For susy I set specific version (2.2.0.beta.3) by own, and this doesn't work too:

susy: installed: undefined, expected: 2.2.0.beta.3

@mgol
Copy link
Owner

mgol commented Mar 31, 2015

It seems that repository, from which I installed this package, doesn't contain a bower.json at all:

A Bower package that doesn't have bower.json - is that officially supported by Bower? Does susy also not contain bower.json?

@ocrest
Copy link
Author

ocrest commented Apr 1, 2015

Sorry for the late reply.

A Bower package that doesn't have bower.json - is that officially supported by Bower?

According to this:

http://bower.io/docs/creating-packages/#register

these packages aren't valid (but can be registered though). The sass-meyer-reset's repository doesn't contain a valid bower.json, and, furthermore, the git tag v2.0 isn't a valid semantic version (semver). I think, the last is the reason why the .bower.json (generated by the bower automatically) doesn't contain the version field

Does susy also not contain bower.json?

There is a valid bower.json:

https://github.com/ericam/susy/blob/master/bower.json

I think the problem is same — the tag 2.2.0.beta.3 isn't a valid semver (should be something like 2.2.0-beta3 according to the spec), therefore the bower doesn't make a version field in the .bower.json.

But there is a _release field which can solve this problem:

bower install susy#2.2.0.beta.3
{
  "name": "susy",
  ...
  "_release": "2.2.0.beta.3",
  ...
}

and

bower install susy#2.2.2
{
  "name": "susy",
  "version": "2.2.2",
  ...
  "_release": "2.2.2",
  ...
}

I've created a new issue related to this problem and continued the discussion here#11

Closing this for now.

@ocrest ocrest closed this as completed Apr 1, 2015
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

2 participants