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

Run community index locally #433

Closed
kmpoppe opened this issue Apr 1, 2021 · 3 comments
Closed

Run community index locally #433

kmpoppe opened this issue Apr 1, 2021 · 3 comments

Comments

@kmpoppe
Copy link
Collaborator

kmpoppe commented Apr 1, 2021

Hi all!

I wanted to test a change I made - which runs perfectly through npm run test but I would LOVE to be able to see the impact my changes have.

There is no npm serve and I cannot for the life of me figure out how to get on from here.

Any help would be appreciated!

^K

@kmpoppe
Copy link
Collaborator Author

kmpoppe commented Apr 2, 2021

Never mind, found that I can publish /docs to my own gh-pages environment, that way I can test what I wanted to test.

@kmpoppe kmpoppe closed this as completed Apr 2, 2021
@bhousel
Copy link
Member

bhousel commented Apr 2, 2021

Hey @kmpoppe sorry I didn't respond earlier. There isn't a great way to test the file locally but it sounds like you figured it out.

You can replace the dataURL line in index.html to point to another file instead of having it fetch the latest featureCollection pushed to the main branch.

var previous = '';
var dataURL = 'https://cdn.jsdelivr.net/gh/osmlab/osm-community-index@main/dist/completeFeatureCollection.min.json';

I could definitely make this easier with an npm serve command if you want to do this more? Let me know if you want this reopened.

@kmpoppe
Copy link
Collaborator Author

kmpoppe commented Apr 2, 2021

Hi @bhousel and thanks for welcoming me :-) After having figured out the way over gh-pages I was able to understand that the locationSet can be used without explicitly creating a .geoJSON in /resources.

I just installed npm http-server - which works perfectly when serving /docs with the dataURL. Essentially, I now just have to create a .gitignored /docs that uses a local dataURL so that I can only push the change of any feature.

And yes, there's so much to do ... #423 has a whole bunch of things one could care for :)

Question though: I use Windows and have to change .eslint so that the npm run test doesn't complain about line breaks. What line break format do I have to keep in the feature-file? LF or CRLF?

Thanks for your great work!

^Kai

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

2 participants