Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix installation from npm3 #12

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

Merged
merged 1 commit into from
Nov 18, 2015
Merged

Conversation

justinwoo
Copy link
Contributor

npm3 will flatten node_modules, so the nested node_modules that is used
for copying the JSON over from Topojson will not be available in the
package's relative node_modules. This commit uses a synchronous check to
see if the path is valid and on failure with try to use the path
expected from npm3 installations.

Tested this fix on my repo using a git url: "plotly.js": git://github.com/justinwoo/plotly.js.git#90e1c36ec12e431"

@etpinard
Copy link
Contributor

Good to know. Thanks!

We apologize for not putting any code style info in this repo yet, but plotly.js makes use of 4-space indentation.

@etpinard
Copy link
Contributor

Moreover could you add a comment mentioning that new npm@3 behavior at the top of the try block. Thanks again.

npm3 will flatten node_modules, so the nested node_modules that is used
for copying the JSON over from Topojson will not be available in the
package's relative node_modules. This commit uses a synchronous check to
see if the path is valid and on failure with try to use the path
expected from npm3 installations.
@justinwoo
Copy link
Contributor Author

Updated my commit. Let me know if the comment should say something different or be formatted differently.

@etpinard
Copy link
Contributor

@justinwoo Looks good. Thanks for doing this.

A better fix down the road would completely remove the copy-topojson step. Maybe the individual topojson files should be built in this repo on npm run build?

etpinard added a commit that referenced this pull request Nov 18, 2015
@etpinard etpinard merged commit 734f75f into plotly:master Nov 18, 2015
@justinwoo justinwoo deleted the fix-npm3-install branch November 18, 2015 17:33
@justinwoo
Copy link
Contributor Author

👍

Yeah, probably the files being built into the npm published package would be best.

@bpostlethwaite
Copy link
Member

@etpinard perhaps we can make an issue for this and then back link it to this PR?

A better fix down the road would completely remove the copy-topojson step. Maybe the individual topojson files should be built in this repo on npm run build?

@bpostlethwaite
Copy link
Member

also congrats @justinwoo ! First contributor to the open sourced Plotly.js :)

🏆

@justinwoo
Copy link
Contributor Author

🙌 🎉 🍻

@mdtusz
Copy link
Contributor

mdtusz commented Nov 18, 2015

Ahhhhh I just finished this same fix! So close.

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.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.