Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 2.85 KB

CONTRIBUTING.md

File metadata and controls

55 lines (37 loc) · 2.85 KB

www.jsdelivr.com Contributing Guide

Hi! We're really excited that you're interested in contributing to www.jsdelivr.com! Before submitting your contribution, please read through the following guide.

Overview

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.

Guidelines

  • 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 test and has appropriate commit messages.

Repo Setup

To get started, you need to have Node.js with NPM installed. Then run the following commands:

npm install
npm start

Configuration 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.

Updating the network map

  1. Check which providers are currenly in use and find a list of their locations (excluding mainland China locations), e.g.:
  2. 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)
  3. Run node bin/geocode which updates the JSON version of the map.

Testing

  • 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.

Production config

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.