This projects uses version 2
of the package-lock.json file. Version 2
requires npm
7+. npm 8
comes prebundled with Node 16
. Note: Node 14
should be used for now. Vercel doesn't support 16
yet.
- Clone the repo
npm install
This installs dependencies from package-lock.json
.
Generate keys in Contentful. See Settings > API keys.
Copy the .env.local.example
file in this directory to .env.local
:
cp .env.local.example .env.local
Then set each variable on .env.local
:
CONTENTFUL_SPACE_ID
should be the Space ID field of your API KeyCONTENTFUL_ACCESS_TOKEN
should be the Content Delivery API - access token field of your API keyCONTENTFUL_PREVIEW_TOKEN
should be the Content Preview API - access token field of your API keyCONTENTFUL_ENVIRONMENT
should be the branch of the space
npm run dev
This will:
- start the dev server.
npm run lint
This will:
- run linters
npm run build
This will:
- compiles TypeScript and generates
dist
directory
ESLint is utilized to enforce JavaScript standards. Please see the .eslintrc.json
file for config.
Run npm run lint
before committing to ensure your changes follow our coding standards.
All available module path aliases (such as @components
) are set as compilerOptions.paths
in tsconfig.json
. Prefer using these aliases (giving priority to the most specific) over relative paths (such as ../components
) to reference modules within the application.
If a new alias needs to be added, be sure to include it in tsconfig.json
.
EditorConfig helps maintain consistent file formatting between different editors and developers. Please install the plugin for you editor of choice. Please see the .editorconfig
file at the root of this repo to see what settings are enforced.