From 257a8ede40ce38b0f3d9b400dc2b6b067b3ad801 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Fri, 23 Sep 2016 10:16:27 -0400 Subject: [PATCH] setting up gulp and sass in the member db --- .gitignore | 1 + css/glm-grid.css | 2 ++ css/glm-grid.css.map | 1 + gulpfile.js | 43 +++++++++++++++++++++++++++++++++++++++++++ package.json | 21 +++++++++++++++++++++ scss/_glm-grid.scss | 0 scss/_settings.scss | 0 scss/app.scss | 2 ++ 8 files changed, 70 insertions(+) create mode 100644 css/glm-grid.css create mode 100644 css/glm-grid.css.map create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 scss/_glm-grid.scss create mode 100644 scss/_settings.scss create mode 100644 scss/app.scss diff --git a/.gitignore b/.gitignore index 2b59d87e..53f75f14 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ misc/smarty/** media/images/** .project +node_modules diff --git a/css/glm-grid.css b/css/glm-grid.css new file mode 100644 index 00000000..7466a853 --- /dev/null +++ b/css/glm-grid.css @@ -0,0 +1,2 @@ + +/*# sourceMappingURL=glm-grid.css.map */ diff --git a/css/glm-grid.css.map b/css/glm-grid.css.map new file mode 100644 index 00000000..5cd26453 --- /dev/null +++ b/css/glm-grid.css.map @@ -0,0 +1 @@ +{"version":3,"file":"glm-grid.css","sources":["app.scss","_glm-grid.scss","_settings.scss"],"sourcesContent":["@import 'glm-grid';\n@import 'settings';","",""],"mappings":"","names":[],"sourceRoot":"/source/"} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..d1ca2606 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,43 @@ +var gulp = require('gulp'); +var rename = require('gulp-rename'); +var sass = require('gulp-sass'); +var maps = require('gulp-sourcemaps'); + +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('scss/app.scss') + .pipe(maps.init()) + .on('error', swallowError) + .pipe(sass({ + outputStyle: 'compressed' + })).on('error', swallowError) + .pipe(rename('glm-grid.css')) + .pipe(maps.write('.')) + .pipe(gulp.dest('css')); +}); + +gulp.task('watch', function () { + gulp.watch('scss/**/*.{scss,sass}', ['sass']); + gulp.watch('gulpfile.js'); +}); + +gulp.task('build', ["sass"]); + +gulp.task('runwatch', ["sass"]); + +gulp.task('default', ["runwatch","watch"]); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..d2e80abb --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "glm-member-db", + "version": "0.0.0", + "description": "=== Gaslight Media Member Database === Contributors: cscott@gaslightmedia.com Donate link: http://www.gaslightmedia.com Tags: Gaslight Media,Plugin,Members Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git@cvs2:WP-Plugins/glm-member-db.git" + }, + "author": "", + "license": "ISC", + "dependencies": { + "gulp": "~3.9.1", + "gulp-sass": "~2.3.2", + "gulp-rename": "~1.2.2", + "gulp-sourcemaps": "~1.6.0" + } +} diff --git a/scss/_glm-grid.scss b/scss/_glm-grid.scss new file mode 100644 index 00000000..e69de29b diff --git a/scss/_settings.scss b/scss/_settings.scss new file mode 100644 index 00000000..e69de29b diff --git a/scss/app.scss b/scss/app.scss new file mode 100644 index 00000000..95c71f3d --- /dev/null +++ b/scss/app.scss @@ -0,0 +1,2 @@ +@import 'glm-grid'; +@import 'settings'; \ No newline at end of file -- 2.17.1