Skip to content

Info for Maintainers

Bryan Housel edited this page Aug 27, 2023 · 5 revisions

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

  • Node.js version 16 or newer
  • git for your platform

 

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 in package.json

 

Building the index

  • npm run build
    • Takes a few seconds and should be run whenever the resources/* or features/* files change
    • Processes custom locations under features/**/*.geojson into dist/featureCollection.json
    • Make sure to check in code when done, with something like git add . && git commit -m 'npm run build'

 

Testing your changes locally

  • npm run local
    • Creates a folder docs-local/ with an index.html and completeFeatureCollection.json for testing
    • Starts a server listening on http://localhost:8081
    • You can now browse to that address and see your changes in action.

 

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

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 correctness
  • npm run test - Runs tests agains the Javascript code
  • npm run - Lists other available commands

Home

For Contributors

For Developers

Information for developers using the osm-community-index in another project.

For Maintainers

Information for maintainers, including how to clone and build the project.

 

Clone this wiki locally