Denomas Code Lab

Skip to content
  • Rafal Proszowski's avatar
    da80c306
    Node.js project boilerplate for use on paas · da80c306
    Rafal Proszowski authored
    * Opinionated javascript linting using `xo`, a library that runs a
      lintier for us. It is very opinionated which means we can adopt some
      standards and slightly amend them where necessary.
    * Uses webpack to manage the dependencies of the application
    * Uses the GOV.UK template from govuk_template_jinja project
    * Configured to allow easily importing components from
      govuk-fronend project
      protection middleware
    * Structure is 'feature' focused
    * Webserver is an express app, each dir is a logical section ie
      'space' which contains handler code, test code and templates.
    * Nunjucks templating to take advantage of the govuk-frontend macros
    * 100% test coverage is enforced by istambul/nyc
    * tests use node-tap for it's simplicity, good docs, async support and
      integration with the other tools
    * The `supertest` library will be used for testing the HTTP assertions.
    * helpful `npm run *` scripts for linting/testing/fixing
    * Ready to deploy to GOV.UK PaaS via `npm run production:push`
    * Travis runs tests targetting node 8
    * Hot code reloading when using `npm run dev:start`
    * Structured logging setup via pino (and prettified during dev mode)
    * Content Security Policy enforced by helmet middleware
    * We are using an MIT license inline with other projects.
    * Adding .editorconfig to keep the standards from GDS way.
    * SASS is a CSS extension language which introduces a lot of useful stuff,
      such as mixins, functions and logic. This is handled by `node-sass`.
    * We enable travis to check for known module vulnerabilities with [snyk]
    
    And last but not least, we're going to be using `webpack` to keep on top
    of our development. Webpack is a task runner which could be used for
    many things, and in our case is used to compile SASS into CSS with some
    extra config such as `includePaths` for the GOV.UK modules.
    
    It introduces a lot of plugins: `*-loader`,
    `extract-loader` and `sass-loader` to make it
    easier for ourselves to automatically import any necessary bits from
    different modules into our working space.
    
    We're definig a set of `npm` scripts for easier use of the tooling. It's
    much like a `make` targets essentially. These can be executed with `npm
    run X`
    
    [snyk]: https://snyk.io/
    da80c306
    Node.js project boilerplate for use on paas
    Rafal Proszowski authored
    * Opinionated javascript linting using `xo`, a library that runs a
      lintier for us. It is very opinionated which means we can adopt some
      standards and slightly amend them where necessary.
    * Uses webpack to manage the dependencies of the application
    * Uses the GOV.UK template from govuk_template_jinja project
    * Configured to allow easily importing components from
      govuk-fronend project
      protection middleware
    * Structure is 'feature' focused
    * Webserver is an express app, each dir is a logical section ie
      'space' which contains handler code, test code and templates.
    * Nunjucks templating to take advantage of the govuk-frontend macros
    * 100% test coverage is enforced by istambul/nyc
    * tests use node-tap for it's simplicity, good docs, async support and
      integration with the other tools
    * The `supertest` library will be used for testing the HTTP assertions.
    * helpful `npm run *` scripts for linting/testing/fixing
    * Ready to deploy to GOV.UK PaaS via `npm run production:push`
    * Travis runs tests targetting node 8
    * Hot code reloading when using `npm run dev:start`
    * Structured logging setup via pino (and prettified during dev mode)
    * Content Security Policy enforced by helmet middleware
    * We are using an MIT license inline with other projects.
    * Adding .editorconfig to keep the standards from GDS way.
    * SASS is a CSS extension language which introduces a lot of useful stuff,
      such as mixins, functions and logic. This is handled by `node-sass`.
    * We enable travis to check for known module vulnerabilities with [snyk]
    
    And last but not least, we're going to be using `webpack` to keep on top
    of our development. Webpack is a task runner which could be used for
    many things, and in our case is used to compile SASS into CSS with some
    extra config such as `includePaths` for the GOV.UK modules.
    
    It introduces a lot of plugins: `*-loader`,
    `extract-loader` and `sass-loader` to make it
    easier for ourselves to automatically import any necessary bits from
    different modules into our working space.
    
    We're definig a set of `npm` scripts for easier use of the tooling. It's
    much like a `make` targets essentially. These can be executed with `npm
    run X`
    
    [snyk]: https://snyk.io/
This project is licensed under the MIT License. Learn more
Loading