Skip to content

Commit

Permalink
Update grunt copy and grunt babel. Change main.js boilerplate to use …
Browse files Browse the repository at this point in the history
…loadjs. New restore-db script attempts to create the database if it doesn't exist first making first run on a new machine easier. Update neat to version 2.1.0 and switch over to an autoprefixer from bourbon deprecated functions
  • Loading branch information
spAnser committed Jul 17, 2017
1 parent 5209b4f commit 0393c23
Show file tree
Hide file tree
Showing 27 changed files with 505 additions and 120 deletions.
25 changes: 25 additions & 0 deletions root/.editor-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
tabLength: 4
extensionConfig:
coffee:
tabLength: 2
cson:
tabLength: 2
es6:
tabLength: 2
js:
tabLength: 2
json:
tabLength: 2
sh:
tabLength: 2
grammarConfig:
Babel:
tabLength: 2
CoffeeScript:
tabLength: 2
JSON:
tabLength: 2
JSX:
tabLength: 2
Javascript:
tabLength: 2
1 change: 1 addition & 0 deletions root/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/
src/media/
src/fontello/scss
docs/_book
/vendor/
8 changes: 4 additions & 4 deletions root/Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = (grunt) ->

global['craftMajor'] = 2
global['craftMinor'] = 6
global['craftBuild'] = 2958
global['craftBuild'] = 2986

# Automatically loads all Grunt tasks
require('load-grunt-tasks')(grunt)
Expand All @@ -19,7 +19,7 @@ module.exports = (grunt) ->
grunt.task.run ['craft_install']

grunt.registerTask 'install', ['bower_install', 'update_craft']
grunt.registerTask 'build-base', ['install', 'clean:main', 'mkdir', 'fontello:dist', 'regex-replace:fontello', 'copy:main', 'copy:loadjs', 'copy:vendor', 'copy:craft_plugins', 'copy:craft', 'csscomb', 'sass', 'csscount', 'copy:css']
grunt.registerTask 'build', ['build-base', 'babel:dist', 'uglify', 'cssmin', 'assets_hash']
grunt.registerTask 'build-dev', ['build-base', 'babel:dev', 'assets_hash']
grunt.registerTask 'build-base', ['install', 'clean:main', 'mkdir', 'fontello:dist', 'regex-replace:fontello', 'copy:main', 'copy:loadjs', 'copy:vendor', 'copy:craft_plugins', 'copy:craft', 'csscomb', 'sass', 'copy:css']
grunt.registerTask 'build', ['build-base', 'postcss:dist', 'babel:dist', 'uglify', 'cssmin', 'csscount', 'assets_hash']
grunt.registerTask 'build-dev', ['build-base', 'postcss:dev', 'babel:dev', 'csscount', 'assets_hash']
grunt.registerTask 'default', ['build-dev', 'watch']
2 changes: 1 addition & 1 deletion root/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {%= name %}
---
### Currently running craft version 2.6 (2931)
### Currently running craft version 2.6 (2986)

### Prerequisites:

Expand Down
4 changes: 1 addition & 3 deletions root/addSubmodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ plugins=(
["craft_plugins/ContactForm"]=https://github.com/pixelandtonic/ContactForm.git
["craft_plugins/cookies"]=https://github.com/nystudio107/cookies.git
["craft_plugins/CpFieldLinks-Craft"]=https://github.com/mmikkel/CpFieldLinks-Craft.git
["craft_plugins/craft-cpcss"]=https://github.com/lindseydiloreto/craft-cpcss
["craft_plugins/Craft-FocusPoint"]=https://github.com/smcyr/Craft-FocusPoint.git
["craft_plugins/craft-neo"]=https://github.com/benjamminf/craft-neo.git
["craft_plugins/craft-quick-field"]=https://github.com/benjamminf/craft-quick-field.git
["craft_plugins/craft-relabel"]=https://github.com/benjamminf/craft-relabel.git
["craft_plugins/craft-sitemap"]=https://github.com/Pennebaker/craft-sitemap.git
["craft_plugins/craft.cache-clear"]=https://github.com/themccallister/craft.cache-clear.git
["craft_plugins/craftcms-blueprint"]=https://github.com/bjerenec/craftcms-blueprint.git
["craft_plugins/craftcms-thearchitect"]=https://github.com/Pennebaker/craftcms-thearchitect.git
["craft_plugins/CraftFieldNotes"]=https://github.com/Pennebaker/craftfieldnotes.git
Expand All @@ -34,6 +31,7 @@ plugins=(
["craft_plugins/SuperTable"]=https://github.com/engram-design/SuperTable.git
["craft_plugins/craft-typogrify"]=https://github.com/jamiepittock/craft-typogrify
["craft_plugins/craft-safedelete"]=https://github.com/christianruhstaller/craft-safedelete.git
["craft_plugins/craft-nocache"]=https://github.com/benjamminf/craft-nocache.git
)

for i in "${!plugins[@]}"
Expand Down
8 changes: 4 additions & 4 deletions root/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
],
"dependencies": {
"jquery": "~2.1.4",
"bourbon": "~4.2.4",
"neat": "~1.7.2",
"bourbon": "~4.3.3",
"neat": "~2.1.0",
"modernizr": "~2.8.3",
"normalize-scss": "~3.0.3",
"omega-reset-for-bourbon-neat": "joshfry/omega-reset-for-bourbon-neat",
Expand Down Expand Up @@ -50,7 +50,7 @@
},
"resolutions": {
"jquery": "~2.1.4",
"neat": "~1.7.2",
"bourbon": "~4.2.4"
"neat": "~2.1.0",
"bourbon": "~4.3.3"
}
}
27 changes: 27 additions & 0 deletions root/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "pennebaker/strathmoreproducts.com",
"type": "project",
"authors": [
{
"name": "Pennebaker",
"email": "[email protected]"
}
],
"repositories": [
{
"type":"package",
"package": {
"name": "nystudio107/cookies",
"version":"1.0.4",
"source": {
"url": "https://github.com/nystudio107/cookies.git",
"type": "git",
"reference":"1.0.4"
}
}
}
],
"require": {
"nystudio107/cookies": "1.0.4"
}
}
4 changes: 4 additions & 0 deletions root/data/restore-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ while [[ ${database_imported} == "False" ]]; do
if [ "${Choice}" -gt "${#files[@]}" ]; then
echo 'Please choose a number from the list.'
else
db_exists=`mysql -u root --skip-column-names -e "show databases like '$db_name'"`
if [ "$db_exists" != "$db_name" ]; then
mysql -u root -e "create database $db_name character set UTF8 collate utf8_bin"
fi
mysql -uroot $db_name < ${files[$Choice]}
database_imported="True"
fi
Expand Down
18 changes: 14 additions & 4 deletions root/grunt/babel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,19 @@ module.exports = (grunt) ->
dist:
options:
sourceMap: false
files:
'dist/public/assets/scripts/main.js': 'src/assets/scripts/main.js'
files: [
expand: true
cwd: 'src/assets/scripts'
src: ['*.es6']
dest: 'dist/public/assets/scripts/'
ext: '.js'
]
dev:
files:
'dist/public/assets/scripts/main.js': 'src/assets/scripts/main.js'
files: [
expand: true
cwd: 'src/assets/scripts'
src: ['*.es6']
dest: 'dist/public/assets/scripts/'
ext: '.js'
]
return
45 changes: 42 additions & 3 deletions root/grunt/copy.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,22 @@ module.exports = (grunt) ->
src: '**'
dest: 'dist/craft/templates'
}
{
# Redactor Configs
expand: true
cwd: 'content-models/redactor/configs'
src: '**'
dest: 'dist/craft/config/redactor'
filter: 'isFile'
}
{
# Generator Content Models
expand: true
cwd: 'content-models/models'
src: '**'
dest: 'dist/craft/config/thearchitect'
filter: 'isFile'
}
]
css:
files: [
Expand Down Expand Up @@ -123,6 +139,13 @@ module.exports = (grunt) ->
dest: 'dist/public/assets/scripts'
filter: 'isFile'
}
{
expand: true
cwd: 'bower_components/waypoints/lib/shortcuts'
src: 'inview.js'
dest: 'dist/public/assets/scripts'
filter: 'isFile'
}
{
expand: true
cwd: 'bower_components/slick-carousel/slick'
Expand Down Expand Up @@ -214,7 +237,7 @@ module.exports = (grunt) ->
# Assets, except .scss files
expand: true
cwd: 'src/assets'
src: ['**', '!**/*.scss']
src: ['**', '!**/*.scss', '!**/*.es6']
dest: 'dist/public/assets'
filter: 'isFile'
}
Expand Down Expand Up @@ -487,8 +510,8 @@ module.exports = (grunt) ->
# SimpleMap Plugin
expand: true
cwd: 'craft_plugins/SimpleMap'
src: '**'
dest: 'dist/craft/plugins/simplemap'
src: 'simplemap/**'
dest: 'dist/craft/plugins'
filter: 'isFile'
}
{
Expand All @@ -499,5 +522,21 @@ module.exports = (grunt) ->
dest: 'dist/craft/plugins'
filter: 'isFile'
}
{
# Import Plugin
expand: true
cwd: 'craft_plugins/import'
src: '**'
dest: 'dist/craft/plugins/import'
filter: 'isFile'
}
{
# No-Cache Plugin
expand: true
cwd: 'craft_plugins/craft-nocache'
src: 'nocache/**'
dest: 'dist/craft/plugins'
filter: 'isFile'
}
]
return
21 changes: 21 additions & 0 deletions root/grunt/postcss.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
autoprefixer = require('autoprefixer')
cssnano = require('cssnano')

module.exports = (grunt) ->
grunt.config 'postcss',
dist:
options:
processors: [
autoprefixer({browsers: 'last 3 versions'})
cssnano()
]
src: 'dist/public/assets/styles/*.css'
dev:
options:
processors: [
autoprefixer({browsers: 'last 3 versions'})
]
map:
inline: false
src: 'dist/public/assets/styles/*.css'
return
2 changes: 1 addition & 1 deletion root/grunt/regex-replace.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = (grunt) ->
}
{
name: 'scss-varaibles'
search: /^\.([a-z\-]+):before { content(: '\\[a-z0-9]+';) }(.*)$/gmi
search: /^\.([a-z0-9\-]+):before { content(: '\\[a-z0-9]+';) }(.*)$/gmi
replace: (fullstring, codeName, code, comment) -> '$' + codeName + code + comment
}
]
Expand Down
2 changes: 1 addition & 1 deletion root/grunt/sass.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = (grunt) ->
includePaths: [
'src/assets/styles'
'bower_components/bourbon/app/assets/stylesheets'
'bower_components/neat/app/assets/stylesheets'
'bower_components/neat/core'
'bower_components/omega-reset-for-bourbon-neat/dist'
'bower_components/normalize-scss'
'bower_components/sass-web-fonts'
Expand Down
2 changes: 1 addition & 1 deletion root/grunt/watch.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = (grunt) ->
files: ['src/assets/**/*.scss']
tasks: ['csscomb', 'sass', 'csscount', 'assets_hash']
scripts:
files: ['src/assets/**/*.js']
files: ['src/assets/**/*.js', 'src/assets/**/*.es6']
tasks: ['babel:dev', 'assets_hash']
templates:
files: ['src/craft/**/*', 'src/templates/**/*.html', 'src/templates/**/*.twig', 'src/templates/**/*.js', ]
Expand Down
5 changes: 4 additions & 1 deletion root/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"license": "UNLICENSED",
"private": true,
"devDependencies": {
"autoprefixer": "^6.7.7",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"bower": "^1.4.1",
"cssnano": "^3.10.0",
"grunt": "^0.4.5",
"grunt-assets-hash": "github:pennebaker/grunt-assets-hash",
"grunt-babel": "^6.0.0",
Expand All @@ -20,7 +22,7 @@
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-connect": "^0.10.1",
"grunt-contrib-copy": "^0.8.1",
"grunt-contrib-cssmin": "^1.0.2",
"grunt-contrib-cssmin": "^2.0.0",
"grunt-contrib-uglify": "^0.9.1",
"grunt-contrib-watch": "^0.6.1",
"grunt-critical": "^0.2.2",
Expand All @@ -30,6 +32,7 @@
"grunt-fontello": "github:spanser/grunt-fontello",
"grunt-if-contains": "^1.0.2",
"grunt-mkdir": "^1.0.0",
"grunt-postcss": "^0.8.0",
"grunt-regex-replace": "^0.3.0",
"grunt-sass": "^1.0.0",
"grunt-zip": "^0.17.0",
Expand Down
20 changes: 10 additions & 10 deletions root/rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,44 @@ echo "Which rsync do you want to run?"
read Choice

if [ "${Choice}" -eq "0" ]; then
rsync -avzh {%= server_user %}:/srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media ./src
rsync -avzh {%= server_user %}:/srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media ./src

elif [ "${Choice}" -eq "1" ]; then
rsync -avzh {%= server_user %}:/srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media ./src
rsync -avzh {%= server_user %}:/srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media ./src

elif [ "${Choice}" -eq "2" ]; then
rsync -avzh {%= server_user %}:/srv/{%= domain_name %}_{%= domain_tld %}/public/media ./src
rsync -avzh {%= server_user %}:/srv/{%= domain_name %}_{%= domain_tld %}/public/media ./src

elif [ "${Choice}" -eq "3" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media
EOF

elif [ "${Choice}" -eq "4" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/{%= domain_name %}_{%= domain_tld %}/public/media
EOF

elif [ "${Choice}" -eq "5" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media
EOF

elif [ "${Choice}" -eq "6" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/{%= domain_name %}_{%= domain_tld %}/public/media
EOF

elif [ "${Choice}" -eq "7" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/dev_{%= domain_name %}_{%= domain_tld %}/public/media
EOF

elif [ "${Choice}" -eq "8" ]; then
ssh {%= server_user %} << EOF
ssh {%= server_user %} << EOF
rsync -avzh /srv/{%= domain_name %}_{%= domain_tld %}/public/media/ /srv/stage_{%= domain_name %}_{%= domain_tld %}/public/media
EOF

else
echo "Incorrect Selection"
echo "Incorrect Selection"
fi
Empty file added root/src/assets/scripts/app.es6
Empty file.
Loading

0 comments on commit 0393c23

Please sign in to comment.