Skip to content

Commit

Permalink
Merge ddd246f into a0fde64
Browse files Browse the repository at this point in the history
  • Loading branch information
thostetler committed Jun 25, 2018
2 parents a0fde64 + ddd246f commit 0e6e03d
Show file tree
Hide file tree
Showing 33 changed files with 349 additions and 135 deletions.
17 changes: 8 additions & 9 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"bootstrap-sass": "bootstrap-sass-official#~3.3.5",
"bourbon": "~4.2.4",
"d3": "~3.4.6",
"d3-cloud": "~1.0.5",
"d3-cloud": "~1.2.5",
"dsjslib": "https://github.com/monmohan/dsjslib.git#v0.6.6",
"fontawesome": "~4.6.0",
"html5-boilerplate": "~4.3.0",
Expand All @@ -26,22 +26,21 @@
"requirejs": "2.1.8",
"requirejs-plugins": "~1.0.3",
"clipboard": "1.7.1",
"es5-shim": "~4.5.9",
"es5-shim": "~4.5.10",
"select2": "4.0.3",
"MathJax": "~2.5.3",
"react-redux": "https://cdnjs.cloudflare.com/ajax/libs/react-redux/4.4.5/react-redux.js",
"redux": "https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.js",
"redux-thunk": "https://cdnjs.cloudflare.com/ajax/libs/redux-thunk/2.1.0/redux-thunk.min.js",
"classnames": "^2.2.5"
},
"devDependencies": {
"chai": "~1.8.0",
"qunit": "~1.12.0",
"jasmine": "~1.3.1",
"mocha": "~2.1.0",
"sinon": "http://sinonjs.org/releases/sinon-1.9.0.js",
"sinon": "1.9.0",
"sprintf": "~1.0.2",
"squire": "~0.2.0",
"requirejs-babel": "^0.0.9"
"requirejs-babel": "^0.0.9",
"d3-cloud": "^1.2.5"
},
"resolutions": {
"d3-cloud": "^1.2.5"
}
}
6 changes: 3 additions & 3 deletions grunt/assemble.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ module.exports = function (grunt) {
paths[k] = newMap[k];
}


// in development we use google-analytics, but for production we'll serve it
// ourselves (because of silly Ghostery breaking Safari browsers)
grunt.file.write('dist/libs/g.' + version + '.js', grunt.file.read('dist/libs/g.js'));
Expand All @@ -84,10 +83,11 @@ module.exports = function (grunt) {
var indexHtml = grunt.file.read('dist/index.original.html');

// first the js path
var newHtml = indexHtml.replace('bumblebee_app', 'bumblebee_app.' + version);
var newHtml = indexHtml.replace(/(bumblebee_app|discovery\.config)/g, 'bumblebee_app.' + version);
// then also the css
for (var css in cssMap) {
newHtml = newHtml.replace(css, cssMap[css]);
var reg = new RegExp(css, 'g');
newHtml = newHtml.replace(reg, cssMap[css]);
}

grunt.file.write('dist/index.' + version + '.html', newHtml);
Expand Down
3 changes: 2 additions & 1 deletion grunt/concurrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ module.exports = {
convert: [
'exec:convert_enzyme',
'exec:convert_dsjslib',
'exec:convert_redux_immutable'
'exec:convert_redux_immutable',
'exec:convert_requirejs'
],
hash_require: [
'hash_require:js',
Expand Down
64 changes: 62 additions & 2 deletions grunt/copy.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';
/**
* Options for the `jshint` grunt task
* Options for the `copy` grunt task
*
* @module grunt/jshint
* @module grunt/copy
*/
module.exports = function (grunt) {

Expand Down Expand Up @@ -116,6 +116,48 @@ module.exports = function (grunt) {
return dest + src.replace('create-react-class', 'index');
}
},
{
cwd: 'node_modules/redux/dist',
src: 'redux.min.js',
dest: 'src/libs/redux/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('redux.min', 'index');
}
},
{
cwd: 'node_modules/react-redux/dist',
src: 'react-redux.min.js',
dest: 'src/libs/react-redux/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('react-redux.min', 'index');
}
},
{
cwd: 'node_modules/redux-thunk/dist',
src: 'redux-thunk.min.js',
dest: 'src/libs/redux-thunk/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('redux-thunk.min', 'index');
}
},
{
cwd: 'node_modules/mathjax/',
src: [
'MathJax.js',
'extensions/**/*',
'config/**/*',
'fonts/**/*',
'jax/**/*'
],
dest: 'src/libs/mathjax/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('MathJax.js', 'index.js');
}
},
{
cwd: 'node_modules/prop-types',
src: 'prop-types.js',
Expand Down Expand Up @@ -163,6 +205,24 @@ module.exports = function (grunt) {
rename: function (dest, src) {
return dest + src.replace('reselect', 'index');
}
},
{
cwd: 'node_modules/react/dist',
src: 'react-with-addons.min.js',
dest: 'src/libs/react/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('react-with-addons.min', 'index');
}
},
{
cwd: 'node_modules/react-dom/dist',
src: 'react-dom.min.js',
dest: 'src/libs/react-dom/',
expand: true,
rename: function (dest, src) {
return dest + src.replace('react-dom.min', 'index');
}
}
]
},
Expand Down
3 changes: 3 additions & 0 deletions grunt/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ module.exports = {
convert_redux_immutable: {
cmd: 'mkdir src/libs/redux-immutable && node_modules/.bin/browserify --standalone combineReducers node_modules/redux-immutable/dist/index.js > src/libs/redux-immutable/index.js'
},
convert_requirejs: {
cmd: 'node_modules/.bin/uglifyjs src/libs/requirejs/require.js -c -m -o src/libs/requirejs/require.js'
},
latest_commit: {
cmd: 'git rev-parse --short=7 --verify HEAD | cat > git-latest-commit'
},
Expand Down
37 changes: 33 additions & 4 deletions grunt/requirejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,40 @@ module.exports = function (grunt) {
optimize: 'none', //'uglify2',
paths : {
//use cdns for major libs
react : 'empty:',
'react-dom' : 'empty:',
'jquery' : 'empty:',
'backbone-validation': 'empty:',
'backbone.stickit': 'empty:',
'backbone.wreqr': 'empty:',
'backbone': 'empty:',
'bootstrap': 'empty:',
'classnames': 'empty:',
'clipboard': 'empty:',
'create-react-class': 'empty:',
'd3-cloud': 'empty:',
'd3': 'empty:',
'es5-shim': 'empty:',
'filesaver': 'empty:',
'google-analytics': 'empty:',
'google-recaptcha': 'empty:',
'jquery-ui' : 'empty:',
'requirejs' : 'empty:'
'jquery' : 'empty:',
'jsonpath': 'empty:',
'marionette': 'empty:',
'mathjax': 'empty:',
'moment': 'empty:',
'persist-js': 'empty:',
'react-bootstrap': 'empty:',
'react-dom' : 'empty:',
'react-prop-types': 'empty:',
'react-redux': 'empty:',
'react' : 'empty:',
'redux-thunk': 'empty:',
'redux': 'empty:',
'requirejs' : 'empty:',
'reselect': 'empty:',
'select2': 'empty:',
'sinon': 'empty:',
'sprintf': 'empty:',
'underscore': 'empty:',
}
}
},
Expand Down
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
"backbone": "^1.3.3",
"bootstrap-sass": "^3.3.7",
"create-react-class": "^15.6.2",
"file-saver": "^1.3.3",
"file-saver": "^1.3.8",
"immutable": "^3.8.2",
"lodash": "^2.4.2",
"prop-types": "^15.6.0",
"react": "^15.6.1",
"redux-immutable": "^4.0.0",
"requirejs": "^2.3.3"
"requirejs": "^2.3.5"
},
"devDependencies": {
"async": "^2.5.0",
Expand All @@ -32,6 +32,7 @@
"babel-preset-react": "^6.24.1",
"browserify": "^14.4.0",
"chalk": "~0.4.0",
"compression": "^1.7.2",
"coveralls": "^2.13.1",
"enzyme": "^2.9.1",
"es5-shim": "~4.5.10",
Expand Down Expand Up @@ -68,14 +69,18 @@
"istanbul": "^0.4.5",
"jsonpath": "^0.2.12",
"load-grunt-config": "^0.19.2",
"mathjax": "^2.7.4",
"mocha-phantomjs-core": "^2.1.2",
"needle": "~0.7.1",
"nyc": "^11.2.1",
"phantomjs": "^2.1.7",
"react-addons-test-utils": "^15.6.1",
"react-bootstrap": "^0.32.1",
"react-dom": "^15.6.1",
"react-redux": "^4.4.9",
"react-test-renderer": "^15.6.1",
"redux": "^3.7.2",
"redux-thunk": "^2.3.0",
"reselect": "^3.0.1",
"time-grunt": "^1.4.0"
},
Expand Down
6 changes: 2 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

const express = require('express');
const path = require('path');
const compression = require('compression');
const proxy = require('http-proxy-middleware');
const app = express();
const targets = {
Expand Down Expand Up @@ -41,6 +42,7 @@ if (process.env.SERVER_ENV === 'release') {
}

// serve the static assets
app.use(compression());
app.use('/', express.static(path.join(__dirname, config.root)));
app.use('/test', express.static(path.join(__dirname, '/test')));
app.use('/node_modules', express.static(path.join(__dirname, '/node_modules')));
Expand All @@ -54,7 +56,3 @@ app.listen(8000, () => {
console.log('config: ', JSON.stringify(config));
console.log('Listening on port 8000');
});




11 changes: 8 additions & 3 deletions src/404.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="./styles/css/styles.css" />
<script src="./libs/requirejs/require.js"></script>
<link rel="preload" href="./styles/css/styles.css" as="style">
<link rel="stylesheet" href="./styles/css/styles.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>
<script>
!window.requirejs && document.write('<script src="./libs/requirejs/require.js">\x3C/script>');
</script>
<script>
require.config({
paths: {
'underscore': '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.2/lodash.min',
'google-analytics': '//www.google-analytics.com/analytics',
'analytics': 'js/components/analytics',
'jquery': '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min'
'jquery': '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min'
},
map: {
'analytics': {
Expand Down
14 changes: 10 additions & 4 deletions src/500.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="./styles/css/styles.css" />
<script src="./libs/requirejs/require.js"></script>
<link rel="preload" href="./styles/css/styles.css" as="style">
<link rel="preload" href="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js" as="script">
<link rel="stylesheet" href="./styles/css/styles.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>
<script>
!window.requirejs && document.write('<script src="./libs/requirejs/require.js">\x3C/script>');
</script>
<script>
require.config({
paths: {
'underscore': '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.2/lodash.min',
'google-analytics': '//www.google-analytics.com/analytics',
'analytics': 'js/components/analytics',
'jquery': '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min'
'jquery': '//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min'
},
map: {
'analytics': {
Expand All @@ -18,7 +24,7 @@
});
require(['analytics'], function(analytics) {
analytics('send', 'pageview');
analytics('send', 'event', 'error', 'automatic_redirect', '500.html');
analytics('send', 'event', 'error', 'automatic_redirection', '404.html');
});
</script>

Expand Down
Loading

0 comments on commit 0e6e03d

Please sign in to comment.