Skip to content
This repository has been archived by the owner on Aug 17, 2019. It is now read-only.

Installer refactor + getPrefix() #6

Merged
merged 1 commit into from
Sep 2, 2017
Merged

Installer refactor + getPrefix() #6

merged 1 commit into from
Sep 2, 2017

Conversation

zkat
Copy link
Owner

@zkat zkat commented Sep 2, 2017

This rewrites the toplevel installer such that it uses object+method style instead of a bunch of toplevel functions. This is mainly useful so we can keep installer state over time: for example, I plan on using this to keep a "logical tree" around that I can use so scripts run in their logical dependency order.

As a bonus, this also pulls in get-prefix so we calculate the installer prefix using the same logic as npm.

@zkat zkat requested a review from mikesherov September 2, 2017 10:45
@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage decreased (-21.5%) to 74.497% when pulling 5195d69 on zkat/refactor into f631203 on latest.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-21.5%) to 74.497% when pulling 5195d69 on zkat/refactor into f631203 on latest.

@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage decreased (-21.5%) to 74.497% when pulling c7d44b5 on zkat/refactor into f631203 on latest.

Copy link
Collaborator

@mikesherov mikesherov left a comment

Choose a reason for hiding this comment

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

Looks great! I had a few questions. Also, can you write tests for getPrefix? I'd really like to not regress coverage on the repo. If not, I'll write some later, as I plan on turning on the --100 option for tap at some point.

}
}

module.exports._fileExists = fileExists
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to export this?

Copy link
Owner Author

Choose a reason for hiding this comment

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

unit testing

})
}

module.exports._isRootPath = isRootPath
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question as above.

Copy link
Owner Author

Choose a reason for hiding this comment

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

same answer as above

bin/cli.js Outdated
main(parseArgs()).then((details) => {
console.log(`added ${details.count} packages in ${
details.time / 1000
new Installer(parseArgs()).then(details => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be .run().then(...)? Does this mean the tests don't currently exercise the CLI portion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Correct!

Copy link
Owner Author

Choose a reason for hiding this comment

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

oh yeah. I fixed this in a different branch. Fix't

@coveralls
Copy link

coveralls commented Sep 2, 2017

Coverage Status

Coverage increased (+1.4%) to 97.315% when pulling 2c5f8b2 on zkat/refactor into f631203 on latest.

@mikesherov
Copy link
Collaborator

Shucks, I wish I knew about tacks before making my own, essentially. Looks good!

console.log(`added ${details.count} packages in ${
details.time / 1000
new Installer(parseArgs()).run().then(details => {
console.error(`added ${details.pkgCount} packages in ${
Copy link
Collaborator

Choose a reason for hiding this comment

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

Error on success?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Just writing it to stderr because it's not really meant as user data. Just informative side-stuff.

@zkat zkat merged commit 3dbf42a into latest Sep 2, 2017
@zkat zkat deleted the zkat/refactor branch September 2, 2017 21:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants