Closed jasonkuhrt closed 9 years ago
@jonathanong @visionmedia I'm digging in to fix this as my first pr but first must clarify the following.
It appears that --dev
is passed through to resolve()
via options
which in turn installs the development: ...
components-of-sub-components. Test coverage seems to confirm this.
Given the above, I need to clarify if this is bug or bad design or good design (if so how so?).
Before "fixing" I want to understand the background problem space in case there is something I am neglecting, I am currently thinking of --dev
like npm
's --save-dev
.
this about updating the component.json
file? if so, it's probably just oversight and a bug.
it shouldn't install the development dependencies of dependencies. if so, that's a bug. i'm pretty sure i have a test for that.
this about updating the component.json file? if so, it's probably just oversight and a bug.
Yes. Ok thanks for confirming.
it shouldn't install the development dependencies of dependencies. if so, that's a bug. i'm pretty sure i have a test for that.
I am / we are confused, this test code:
https://github.com/component/component/blob/master/test/install.js#L128-L140
it('should install dev deps when --dev is used', function(done){
exec('bin/component install -d', function(err, stdout){
if (err) return done(err);
stdout.should.include('install');
stdout.should.include('complete');
var json = require(path.resolve('components/component/tip/1.0.0/component.json'));
json.name.should.equal('tip');
var json = require(path.resolve('components/component/popover/1.1.0/component.json'));
json.name.should.equal('popover');
assert(exists('components/component/assert/0.3.0'), 'dev deps should be installed');
done();
})
})
Is ensuring that assert
is installed due to dependencies depending on assert
in their development
field. Clear? I couldn't decide if this is odd or not yet, first I am working on the issue that --dev
installs to your dependencies
field instead of development
.
@jasonkuhrt
I am currently thinking of --dev like npm's --save-dev.
I think components --dev
flag is more than the opposite of npm install --production
With that assumption the test case (https://github.com/component/component/blob/master/test/install.js#L128-L140) make sense.
Starting with this:
Then:
Results in:
: (