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

Fix bolt install validations #39

Open
jamiebuilds opened this issue Oct 22, 2017 · 6 comments
Open

Fix bolt install validations #39

jamiebuilds opened this issue Oct 22, 2017 · 6 comments

Comments

@jamiebuilds
Copy link
Member

#36 refactored bolt install and moved a bunch of validations into a shared module.

The problem is that these validations previously caused Bolt to exit early, now they aren't run until the linking phase.

These validations should be hoisted up

@jamiebuilds
Copy link
Member Author

cc @lukebatchelor

@lukebatchelor
Copy link
Member

Hmmm... I did notice it was moved, do you think itd be better to have the checked up location, or separated into another module?

@jamiebuilds
Copy link
Member Author

I would break it into three steps:

async function install() {
  let everythingNeededToSymlink = await validateAndReturnInstallSymlinksStuff();
  await yarn.install();
  await symlinkAllTheStuff(everythingNeededToSymlink);
}

@ajaymathur
Copy link
Member

Half way through, I realised we cannot move logic to get symlinks/ and validate for bin before install as it we don't know bin (s) until they are installed..

Should we just have validation logic for external and internal dependencies before install but validation for bin after install?

@jamiebuilds
Copy link
Member Author

jamiebuilds commented Feb 6, 2018

What are we validating with bins?

@ajaymathur
Copy link
Member

Following are the validation for bin

pathIsInside(actualBinFile, project.pkg.nodeModules)`
if (!actualBinFileRelative) {
      throw new BoltError('${binName} is not a symlink');
}

There is a comment on this too:

 // TODO: For now, we'll search through each of the bin files in the Project and find which ones are
 // dependencies we are symlinking. In the future, we should really be going through each dependency
 // and all of its dependencies and checking which ones expose bins so that all the transitive ones
 // are included too

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

3 participants