From 04ccbcf93c1795f2c13f5714f20f9c9b757801c0 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 03:09:07 +0200 Subject: [PATCH 01/19] Write custom install dependencies script to download fonts. --- install-dependencies.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 install-dependencies.sh diff --git a/install-dependencies.sh b/install-dependencies.sh new file mode 100755 index 0000000..ab58038 --- /dev/null +++ b/install-dependencies.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Check all required CLIs are available +dependencies=( wget unzip ) +for dependency in "${dependencies[@]}"; do + command -v $dependency >/dev/null 2>&1 || { echo >&2 "‘$dependency’ command is required but it’s not installed. Aborting."; exit 1; } +done + +# Get required proprietary fonts for theme +wget -O df.zip "http://chrisswithinbank.net/wp-content/uploads/2016/06/1407-HRGQJV.zip" +if [[ -f "df.zip" ]]; then + unzip df.zip -d font/ + rm df.zip +else + echo "Can’t find file: df.zip. Fatal error…" + exit 1 +fi From 1f82e7d67475598b15eecae8250b39fa7148a9b9 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 03:16:38 +0200 Subject: [PATCH 02/19] Add Travis CI config file. --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..20e02c3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: php +php: +- '5.5' +- '5.4' +install: + - ./install-dependencies.sh + - npm install +script: + - npm run css:build From b2f47e11e8372a14449f40296f99cf8be0ce4715 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 03:33:24 +0200 Subject: [PATCH 03/19] Add bestzip to dev dependencies. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index b1c1752..a77aaee 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "homepage": "https://github.com/HGNM/hgnm-2014#readme", "devDependencies": { + "bestzip": "^1.1.3", "node-sass": "^3.7.0" } } From be0818133439c101c124a18c3fb86bc739f15d85 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 03:33:44 +0200 Subject: [PATCH 04/19] Draft build script using bestzip. --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a77aaee..59b03b9 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,10 @@ "description": "Repository for WordPress theme development for hgnm.org", "scripts": { "start": "npm run css:build && npm run css:watch", + "build": "npm run css:build && npm run bundle", "css:build": "node-sass --include-path scss scss/style.scss style.css", - "css:watch": "node-sass --include-path scss scss/style.scss style.css -w" + "css:watch": "node-sass --include-path scss scss/style.scss style.css -w", + "bundle": "bestzip hgnm-2014.zip /" }, "repository": "HGNM/hgnm-2014", "keywords": [ From 470efa37a6e085ba60d489bf3fbe31eb41966d42 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 03:39:42 +0200 Subject: [PATCH 05/19] Add cpy-cli to dev dependencies. --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 59b03b9..d59b2f0 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "homepage": "https://github.com/HGNM/hgnm-2014#readme", "devDependencies": { "bestzip": "^1.1.3", + "cpy-cli": "^1.0.1", "node-sass": "^3.7.0" } } From 4b580bac143e16854274ca63a45bed0fc5c7fa99 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:01:05 +0200 Subject: [PATCH 06/19] Use alternate version of cpy-cli to permit use of --nodir flag. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d59b2f0..2cc5458 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "homepage": "https://github.com/HGNM/hgnm-2014#readme", "devDependencies": { "bestzip": "^1.1.3", - "cpy-cli": "^1.0.1", + "cpy-cli": "github:chimon2000/cpy-cli", "node-sass": "^3.7.0" } } From bd9986ee14f03cc5b6c3999be2d878e5fcb9dea2 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:03:19 +0200 Subject: [PATCH 07/19] Draft full npm build chain. --- package.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2cc5458..15bdbb2 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,12 @@ "description": "Repository for WordPress theme development for hgnm.org", "scripts": { "start": "npm run css:build && npm run css:watch", - "build": "npm run css:build && npm run bundle", - "css:build": "node-sass --include-path scss scss/style.scss style.css", - "css:watch": "node-sass --include-path scss scss/style.scss style.css -w", - "bundle": "bestzip hgnm-2014.zip /" + "build": "npm run copy && npm run css:build && npm run zip", + "css:build": "node-sass --include-path src/scss src/scss/style.scss dist/style.css", + "css:watch": "node-sass --include-path src/scss src/scss/style.scss dist/style.css -w", + "copy": "cpy '**/*' '!scss/*' '../dist/' --cwd=src --parents --nodir", + "zip": "bestzip hgnm-2014.zip dist/", + "postinstall": "./install-dependencies.sh" }, "repository": "HGNM/hgnm-2014", "keywords": [ From 4caef0f1432a97d3999beae03f1602bc5a0ddbcb Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:16:27 +0200 Subject: [PATCH 08/19] Include copy task in npm start script. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 15bdbb2..0c2c546 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.8.0", "description": "Repository for WordPress theme development for hgnm.org", "scripts": { - "start": "npm run css:build && npm run css:watch", + "start": "npm run copy && npm run css:build && npm run css:watch", "build": "npm run copy && npm run css:build && npm run zip", "css:build": "node-sass --include-path src/scss src/scss/style.scss dist/style.css", "css:watch": "node-sass --include-path src/scss src/scss/style.scss dist/style.css -w", From a473c5e530ffafa50d5ecfe4773d8346dd2ed336 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:32:10 +0200 Subject: [PATCH 09/19] Rewrite npm scripts for reverted file structure. --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0c2c546..3a846be 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "scripts": { "start": "npm run copy && npm run css:build && npm run css:watch", "build": "npm run copy && npm run css:build && npm run zip", - "css:build": "node-sass --include-path src/scss src/scss/style.scss dist/style.css", - "css:watch": "node-sass --include-path src/scss src/scss/style.scss dist/style.css -w", - "copy": "cpy '**/*' '!scss/*' '../dist/' --cwd=src --parents --nodir", + "css:build": "node-sass --include-path scss scss/style.scss dist/style.css", + "css:watch": "node-sass --include-path scss scss/style.scss dist/style.css -w", + "copy": "cpy '**/*' '!scss/*' '!dist/*' 'dist/' --parents --nodir", "zip": "bestzip hgnm-2014.zip dist/", "postinstall": "./install-dependencies.sh" }, From b6312c6e78f279290d614f4650882518b415d622 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:33:03 +0200 Subject: [PATCH 10/19] Ignore dist/ directory. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 119cba0..9ce34d9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ ehthumbs.db Thumbs.db DalaFloda* +dist/* # Created by https://www.gitignore.io/api/node ### Node ### From e1655bfea575ab561ae164675455d0c081503fc7 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:39:31 +0200 Subject: [PATCH 11/19] Simplify build process. --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 3a846be..9174576 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "1.8.0", "description": "Repository for WordPress theme development for hgnm.org", "scripts": { - "start": "npm run copy && npm run css:build && npm run css:watch", - "build": "npm run copy && npm run css:build && npm run zip", - "css:build": "node-sass --include-path scss scss/style.scss dist/style.css", - "css:watch": "node-sass --include-path scss scss/style.scss dist/style.css -w", + "start": "npm run css:build && npm run css:watch", + "build": "npm run css:build && npm run copy && npm run zip", + "css:build": "node-sass --include-path scss scss/style.scss style.css", + "css:watch": "node-sass --include-path scss scss/style.scss style.css -w", "copy": "cpy '**/*' '!scss/*' '!dist/*' 'dist/' --parents --nodir", "zip": "bestzip hgnm-2014.zip dist/", "postinstall": "./install-dependencies.sh" From 11dc728c65c0917dc3ef3daf7fa9770a35888c7b Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:50:04 +0200 Subject: [PATCH 12/19] Switch cpy-cli repo to HTTPS. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9174576..097ac95 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "homepage": "https://github.com/HGNM/hgnm-2014#readme", "devDependencies": { "bestzip": "^1.1.3", - "cpy-cli": "github:chimon2000/cpy-cli", + "cpy-cli": "git+https://github.com/chimon2000/cpy-cli.git", "node-sass": "^3.7.0" } } From 5be9b785407b1a700dd156c89367fdf92963d8ce Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 04:54:18 +0200 Subject: [PATCH 13/19] Update Travis CI configuration to reflect new build scripts. --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20e02c3..9a9401a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ php: - '5.5' - '5.4' install: - - ./install-dependencies.sh - npm install script: - - npm run css:build + - npm run build From ee01769a389a52752e878ed55f0ef42042db6c5a Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:07:51 +0200 Subject: [PATCH 14/19] Add node version to engines field. --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 097ac95..2422c63 100644 --- a/package.json +++ b/package.json @@ -26,5 +26,8 @@ "bestzip": "^1.1.3", "cpy-cli": "git+https://github.com/chimon2000/cpy-cli.git", "node-sass": "^3.7.0" + }, + "engines": { + "node": ">=4.0.0" } } From ef5d19cd1ab97b17278fd5777022360126e55ff7 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:10:08 +0200 Subject: [PATCH 15/19] Add Node versions to Travis CI config. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9a9401a..970939c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: php php: - '5.5' - '5.4' +node_js: +- '4' +- '4.2' +- '5.1' install: - npm install script: From b5f1aca8e84454b21adc7f7c316cb16765634672 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:14:03 +0200 Subject: [PATCH 16/19] Switch Travis CI language setting to node_js. --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 970939c..424b044 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,4 @@ -language: php -php: -- '5.5' -- '5.4' +language: node_js node_js: - '4' - '4.2' From 1839a7919eb29b7def22b438c2f98b00936e7f36 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:24:32 +0200 Subject: [PATCH 17/19] Add deploy section to Travis CI configuration. --- .travis.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.travis.yml b/.travis.yml index 424b044..c2c6c5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,3 +7,13 @@ install: - npm install script: - npm run build +deploy: + provider: releases + api_key: + secure: CJa6+7F3KMRxjwdAx/4zgLU55l1uUE3CPUN0ezitehbcJX+yQoKfM0LevIgZw2UVjyGD3xXttTe3YDG0ypG9jqqxhJSa3bA7dV9OnP4+rY/vPvjZLRmBTqSjb5S/d4oB78l4hxgxw7+RuwEr0DXhaFJ4BzJ00zplQ9TAmlPOZPs= + file: hgnm-2014.zip + skip_cleanup: true + on: + repo: HGNM/hgnm-2014 + tags: true + node: '4.2' From 618b678905c9f058aaf28aabeb9e9357da43705c Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:34:06 +0200 Subject: [PATCH 18/19] Fix copy script so that it only includes essential theme files in dist. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2422c63..63bed23 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "npm run css:build && npm run copy && npm run zip", "css:build": "node-sass --include-path scss scss/style.scss style.css", "css:watch": "node-sass --include-path scss scss/style.scss style.css -w", - "copy": "cpy '**/*' '!scss/*' '!dist/*' 'dist/' --parents --nodir", + "copy": "cpy '**/*' '!scss/*' '!dist/*' '!.gitignore' '!.travis.yml' '!install-dependencies.sh' '!node_modules/**/*' '!hgnm-2014.zip' 'dist/' --parents --nodir", "zip": "bestzip hgnm-2014.zip dist/", "postinstall": "./install-dependencies.sh" }, From cad836ddfbb08dd9fa08223ac9aa8020ca761b02 Mon Sep 17 00:00:00 2001 From: delucis Date: Fri, 10 Jun 2016 05:34:51 +0200 Subject: [PATCH 19/19] Ignore generated ZIP archive. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9ce34d9..4c747ca 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ ehthumbs.db Thumbs.db DalaFloda* dist/* +hgnm-2014.zip # Created by https://www.gitignore.io/api/node ### Node ###