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

feat: npm on ipfs #911

Merged
merged 31 commits into from
Jun 13, 2019
Merged

feat: npm on ipfs #911

merged 31 commits into from
Jun 13, 2019

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Apr 21, 2019

Please see #907 (comment) (went with the last option).

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@ghost ghost assigned hacdias Apr 21, 2019
@ghost ghost added the in progress label Apr 21, 2019
@hacdias
Copy link
Member Author

hacdias commented Apr 21, 2019

@lidel @olizilla could you go over the code, see my TODOs and tell me your opinion about those topics, please? Also, if you find something else that looks odd, ask. I want this working the best it can and as reversible as possible. 😃

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias
Copy link
Member Author

hacdias commented Apr 22, 2019

One more note: since we're adding sudo-prompt to #906 (see comments), then we can overcome the permissions issue on Linux here with it too.

Please let's keep this PR to do after #906.

@olizilla
Copy link
Member

olizilla commented May 2, 2019

@hacdias did you want to update this PR now that #906 has been merged?

@hacdias
Copy link
Member Author

hacdias commented May 2, 2019

@olizilla I do and I will 😃

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias
Copy link
Member Author

hacdias commented Jun 5, 2019

So we decided to just install ipfs-npm package with this PR and not change anything else in the system. For what is worth, the PR looks finished. We just need a toggler in the UI to install/uninstall ipfs-npm.

@lidel I think we already talked about this: I'm running npm (un)install -g as the user that's running IPFS Desktop. That might not work on all environments. It should work on Windows and macOS, but what about Linux?

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@lidel
Copy link
Member

lidel commented Jun 5, 2019

@hacdias I don't want us to spend too much time debugging fringe Linux distributions at this time.
It should work for most people using mainstream defaults, and power users will not mind doing it manually. Just make sure there is proper error handling when npm install -g ipfs-npm fails, asking user to run "npm i -g ipfs-npm" manually. 👌

@hacdias
Copy link
Member Author

hacdias commented Jun 5, 2019

Completely agree @lidel! Thanks.

So, for this PR to be merged, we only need to wait for ipfs/ipfs-webui#1048 and decide how to send the errors and change the options. Otherwise, it already works.

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias hacdias changed the title wip: npm on IPFS feat: npm on ipfs Jun 6, 2019
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
return
}
} catch (e) {
logger.error('[npm on ipfs] ipfs-npm: could not check if up to date %v', e)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe throw? we shouldn't let it fall through the next log line.

Copy link
Member Author

Choose a reason for hiding this comment

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

My idea here was to ignore this error and update it anyways. It will fail for most people due to a bug on npm, which was not yet released: https://github.com/ipfs-shipyard/ipfs-desktop/blob/feat/npm-on-ipfs/src/late/npm-on-ipfs/package.js#L10-L11

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias
Copy link
Member Author

hacdias commented Jun 11, 2019

@olizilla could you take one last look at this please?

@hacdias hacdias requested a review from fsdiogo June 12, 2019 14:58
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
@hacdias
Copy link
Member Author

hacdias commented Jun 13, 2019

Two issues arising on Travis ATM not related to the PR:

Copy link
Contributor

@fsdiogo fsdiogo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

src/late/npm-on-ipfs/index.js Outdated Show resolved Hide resolved
Co-Authored-By: Diogo Silva <fsdiogo@gmail.com>
@hacdias
Copy link
Member Author

hacdias commented Jun 13, 2019

Travis also failing on master with timeout getting go-ipfs binary. I'm merging this.

@hacdias hacdias merged commit ce7291f into master Jun 13, 2019
@hacdias hacdias deleted the feat/npm-on-ipfs branch June 13, 2019 18:37
@andrew
Copy link
Contributor

andrew commented Jun 13, 2019

🎉

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.

5 participants