Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 2.98 KB

CONTRIBUTING.md

File metadata and controls

55 lines (42 loc) · 2.98 KB

Project setup

Before starting development, you'll need to have the following software installed on your machine:

  • A recent version of NodeJS. Node 12 is recommended.
  • A recent version of Yarn. Yarn 1.22 is recommended.

After that, set up the project as follows:

  • Clone the repo.
  • cd into the project directory and run yarn to install the dependencies.
  • yarn netlify login to authenticate with Netlify. This link shows the permission dialog that you should expect to see.
  • yarn netlify link --name condescending-perlman-ec107b.
  • yarn netlify dev to start a local development server. This command will securely download environment variables and use them in the development build. After a few minutes, the server will be ready and you can access it on port 8888 of localhost. You can safely ignore the following warning message if it shows up in the terminal: warning: Cannot load local env variables [...]..
  • If you want to run a production build locally (for example, to troubleshoot a failed build on the server), run yarn netlify build.

Netlify functions

You can create and develop Netlify functions locally using the Netlify CLI. If you use netlify dev to locally develop the front-end, the front-end will use the local version of Netlify functions. This allows you to develop and test Netlify functions locally before deploying to production.

Unit tests

This project contains a few small unit tests. You can run them by running:

  • yarn jest to run the tests once
  • yarn jest:watch to run the tests in interactive watch mode.

Integration tests:

To run the Cypress integration tests:

  • In one terminal window, run yarn netlify dev.
  • In another terminal window, run yarn cypress:open. This will open a UI where you can select which test suites to run.

Adding and editing blog posts

  • Log in to the visual editor interface at covi19hg.org/admin
  • Choose "Blog" among the collections in the left sidebar and pick an existing blog post to edit or click "New blog" in the top right corner to create a new post.
  • The editor allows allows rich text formatting as shown below:

Insert heading, bold/italicize text, add link

Insert image