/dholmes.co.uk-blog-frontend-code-quality-example

Example repo for the blog post: Frontend Development Code Quality - What’s Good Enough?

Primary LanguageHTMLMIT LicenseMIT

Example repo: Frontend Development Code Quality - What’s Good Enough?

Follow these blog posts related to this repo:

A simple "Hello World" application.

hello-world

Remotes:

  1. Azure DevOps
  2. GitHub
  3. GitLab

This project uses:

  1. JavaScript
  2. Node v20.9.0 (npm v10.1.0)
  3. SaSS
  4. Parcel Bundler
  5. ESLint
  6. Prettier
  7. Jest

Getting Started

  1. Run npm i: To install the dependencies
  2. Run npm start and open localhost:1234 in a browser to view the live reload development server
  3. Changes in the ./src directories will cause a live reload and compiled files to ./dist
  4. Press CTRL+c to stop the development server

Commands

NPM

Command Description
npm run clean Cleans the ./dist directory
npm run build Runs npm run clean and parcel build
npm run build:serve Runs http-server dist/ to statically serve the build in the ./dist directory
npm run lint Runs ESLint with 0 warnings argument
npm run lint:fix Runs ESLint with 0 warnings and --fix arguments
npm run prettier Runs Prettier with --check argument
npm run prettier:fix Runs Prettier with --write argument
npm run prettier-lint:fix Runs prettier-fix and lint-fix NPM scripts
npm start Runs a local development server using the Parcel Bundler
npm test Runs the unit test cases using Jest
npm run test:cov-serve Runs http-serve to statically serve the unit test coverage reports
npm run test:report-serve Runs http-serve to statically serve the unit test report
npm run test:ci Runs the unit test cases using Jest and generates reports
npm run test:watch Runs Jest with the --watchAll argument

Docker Using Make

Command Description
make build Uses Docker build to create an with a tag image based on the version in package.json
make run Runs the built Docker image as a container, viewable at localhost:5001
make stop Stops the Docker container

Credits