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

adding package cli command #422

Merged
merged 2 commits into from
Mar 30, 2017
Merged

Conversation

debopamsengupta
Copy link
Member

@debopamsengupta debopamsengupta commented Mar 26, 2017

Adding the oc package CLI command as per #419
Also added a --compress option to generate the package.tar.gz file

@debopamsengupta
Copy link
Member Author

cc @matteofigus 😄

@matteofigus
Copy link
Member

Thanks @debopamsengupta sorry for taking some time. Perhaps @mattiaerre can help a bit with the review? If not I'll have a look tomorrow :)

@debopamsengupta
Copy link
Member Author

No problem, thanks @matteofigus :)

Copy link
Member

@mattiaerre mattiaerre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @debopamsengupta for this PR; I added some comments so let me know if they make sense to you. Happy to jump on a Google Hangouts meeting so that we can review them together; btw I've been able to pull your PR locally and run the CLI and it looks great. Very good job!

// cc @matteofigus

var path = require('path');

module.exports = function(dependencies) {
var registry = dependencies.registry,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[eslint] 'registry' is assigned a value but never used. (no-unused-vars)

var componentPath = opts.componentPath,
packageDir = path.resolve(componentPath, '_package'),
compressedPackagePath = path.resolve(componentPath, 'package.tar.gz'),
errorMessage;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[eslint] 'errorMessage' is defined but never used. (no-unused-vars)


var logSpy = {},
Registry = require('../../src/cli/domain/registry'),
registry = new Registry(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need the registry here as well

});
});
});
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also having a look at the runner's report I see that the way the tests have been nested is probably not correct:

screen shot 2017-03-28 at 21 36 01

also running a coverage report it looks like some lines are missing from your tests:

screen shot 2017-03-28 at 22 32 26

package.js |    90.63 |    83.33 |    85.71 |    90.63 |       16,43,44 |

Copy link
Member Author

@debopamsengupta debopamsengupta Mar 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattiaerre should have improved now :) also added some extra strings for success messages

Local = require('../../src/cli/domain/local'),
local = new Local({ logger: { log: function(){} } }),
readStub = sinon.stub().yields(null, 'test'),
PackageFacade = injectr('../../src/cli/facade/package.js', { read: readStub }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't really need injectr here; you can just require package

@debopamsengupta
Copy link
Member Author

@mattiaerre thanks for the comments :) made some improvements on the tests

@mattiaerre
Copy link
Member

hi @debopamsengupta thanks for updating this PR; now we have got also 100% code coverage on that component which is very good. So this LGTM 👍
I think we can merge this PR.
over to you @matteofigus

@matteofigus matteofigus merged commit 5a0af0b into opencomponents:master Mar 30, 2017
@matteofigus
Copy link
Member

Thanks for working on this @debopamsengupta, very appreciated!

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

Successfully merging this pull request may close these issues.

3 participants