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

Check for dependencies while creating a new project #169

Closed
reznord opened this issue Jun 30, 2017 · 2 comments
Closed

Check for dependencies while creating a new project #169

reznord opened this issue Jun 30, 2017 · 2 comments

Comments

@reznord
Copy link
Member

reznord commented Jun 30, 2017

It would be great to have a dependency check so we can avoid running into issues like #165

I would love to add the following code for dependency check.

@rkostrzewski @developit @lukeed any suggestions?

@reznord
Copy link
Member Author

reznord commented Jun 30, 2017

For running the check we have two choices:

  • when user installs preact-cli
  • when user creates a new project. i.e. while preact create my_app.

In the first case, there might be users who maintain multiple node versions (like me :P) for various projects and that might become a problem

In the second case we can do it as a first step before executing the create command

@lukeed
Copy link
Member

lukeed commented Jun 30, 2017

You can run the same check at both points.

{
  "postinstall": "node lib/check.js"
}

And

// src/index.js
const check = require('./lib/check');

let isValidNode = check();

if (!isValidNode) {
  return; // already logged
}

installHooks();
// continue...

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