Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Commit

Permalink
🐷 add brunch
Browse files Browse the repository at this point in the history
🐛 add call to correct script

🐍 regenerate yarn.lock following rebase
  • Loading branch information
ajthomascouk committed Oct 17, 2017
1 parent 0c186be commit 15990d5
Show file tree
Hide file tree
Showing 8 changed files with 1,051 additions and 74 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM node:8.4.0-alpine

RUN apk add --no-cache python=2.7.13-r1 git-perl bash make gcc g++
RUN rm /bin/sh && ln -s /bin/bash /bin/sh

ENV USERNAME nodeuser

RUN adduser -D "$USERNAME" && \
Expand All @@ -23,6 +26,6 @@ USER root
RUN find /code -user 0 -print0 | xargs -0 chown "$USERNAME":"$USERNAME"
USER $USERNAME

RUN [ "yarn", "run", "build-css" ]
RUN if [ "$NODE_ENV" == "production" ]; then yarn run brunch-build; fi

CMD [ "node", "app.js" ]
12 changes: 5 additions & 7 deletions app/views/layout.nunjucks
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@

<title>{% if errorMessage %}Please retry - {% endif %}{% block pageTitle %}NHS.UK{% endblock %}</title>

{% set qs = '?v=19' %}
<!--[if gt IE 8]><!--><link href="{{ SITE_ROOT }}/nhsuk.css" media="screen" rel="stylesheet" type="text/css"><!--<![endif]-->
<!--[if IE 6]><link href="{{ SITE_ROOT }}/nhsukie6.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 7]><link href="{{ SITE_ROOT }}/nhsukie7.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 8]><link href="{{ SITE_ROOT }}/nhsukie8.css" media="screen" rel="stylesheet" type="text/css" /><![endif]-->

<!--[if gt IE 8]><!--><link href="{{ SITE_ROOT }}/nhsuk.css{{ qs }}" media="screen" rel="stylesheet" type="text/css"><!--<![endif]-->
<!--[if IE 6]><link href="{{ SITE_ROOT }}/nhsuk-ie6.css{{ qs }}" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 7]><link href="{{ SITE_ROOT }}/nhsuk-ie7.css{{ qs }}" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
<!--[if IE 8]><link href="{{ SITE_ROOT }}/nhsuk-ie8.css{{ qs }}" media="screen" rel="stylesheet" type="text/css" /><![endif]-->

<link rel="stylesheet" href="{{ SITE_ROOT }}/print.css{{ qs }}" media="print" type="text/css">
<link rel="stylesheet" href="{{ SITE_ROOT }}/print.css" media="print" type="text/css">

{% if HOTJAR_ANALYTICS_TRACKING_ID %}
<!-- rational for this code being in head: https://docs.hotjar.com/v1.0/docs/manual -->
Expand Down
1 change: 1 addition & 0 deletions assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
44 changes: 44 additions & 0 deletions brunch-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports = {
paths: {
watched: ['scss-c2s']
},
conventions: {
ignored: 'scss-c2s/c2s-ie.scss'
},
overrides: {
development: {
sourceMaps: false,
},
production: {
sourceMaps: false,
plugins: {
afterBrunch: [
'sleep 1s && yarn map-replace app/views/layout.nunjucks < assets.json'
]
}
}
},
files: {
stylesheets: {
joinTo: {
'nhsuk.css': /c2s.scss/,
'nhsukie6.css': /c2s-ie6.scss/,
'nhsukie7.css': /c2s-ie7.scss/,
'nhsukie8.css': /c2s-ie8.scss/,
'print.css': /c2s-print.scss/
},
}
},
plugins: {
sass: {
options: {
includePaths: ['scss-0.5.1']
}
},
fingerprint: {
srcBasePath: 'public/',
destBasePath: 'public/',
hashLength: 8
}
}
};
12 changes: 0 additions & 12 deletions css-build

This file was deleted.

10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Web app to display useful information about GP practices Pharmacies",
"main": "server.js",
"scripts": {
"build-css": "./css-build",
"brunch-build": "yarn brunch build --production",
"coverage-check": "istanbul check-coverage --config .istanbul.yml",
"coverage-check-unit": "istanbul check-coverage --config .istanbul.unit.yml",
"coverage-generate": "yarn istanbul -- cover _mocha -- --exit --recursive",
Expand All @@ -18,7 +18,7 @@
"precommit": "yarn git-hook",
"prepush": "yarn git-hook && yarn snyk test",
"start": "node app.js",
"start-watch": "nodemon app.js | ./node_modules/bunyan/bin/bunyan & nodemon -e scss -x yarn build-css -- compact",
"start-watch": "yarn brunch watch & nodemon app.js | ./node_modules/bunyan/bin/bunyan",
"test": "NODE_ENV=test mocha --exit --recursive test",
"test-ci": "yarn lint && yarn coverage-generate && yarn coverage-check && yarn coverage-upload-coveralls",
"test-watch": "yarn test -- --watch --reporter min"
Expand All @@ -34,20 +34,26 @@
},
"homepage": "https://github.com/nhsuk/profiles#readme",
"dependencies": {
"after-brunch": "^0.0.5",
"body-parser": "^1.18.2",
"brunch": "^2.10.10",
"compression": "^1.7.1",
"cookie-parser": "^1.4.3",
"crypto-js": "^3.1.9-1",
"elasticsearch": "^13.3.1",
"express": "4.15.5",
"express-prom-bundle": "^3.1.0",
"fingerprint-brunch": "^2.0.2",
"helmet": "^3.8.1",
"map-replace": "^1.0.2",
"nhsuk-bunyan-logger": "^1.4.1",
"node-sass": "^4.5.3",
"nunjucks": "^3.0.1",
"object.values": "^1.0.4",
"on-headers": "^1.0.1",
"request": "^2.81.0",
"require-environment-variables": "^1.1.2",
"sass-brunch": "^2.10.4",
"snyk": "^1.41.1",
"timekeeper": "^2.0.0"
},
Expand Down
1 change: 0 additions & 1 deletion scss-c2s/c2s.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ $warning-border: #fcd775;
/*
HTML elements
*/

html {
background-color:$blue;
}
Expand Down
Loading

0 comments on commit 15990d5

Please sign in to comment.