Info for Maintainers - osmlab/osm-community-index GitHub Wiki
This page contains useful information for maintainers, including how to clone and build the project.
You don't need to know all of this if you just want to contribute to the index!
Prerequisites
Project Setup
Installing
- Clone this project, for example:
git clone [email protected]:osmlab/osm-community-index.git
cd
into the project folder,- Run
npm install
to install libraries
Updates
git pull origin --rebase
is a good way to keep your local copy of the code updated- rerun
npm install
whenever dependencies are updated inpackage.json
Building the index
npm run build
- Takes a few seconds and should be run whenever the
resources/*
orfeatures/*
files change - Processes custom locations under
features/**/*.geojson
intodist/featureCollection.json
- Make sure to check in code when done, with something like
git add . && git commit -m 'npm run build'
- Takes a few seconds and should be run whenever the
Testing your changes locally
npm run local
- Creates a folder
docs-local/
with anindex.html
andcompleteFeatureCollection.json
for testing - Starts a server listening on
http://localhost:8081
- You can now browse to that address and see your changes in action.
- Creates a folder
Releasing
npm run dist
- Takes a few seconds and generates all the files in
dist/*
- Make sure to check in code when done, with something like
git add . && git commit -m 'npm run dist'
- Projects which pull osm-community-index data from GitHub (such as https://openstreetmap.community) will appear updated soon after
npm run dist
- Other downstream projects may pull from
dist/*
too
- Takes a few seconds and generates all the files in
To publish an official release, follow the steps in the Release Checklist.
- Official releases are stable forever and available via NPM or on CDNs like JSDelivr
- Projects which pull osm-community-index from NPM or a CDN (such as Rapid) will appear updated soon after publishing
- Publishing the code to NPM requires rights to run
npm publish
Other commands
npm run lint
- Checks the JavaScript code for correctnessnpm run test
- Runs tests agains the Javascript codenpm run
- Lists other available commands