forked from stamen/ecoengine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert ecoengine explore to be a bower package and use the gulp buil…
…d process
- Loading branch information
Eric Gelinas
committed
Feb 26, 2015
1 parent
fb9b987
commit e0727fa
Showing
14 changed files
with
19,363 additions
and
1,919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directory | ||
# Commenting this out is preferred by some people, see | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- | ||
node_modules | ||
|
||
# Users Environment Variables | ||
.lock-wscript | ||
|
||
bower_components | ||
|
||
.sass-cache | ||
|
||
public/js | ||
public/css | ||
public/*.html | ||
|
||
.env.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
"use strict"; | ||
|
||
var fs = require("fs"); | ||
|
||
var copy = require("gulp-copy"), | ||
gulp = require("gulp"), | ||
jshint = require("gulp-jshint"), | ||
rename = require("gulp-rename"), | ||
replace = require("gulp-replace"), | ||
run = require("gulp-run"), | ||
sourcemaps = require("gulp-sourcemaps"), | ||
uglify = require("gulp-uglify"), | ||
env = require('gulp-env'), | ||
webserver = require("gulp-webserver"), | ||
concat = require('gulp-concat'), | ||
mainBowerFiles = require('main-bower-files'), | ||
wrap = require("gulp-wrap"); | ||
|
||
// Gulp mix-ins | ||
|
||
require("gulp-autopolyfiller"); | ||
require("gulp-watch"); | ||
|
||
var paths = { | ||
js: "./js/*.js", | ||
publicJs: "./static/js/stamen" | ||
}; | ||
|
||
// | ||
// Run all default tasks | ||
// | ||
gulp.task("default",function() { | ||
gulp.start("lint"); | ||
gulp.start("uglify"); | ||
}); | ||
|
||
// | ||
// Check quality of Javascript | ||
// warn if errors or style problems are found | ||
// | ||
gulp.task("lint", function() { | ||
gulp | ||
.src(paths.js) | ||
.pipe(jshint({ | ||
predef: [ | ||
"document", | ||
"location", | ||
"navigator", | ||
"window", | ||
"L" | ||
], | ||
expr: true | ||
})) | ||
.pipe(jshint.reporter("jshint-stylish")); | ||
}); | ||
|
||
gulp.task("uglify", function() { | ||
gulp | ||
.src(mainBowerFiles("**/*.js").concat([paths.js])) | ||
.pipe(sourcemaps.init()) | ||
.pipe(concat('ecoengine-dependencies.js')) | ||
.pipe(gulp.dest(paths.publicJs)) | ||
.pipe(uglify({ | ||
mangle: true, | ||
output: { | ||
beautify: false | ||
} | ||
})) | ||
.pipe(rename({extname: ".min.js"})) | ||
.pipe(sourcemaps.write("./")) // Write a sourcemap for browser debugging | ||
.pipe(gulp.dest(paths.publicJs)); | ||
}); | ||
|
||
// | ||
// Serve contents of the public directory | ||
// locally on port :8080 | ||
// | ||
gulp.task("webserver", function() { | ||
gulp | ||
.src("./") | ||
.pipe(webserver({ | ||
open: false, // unless you want it | ||
livereload: false, // unless you want it | ||
directoryListing: false, | ||
fallback: "explore/index.html" | ||
})); | ||
}); | ||
|
||
// | ||
// Watch directories for changes | ||
// | ||
gulp.task("watch", function() { | ||
gulp.watch(mainBowerFiles().concat([paths.js]),["lint", "uglify"]); | ||
console.log("watching directory:", paths.js); | ||
|
||
gulp.start("webserver"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"name": "ecoengine", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/stamen/ecoengine", | ||
"authors": [ | ||
"syntagmatic", | ||
"Eric Gelinas <[email protected]>" | ||
], | ||
"description": "Stamen built a rich prototype search interface to explore the Berkeley Ecoengine API", | ||
"license": "MIT", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"d3": "~3.5.3", | ||
"leaflet": "~0.7.3", | ||
"hashnav": "~1.0.2", | ||
"d3-geo-projection": "~0.2.12" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "ecoengine", | ||
"version": "0.0.0", | ||
"description": "Stamen built a rich prototype search interface to explore the Berkeley Ecoengine API", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "gulp", | ||
"postinstall": "bower install", | ||
"start": "gulp && gulp watch" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/stamen/ecoengine" | ||
}, | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/stamen/ecoengine/issues" | ||
}, | ||
"homepage": "https://github.com/stamen/ecoengine", | ||
"dependencies": { | ||
"gulp-watch": "~3.0.0", | ||
"gulp": "~3.8.10", | ||
"gulp-rename": "~1.2.0", | ||
"gulp-compile-handlebars": "~0.4.4", | ||
"gulp-jshint": "~1.9.0", | ||
"gulp-uglify": "~1.0.2", | ||
"gulp-webserver": "~0.9.0", | ||
"jshint-stylish": "~1.0.0", | ||
"gulp-run": "~1.6.6", | ||
"gulp-sourcemaps": "~1.3.0", | ||
"gulp-copy": "0.0.2", | ||
"bower": "~1.3.12", | ||
"bower-requirejs": "~1.1.2", | ||
"gulp-hb": "~1.0.1", | ||
"gulp-replace": "~0.5.0", | ||
"gulp-autopolyfiller": "~1.2.0", | ||
"gulp-concat": "~2.4.3", | ||
"samesies": "0.0.0", | ||
"gulp-env": "~0.2.0", | ||
"main-bower-files": "~2.5.0", | ||
"gulp-wrap": "~0.10.0", | ||
"wrap": "~0.1.2", | ||
"escape-string-regexp": "~1.0.2" | ||
} | ||
} |
Oops, something went wrong.