www.jsdelivr.com Contributing Guide
Hi! We're really excited that you're interested in contributing! Before submitting your contribution, please read through the following guide.
The website uses Ractive.js, ractive-route, and a custom build of Bootstrap v3. To add a new page, you need to create a new .html in views/pages (use one of the existing ones as a reference), and add it to client-side routing. All .html files are compiled as Ractive.js components. Styles are in a separate less directory, which mirrors the views structure.
- Bug fixes and changes discussed in the existing issues are always welcome.
- For new ideas, please open an issue to discuss them before sending a PR.
- Make sure your PR passes
npm testand has appropriate commit messages.
To get started, you need to have Node.js with NPM installed. Then run the following commands:
npm install
# to start the jsDelivr site
npm startConfiguration for IntelliJ based IDEs is also available in this repository. If you use one, it is a good idea to add https://github.com/MartinKolarik/idea-config as a read-only settings repository. It contains code style and inspection profiles used by this project.
- Check which providers are currenly in use and find a list of their locations (excluding mainland China locations), e.g.:
- Cloudflare: https://www.cloudflare.com/network/
- Fastly: https://www.fastly.com/network-map
- Update
/data/map.txt- If a provider lists two separate datacenters in the same location, include the location twice (as two separate entries, each on its own line)
- Run
node bin/geocodewhich updates the JSON version of the map.
- JS code style:
npm run lint:js - CSS code style:
npm run lint:css - Integration tests:
npm run mocha - All combined:
npm test
Most IDEs have plugins integrating the used linters (eslint, stylelint), including support for automated fixes on save.
module.exports = {
server: {
port: "SERVER_PORT", // defaults to 4400
},
};Additionally, ELASTIC_APM_SERVER_URL, ELASTIC_APM_SECRET_TOKEN, ELASTIC_SEARCH_URL (including user + pass), and NODE_ENV=production should be set.