From 3fc910391604d71734d0fc1ace1069232c16eb9c Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 23 Jan 2018 14:41:14 -0500 Subject: [PATCH] adding build pipline to the theme added glm-dev dir to store our custom js and styles using gulp --- .gitignore | 1 + assets/javascript/glm-dev.js | 1 + assets/stylesheets/glm-dev.css | 3 ++ assets/stylesheets/glm-dev.css.map | 1 + functions.php | 3 ++ glm-dev/js/glm-dev.js | 3 ++ glm-dev/scss/_body.scss | 0 glm-dev/scss/_footer.scss | 0 glm-dev/scss/_header.scss | 13 +++++++ glm-dev/scss/glm-dev.scss | 3 ++ gulpfile.js | 58 ++++++++++++++++++++++++++++++ package.json | 24 +++++++++++++ template-parts/top-nav.php | 2 +- 13 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 assets/javascript/glm-dev.js create mode 100644 assets/stylesheets/glm-dev.css create mode 100644 assets/stylesheets/glm-dev.css.map create mode 100644 glm-dev/js/glm-dev.js create mode 100644 glm-dev/scss/_body.scss create mode 100644 glm-dev/scss/_footer.scss create mode 100644 glm-dev/scss/_header.scss create mode 100644 glm-dev/scss/glm-dev.scss create mode 100644 gulpfile.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/assets/javascript/glm-dev.js b/assets/javascript/glm-dev.js new file mode 100644 index 0000000..1da16fe --- /dev/null +++ b/assets/javascript/glm-dev.js @@ -0,0 +1 @@ +jQuery(function(n){}); \ No newline at end of file diff --git a/assets/stylesheets/glm-dev.css b/assets/stylesheets/glm-dev.css new file mode 100644 index 0000000..b9d0f88 --- /dev/null +++ b/assets/stylesheets/glm-dev.css @@ -0,0 +1,3 @@ +.top-menu-left .top-bar .top-bar-section ul.dropdown.menu .menu-item a{padding:.5rem 1rem} + +/*# sourceMappingURL=glm-dev.css.map */ diff --git a/assets/stylesheets/glm-dev.css.map b/assets/stylesheets/glm-dev.css.map new file mode 100644 index 0000000..b492567 --- /dev/null +++ b/assets/stylesheets/glm-dev.css.map @@ -0,0 +1 @@ +{"version":3,"file":"glm-dev.css","sources":["glm-dev.scss","_header.scss","_body.scss","_footer.scss"],"sourcesContent":["@import 'header';\n@import 'body';\n@import 'footer';",".top-menu-left{\n .top-bar{\n .top-bar-section{\n ul.dropdown.menu{\n .menu-item{\n a{\n padding: .5rem 1rem;\n }\n }\n }\n }\n }\n}","",""],"mappings":"ACAA,AAKoB,cALN,CACV,QAAQ,CACJ,gBAAgB,CACZ,EAAE,AAAA,SAAS,AAAA,KAAK,CACZ,UAAU,CACN,CAAC,AAAA,CACG,OAAO,CAAE,UAAW,CACvB","names":[]} \ No newline at end of file diff --git a/functions.php b/functions.php index 8d2dc7f..931a500 100644 --- a/functions.php +++ b/functions.php @@ -253,6 +253,9 @@ function wmta_scripts() { wp_enqueue_script( 'wmta-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); + wp_enqueue_script( 'glm-dev', get_template_directory_uri() . '/assets/javascript/glm-dev.js', array(), '20130115', true ); + wp_enqueue_style( 'glm-style', get_template_directory_uri() . '/assets/stylesheets/glm-dev.css' ); + if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } diff --git a/glm-dev/js/glm-dev.js b/glm-dev/js/glm-dev.js new file mode 100644 index 0000000..31b2162 --- /dev/null +++ b/glm-dev/js/glm-dev.js @@ -0,0 +1,3 @@ +jQuery(function($){ + +}); \ No newline at end of file diff --git a/glm-dev/scss/_body.scss b/glm-dev/scss/_body.scss new file mode 100644 index 0000000..e69de29 diff --git a/glm-dev/scss/_footer.scss b/glm-dev/scss/_footer.scss new file mode 100644 index 0000000..e69de29 diff --git a/glm-dev/scss/_header.scss b/glm-dev/scss/_header.scss new file mode 100644 index 0000000..d33e44b --- /dev/null +++ b/glm-dev/scss/_header.scss @@ -0,0 +1,13 @@ +.top-menu-left{ + .top-bar{ + .top-bar-section{ + ul.dropdown.menu{ + .menu-item{ + a{ + padding: .5rem 1rem; + } + } + } + } + } +} \ No newline at end of file diff --git a/glm-dev/scss/glm-dev.scss b/glm-dev/scss/glm-dev.scss new file mode 100644 index 0000000..42a8abb --- /dev/null +++ b/glm-dev/scss/glm-dev.scss @@ -0,0 +1,3 @@ +@import 'header'; +@import 'body'; +@import 'footer'; \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..475e6be --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,58 @@ +var gulp = require('gulp'); +var rename = require('gulp-rename'); +var sass = require('gulp-sass'); +var concat = require('gulp-concat'); +var copy = require('gulp-copy'); +var uglify = require('gulp-uglify'); +var jshint = require('gulp-jshint'); +var clean = require('gulp-clean'); +var maps = require('gulp-sourcemaps'); +var babel = require("gulp-babel"); +var jade = require('gulp-jade-php'); + +function swallowError (error) { + // If you want details of the error in the console + console.log(error.toString()) + this.emit('end') +} + +function swallowError (error) { + // If you want details of the error in the console + console.log(error.toString()); + this.emit('end'); +} +gulp.task('sass', function() { + return gulp.src('glm-dev/scss/glm-dev.scss') + .pipe(maps.init()) + .on('error', swallowError) + .pipe(sass({ + outputStyle: 'compressed' + })).on('error', swallowError) + .pipe(maps.write('.')) + .pipe(gulp.dest('assets/stylesheets')); +}); + +gulp.task('lint', function (){ + return gulp.src('glm-dev/js/*.js') + .pipe(jshint()) + .on('error', swallowError) + .pipe(jshint.reporter('default')); +}); + +gulp.task("concat-uglify", function (){ + return gulp.src(['glm-dev/js/**/*.js']) + .pipe(concat('glm-dev.js')) + .pipe(uglify()) + .pipe(gulp.dest('assets/javascript')); +}); +gulp.task('clean', function (){ + return gulp.src(['js/foundation.min.js', 'js/motion-ui.min.js', 'js/what-input.min.js','js/custom/dist.js' ,'js/app.js','css/app.css','css/app.css.map','js/transpiled/dist.js'], {read: false}) + .pipe(clean()); +}); +gulp.task('watch', function () { + gulp.watch('glm-dev/js/**/*.js',['concat-uglify', 'lint']); + gulp.watch('glm-dev/scss/**/*.{scss,sass}', ['sass']); +}); +gulp.task('build', ["copy-bower","sass"]); +gulp.task('runwatch', ["sass", "concat-uglify","lint"]); +gulp.task('default', ["runwatch","watch"]); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..9862aa2 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "coldwater", + "description": "Gaslight Media", + "version": "0.0.1", + "devDependencies": { + "gulp": "^3.9.0", + "gulp-autoprefixer": "^3.1.0", + "gulp-babel": "^6.1.2", + "gulp-clean": "^0.3.2", + "gulp-concat": "^2.6.0", + "gulp-copy": "0.0.2", + "gulp-jshint": "^2.0.1", + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.3.2", + "gulp-sourcemaps": "^1.6.0", + "gulp-uglify": "^2.0.0", + "jshint": "^2.9.2", + "node-sass": "^3.8.0", + "babel-preset-es2015": "~6.13.2" + }, + "dependencies": { + "gulp-jade-php": "^2.0.0-0" + } +} diff --git a/template-parts/top-nav.php b/template-parts/top-nav.php index 4b4bcb6..68b5a29 100644 --- a/template-parts/top-nav.php +++ b/template-parts/top-nav.php @@ -17,7 +17,7 @@ -