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

Support private packages #3

Merged
merged 4 commits into from
Apr 12, 2018
Merged

Conversation

mroswald
Copy link
Contributor

In case your packages require you to login to npm using their cli, can-npm-publish won't see them (instead getting a 404 with node-fetch). I changed the check to use npm view as suggested in #1

Copy link
Owner

@azu azu left a comment

Choose a reason for hiding this comment

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

I've commented about error message.

const viewPackage = packageName => {
return new Promise((resolve, reject) => {
const view = spawn("npm", ["view", packageName, "versions", "--json"]);
let result = "";
Copy link
Owner

Choose a reason for hiding this comment

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

Add errorResult like

let errorResult = "";

});

view.stderr.on("data", err => {
console.error(err.toString());
Copy link
Owner

Choose a reason for hiding this comment

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

errorResult += err.toString()


view.on("close", code => {
if (code > 0) {
reject();
Copy link
Owner

Choose a reason for hiding this comment

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

reject(new Error(errorResult));

We should reject with errorResult, becausereject should have Error arguments.
This error message will be output to

console.log(error.message);
.

@mroswald
Copy link
Contributor Author

@azu Thanks for your feedback, I updated the PR accordingly

@azu azu merged commit 7a43e19 into azu:master Apr 12, 2018
@azu
Copy link
Owner

azu commented Apr 12, 2018

@mroswald Thanks!

I've released v1.1.0.

@mroswald mroswald deleted the feat/support-private-packages branch October 23, 2018 14:48
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