Skip to content

Latest commit

 

History

History
70 lines (41 loc) · 4.45 KB

CONTRIBUTING.md

File metadata and controls

70 lines (41 loc) · 4.45 KB

Contributing

Issues

Please create a new issue to report any bugs, data quality issues, or missing DC micromobility services.

Development

Prerequisites

This project requires Node.js, nvm, and npm to run the local embedded web server (using serve) and Jest unit tests.

If you're only viewing this project locally, you do not need to install Node.js. You can open index.html using any local web server that you prefer (e.g., python3 -m http.server).

Installation

To clone this repo, switch to the latest LTS version of Node via nvm, and install development dependencies:

git clone git@github.com:alulsh/dc-micromobility-by-neighborhood.git
cd dc-micromobility-by-neighborhood
nvm use
npm install

Setup

If you have Node.js installed, run npm start to start a local web server on http://localhost:5000 with serve.

If you don't have Node.js installed, open index.html using a local web server that you prefer (e.g., python3 -m http.server).

Dependencies

This project uses the following production dependencies:

Types

This project uses TypeScript for types and uses @types/mapbox-gl, @types/geojson, and custom type declarations in typings/custom-typings.d.ts.

This project does not the built-in type definitions in the @turf/turf module. Instead, it uses manually copied type declarations from the Turf module source code, stored in typings/turf-typings.d.ts. This enables this project to load the Turf library from a CDN and use the Turf global variable with TypeScript. This system avoids needing to set up a module bundling or transpilation system just to use TypeScript with Turf.

Tests

Run npm test to run tests locally. This project runs tests automatically on every commit using GitHub Workflows.

This project uses Jest for tests. Since this project loads Mapbox GL JS through the Mapbox CDN instead of bundling an npm package, the Jest tests mock Mapbox GL JS using the global object in the test set up file.

This project uses eslint with the Airbnb JavaScript style guide for code quality and Prettier for code formatting.

If you're using Visual Studio Code, you can add the following to your .vscode/settings.json file for this project to enable automatic linting and formatting on save:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

Deployment

This project is hosted on GitHub Pages using the main branch. You can view the GitHub pages deployment log at https://github.com/alulsh/dc-micromobility-by-neighborhood/deployments.

You can view the live website for this project at https://www.alexandraulsh.com/dc-micromobility-by-neighborhood/.

URL redirect

The old repository name for this project was dc-bikeshare-by-neighborhood and the map was hosted at https://www.alexandraulsh.com/dc-bikeshare-by-neighborhood/. While GitHub repos automatically redirect after name changes, GitHub pages do not automatically redirect. While jekyll-redirect-from can handle redirects, this project uses client-side redirection techniques that can get your website falsely flagged as a phishing attack. As a result, the dc-bikeshare-by-neighborhood.md file in alulsh.github.io serves as a manual redirect for this project.