From 2d1b3cf2fb982e21955275b81ea909724695ba63 Mon Sep 17 00:00:00 2001 From: Darren Hurley Date: Tue, 28 Feb 2017 11:37:18 +0000 Subject: [PATCH] Spring clean --- .npmignore | 1 + n.Makefile | 18 ++++++++++++++---- package.json | 13 +++++-------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.npmignore b/.npmignore index 67bfbad..c24738d 100644 --- a/.npmignore +++ b/.npmignore @@ -4,6 +4,7 @@ /.gitignore /circle.yml /ft.yml +/n.Makefile /Makefile /.idea/ diff --git a/n.Makefile b/n.Makefile index 4830977..e23f86d 100644 --- a/n.Makefile +++ b/n.Makefile @@ -28,7 +28,7 @@ NPM_INSTALL = npm prune --production=false && npm install BOWER_INSTALL = bower prune && bower install --config.registry.search=http://registry.origami.ft.com --config.registry.search=https://bower.herokuapp.com JSON_GET_VALUE = grep $1 | head -n 1 | sed 's/[," ]//g' | cut -d : -f 2 IS_GIT_IGNORED = grep -q $(if $1, $1, $@) .gitignore -VERSION = v1.5.5 +VERSION = v14 APP_NAME = $(shell cat package.json 2>/dev/null | $(call JSON_GET_VALUE,name)) DONE = echo ✓ $@ done CONFIG_VARS = curl -fsL https://ft-next-config-vars.herokuapp.com/$1/$(call APP_NAME)$(if $2,.$2,) -H "Authorization: `heroku config:get APIKEY --app ft-next-config-vars`" @@ -92,7 +92,7 @@ ifneq ($(CIRCLE_BUILD_NUM),) # The app is using n-ui ifneq ($(shell grep -s -Fim 1 n-ui bower.json),) # versions in package.json and bower.json are not equal -ifneq ($(shell grep -s -Fim 1 \"version\" bower_components/n-ui/.bower.json | sed s/,//),$(shell grep -s -Fim 1 \"version\" node_modules/@financial-times/n-ui/package.json | sed s/,//)) +ifneq ($(shell awk '$$1 == "\"version\":" {print $$2}' bower_components/n-ui/.bower.json | sed s/,//),$(shell awk '$$1 == "\"version\":" {print $$2}' node_modules/@financial-times/n-ui/package.json | sed s/,//)) $(error 'Projects using n-ui must maintain parity between versions. Rebuild without cache and update your bower.json and package.json if necessary') endif endif @@ -157,7 +157,7 @@ heroku-cli: # VERIFY SUB-TASKS _verify_eslint: - @if [ -e .eslintrc.js ]; then $(call GLOB,'*.js') | xargs eslint && $(DONE); fi + @if [ -e .eslintrc.js ]; then $(call GLOB,'*.js') | xargs eslint --ignore-pattern '!' && $(DONE); fi _verify_lintspaces: @if [ -e .editorconfig ] && [ -e package.json ]; then $(call GLOB) | xargs lintspaces -e .editorconfig -i js-comments -i html-comments && $(DONE); fi @@ -175,7 +175,9 @@ _verify_pa11y_testable: _run_pa11y: echo $(CIRCLE_BRANCH) ifneq ($(CIRCLE_BRANCH),) - @export TEST_URL=http://${TEST_APP}.herokuapp.com; pa11y-ci; + @export TEST_URL=${TEST_APP}; \ + echo ${TEST_APP} | grep http -s || export TEST_URL=http://${TEST_APP}.herokuapp.com; \ + pa11y-ci; else @export TEST_URL=http://local.ft.com:3002; pa11y-ci; endif @@ -211,3 +213,11 @@ hel%: ## help: Show this help message. @echo "" @echo "targets:" @grep -Eh '^.+:\ ##\ .+' ${MAKEFILE_LIST} | cut -d ' ' -f '3-' | column -t -s ':' + +# Wrapper for make deploy which prevents it running when build is a nightly +deploy-by-day: +ifeq ($(FT_NIGHTLY_BUILD),) + $(MAKE) deploy +else + echo "Nightly build - exiting before deploy" +endif diff --git a/package.json b/package.json index 01b26a7..dff44c8 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,15 @@ { "name": "@financial-times/n-logger", "version": "0.0.0", - "main": "dist/main.js", - "repository": { - "type": "git", - "url": "git://github.com/Financial-Times/next-logger.git" - }, "license": "MIT", + "main": "dist/main.js", + "repository": "Financial-Times/next-logger.git", "scripts": { "prepublish": "make build" }, "dependencies": { "request": "^2.67.0", - "winston": "^1.1.1" + "winston": "^2.3.1" }, "devDependencies": { "babel-cli": "^6.5.1", @@ -21,8 +18,8 @@ "chai": "^3.4.0", "chai-string": "^1.1.6", "eslint": "^3.0.1", - "lintspaces-cli": "^0.3.0", - "mocha": "^2.2.1", + "lintspaces-cli": "^0.6.0", + "mocha": "^3.2.0", "npm-prepublish": "^1.2.1", "sinon": "^1.17.0", "sinon-chai": "^2.8.0"