Giter Club home page Giter Club logo

document-download-frontend's Introduction

document-download-frontend

GOV.UK Notify frontend for downloading documents uploaded via Document Download API.

Setting up

Python version

Check the version in runtime.txt.

NodeJS version

If you don't have NodeJS on your system, install it with homebrew.

brew install node

nvm is a tool for managing different versions of NodeJS. Follow the guidance on nvm's github repository to install it.

Once installed, run the following to switch to the version of NodeJS for this project. If you don't have that version, it should tell you how to install it.

nvm use

Pre-commit

We use pre-commit to ensure that committed code meets basic standards for formatting, and will make basic fixes for you to save time and aggravation.

Install pre-commit system-wide with, eg brew install pre-commit. Then, install the hooks in this repository with pre-commit install --install-hooks.

To run the application

# install dependencies, etc.
make bootstrap

make run-flask

To test the application

# install dependencies, etc.
make bootstrap

make test

Common tasks

Automatically rebuilding the frontend assets

If you want the front end assets to re-compile on changes, leave this running in a separate terminal from the app

npm run watch

Updating the Node version for frontend builds

Edit the respective node version specified in the .nvmrc file.

Run nvm install to install the new Node version.

The version specified in the .nvmrc file is also used to select the Node version used in CI builds:

  • Creating a PR with an updated version will build the PR using that version
  • Merging a version change will build and deploy the frontend assets using the new version

Ensure that an LTS Node version is specified. This will also ensure the corresponding LTS NPM version is also installed.

Updating GOV.UK Frontend

Keeping GOV.UK Frontend versions in sync

We have GOV.UK Frontend as a dependency in two places:

  • In python, our requirements.in specifies a version of govuk-frontend-jinja for our jinja templates
  • In node, our package.json specifies a version of govuk-frontend for our fonts, images and sass files

We need to ensure that the version of govuk-frontend that the python library relies on always matches the version of govuk-frontend in our package.json exactly.

If you're bumping either library, make sure the version of the python library supports the same version of govuk-frontend defined in our package.json, as referred to in the govuk-frontend-jinja compatibility table.

Keeping the HTML footer up to date

We override the govuk-frontend footer. If you bump the version of govuk-frontend-jinja, you should ensure that the footer HTML stays up to date with the version of govuk-frontend-jinja. See the comment in that file for more details.

Further documentation

document-download-frontend's People

Contributors

allait avatar antimega avatar benthorner avatar corlettb avatar crystalpea avatar dependabot[bot] avatar gov-cjwaszczuk avatar idavidmcdonald avatar jonathan-ryding avatar karlchillmaid avatar klssmith avatar leohemsted avatar playfair0 avatar pyup-bot avatar quis avatar richardc0 avatar risicle avatar rjbaker avatar robbrazil avatar sakisv avatar samuelhwilliams avatar tombye avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.