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

[DX-185] Refactoring #681

Merged
merged 2 commits into from
Oct 3, 2017
Merged

[DX-185] Refactoring #681

merged 2 commits into from
Oct 3, 2017

Conversation

matteofigus
Copy link
Member

This is the first part of a job of cleaning up all the npm stuff.
The idea is to progressively move all the interactions to npm to an independent module for better modularity and less coupling.

if (code !== 0) {
return callback('template type not valid');
npm.installDependency(npmOptions, (err, result) => {
const errorMessage = 'template type not valid';
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: In the future we might want to improve those errors, I found that as we use the same error in different point make it quite hard to debug.

Copy link
Contributor

@nickbalestra nickbalestra left a comment

Choose a reason for hiding this comment

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

LGTM.
I think we could abstract the npm-utils even further, but that's something we can do later on.

@matteofigus matteofigus merged commit c430cf9 into master Oct 3, 2017
@matteofigus matteofigus deleted the npm-clean branch October 3, 2017 10:14

const installedCompiler = tryRequire(result.dest);

if (!isValidTemplate(compiler, { compiler: true })) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Ah! that should have been isValidTemplate(installedCompiler... instead! Bugfix coming in another PR: #694

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.

2 participants