Skip to content

Commit

Permalink
REFACTOR tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
nilswindisch committed Mar 8, 2018
1 parent 489c417 commit b7d7f2f
Show file tree
Hide file tree
Showing 19 changed files with 55 additions and 111 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export MODE="production"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
assets/css
assets/img/optimized
dist
build
jekyll/assets/css
jekyll/assets/img
node_modules
Expand Down
13 changes: 13 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
# shellcheck disable=SC1091

source ./.env
source ./bin/lib.sh

log "🎬 Build start"

imgBuild
scssBuild
jekyllBuild

log "🏁 Build done"
6 changes: 5 additions & 1 deletion bin/dev.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash
# shellcheck disable=SC1091

source ./.env
export MODE="development"
source ./bin/lib.sh

browsersyncStart & imgWatch & scssWatchDev & jekyllWatchDev
log "🎬 DEV start"

browsersyncStart & imgWatch & scssWatch & jekyllWatch
12 changes: 0 additions & 12 deletions bin/dist.sh

This file was deleted.

14 changes: 0 additions & 14 deletions bin/jekyll-build--dev--netlify.sh

This file was deleted.

6 changes: 0 additions & 6 deletions bin/jekyll-build--dev.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/scss-build--dev.sh → bin/jekyll-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

source ./bin/lib.sh

scssBuildDev
jekyllBuild
28 changes: 10 additions & 18 deletions bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ function cssCopyToJekyll() {
cp ./assets/css/style.css.map ./jekyll/assets/css/style.css.map
}

function distCleanup() {
log "🗑️ DIST Clean-Up"
rm -rf dist
function buildCleanup() {
log "🗑️ Build Clean-Up"
rm -rf build
}

function log() {
Expand All @@ -46,34 +46,26 @@ function logCleanup() {
log "🗑️ LOG Clean-Up"
}

function scssWatchDev() {
function scssWatch() {
log "😳 SCSS watch"
./node_modules/.bin/nodemon \
-e scss \
--watch assets/scss \
-x ./bin/scss-build--dev.sh
--verbose \
-x ./bin/scss-build.sh
}

function scssBuildDev() {
function scssBuild() {
scssProcess
postcssPrefix
postcssCalc
postcssFontvalues
postcssObjectfit
postcssSelectornot
postcssCustomproperties
cssCopyToJekyll
}

function scssBuildDist() {
scssProcess
postcssPrefix
postcssCalc
postcssFontvalues
postcssObjectfit
postcssSelectornot
postcssCustomproperties
postcssO
if [ "$MODE" = "production" ]; then
postcssO
fi
cssCopyToJekyll
}

Expand Down
1 change: 1 addition & 0 deletions bin/lib/image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function imgWatch() {
./node_modules/.bin/nodemon \
-e jpeg,jpg,png,svg,gif \
--watch assets/img/original \
--verbose \
-x "./bin/img-build.sh"
}

Expand Down
37 changes: 14 additions & 23 deletions bin/lib/jekyll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,28 @@
# shellcheck disable=SC2154
# shellcheck disable=SC2086

function jekyllBuildDist() {
log "🏗️ JEKYLL build [DIST]"
bundle exec \
jekyll build \
--config jekyll_config_base.yml,jekyll_config_dist.yml
}

function jekyllBuildNetlify() {
log "🏗️ JEKYLL build [NETLIFY]"
bundle exec \
jekyll build \
--config jekyll_config_base.yml,jekyll_config_netlify.yml
}

function jekyllBuildDev() {
log "🏗️ JEKYLL build [DEV]"
bundle exec \
jekyll build \
--config jekyll_config_base.yml
}

function jekyllCleanup() {
log "🗑️ JEKYLL Clean-Up"
rm -r ./jekyll/assets/img/*
rm -r ./jekyll/assets/css/*
}

function jekyllWatchDev() {
function jekyllWatch() {
log "😳 JEKYLL watch"
./node_modules/.bin/nodemon \
-e md,html,css,js,png,jpg,jpeg,svg \
--watch jekyll \
-x "./bin/jekyll-build--dev.sh; ./bin/browsersync-reload.sh;"
--verbose \
-x "./bin/jekyll-build.sh; ./bin/browsersync-reload.sh;"
}

function jekyllBuild() {
log "🏗️ JEKYLL build"
JEKYLL_CONF="jekyll_config_base.yml"
if [ "$MODE" = "production" ]; then
JEKYLL_CONF=$JEKYLL_CONF",jekyll_config_build.yml"
fi
bundle exec \
jekyll build \
--config $JEKYLL_CONF
}
12 changes: 0 additions & 12 deletions bin/netlify.sh

This file was deleted.

4 changes: 2 additions & 2 deletions bin/predist.sh → bin/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ./bin/lib.sh

logCleanup
distCleanup
buildCleanup
jekyllCleanup
imgCleanup
mkdir dist
mkdir build
2 changes: 2 additions & 0 deletions bin/predev.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
# shellcheck disable=SC1091

source ./.env
MODE=development
source ./bin/lib.sh

logCleanup
Expand Down
10 changes: 0 additions & 10 deletions bin/prenetlify.sh

This file was deleted.

2 changes: 1 addition & 1 deletion bin/scss-watch--dev.sh → bin/scss-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

source ./bin/lib.sh

scssBuildDev
scssBuild
2 changes: 1 addition & 1 deletion jekyll_config_netlify.yml → jekyll_config_build.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
title: "GRO DSpaceCRIS Design 2017"
destination: "dist"
destination: "build"
2 changes: 0 additions & 2 deletions jekyll_config_dist.yml

This file was deleted.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"name": "Mockup-Template",
"version": "0.0.1",
"description": "Lorem ipsum dolor sit amut.",
"contributors": [
"Nils Windisch"
],
"contributors": ["Nils Windisch"],
"homepage": "https://gro-dspacecris-design-2017.netlify.com/",
"author": "Nils Windisch <[email protected]>",
"devDependencies": {
Expand Down Expand Up @@ -80,10 +78,8 @@
}
},
"scripts": {
"predist": "./bin/predist.sh",
"dist": "./bin/dist.sh",
"prenetlify": "./bin/prenetlify.sh",
"netlify": "./bin/netlify.sh",
"prebuild": "./bin/prebuild.sh",
"build": "./bin/build.sh",
"predev": "./bin/predev.sh",
"dev": "./bin/dev.sh",
"sassdoc": "./bin/sassdoc.sh"
Expand Down

0 comments on commit b7d7f2f

Please sign in to comment.