Skip to content

NDLANO/editorial-frontend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7e8917c · Apr 11, 2023
Dec 14, 2022
Dec 8, 2022
Mar 22, 2023
Jan 25, 2023
Mar 16, 2023
Apr 11, 2023
Dec 12, 2022
Dec 14, 2022
Dec 4, 2018
Mar 11, 2021
Mar 18, 2021
Mar 16, 2023
Apr 23, 2018
Sep 16, 2022
Apr 27, 2017
Dec 14, 2022
Apr 27, 2017
Dec 14, 2022
May 18, 2017
Nov 4, 2021
Mar 10, 2023
Dec 7, 2022
Dec 7, 2022
Mar 29, 2023
Nov 11, 2022
Jun 26, 2019
Feb 13, 2019
Dec 7, 2022
Mar 1, 2023
Mar 29, 2023

Repository files navigation

CI

ED

NDLA Editorial Frontend for producing content for NDLA

Requirements

  • Node.JS 18
  • yarn ~1.15.0
  • Docker (optional)

Getting started

What's in the box?

  • React
  • Express
  • Webpack + Babel (ES6)

Dependencies

All dependencies are defined in package.json and are managed with npm/yarn. To initially install all dependencies and when the list dependency has changed, run yarn install.

$ yarn install

Start development server

Start node server with hot reloading middleware listening on port 3000.

$ yarn start

To use a different api set the NDLA_ENVIRONMENT environment variable.

Unit tests

Test framework: Jest with React Testing Library.

$ yarn test

e2e tests

Cypress is used for end to end testing.

$ yarn cy

To circumvent api call flakiness all request are mocked when the tests are run on ci. Use the following command to record new mocks when api-calls change:

$ yarn e2e-record-fixtures

To run the e2e tests with recorded/mocked api-calls run

$ yarn e2e-use-fixtures

Code style

tl;dr: Use prettier and eslint!

Format code with prettier to get uniform codestyle:

$ yarn format

Lint code with eslint, including eslint react plugin, eslint-plugin-import, eslint-plugin-jsx-a11y. Beside linting with globally installed eslint, eslint can be invoked with yarn:

$ yarn lint

Rules are configured in ./.eslintrc.js and extends eslint-config-react-app. If feeling brave, try eslint --fix.

Other scripts

# Create minified production ready build with webpack:
$ yarn build
# Docker stuff
$ ./build.sh