Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
Merge pull request #741 from marcom-unimelb/feat-upgrade-node
Browse files Browse the repository at this point in the history
Upgrade to node 6.5.0
  • Loading branch information
waitingallday authored Oct 17, 2016
2 parents 9b36778 + db17342 commit 4290621
Show file tree
Hide file tree
Showing 11 changed files with 3,854 additions and 8,015 deletions.
8 changes: 4 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ ruby '2.3.1'

gem 'dotenv', '~> 2.1.0'
gem 'rack', '~> 1.6.4'
gem 'thin', '~> 1.6.2'
gem 'thin', '~> 1.6.4'

group :development do
gem 'roda', '~> 2.11.0'
gem 'slim', '~> 2.0.3'
gem 'roda', '~> 2.18.0'
gem 'slim', '~> 3.0.7'
gem 'redcarpet', '~> 3.3.4'
gem 'front_matter_parser', '~> 0.0.2'
gem 'foreman', '~> 0.78.0'
gem 'foreman', '~> 0.82.0'
end
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ GEM
daemons (1.2.3)
dotenv (2.1.1)
eventmachine (1.0.9.1)
foreman (0.78.0)
foreman (0.82.0)
thor (~> 0.19.1)
front_matter_parser (0.0.4)
rack (1.6.4)
redcarpet (3.3.4)
roda (2.11.0)
roda (2.18.0)
rack
slim (2.0.3)
temple (~> 0.6.6)
slim (3.0.7)
temple (~> 0.7.6)
tilt (>= 1.3.3, < 2.1)
temple (0.6.10)
temple (0.7.7)
thin (1.6.4)
daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4)
rack (~> 1.0)
thor (0.19.1)
tilt (1.4.1)
tilt (2.0.5)

PLATFORMS
ruby

DEPENDENCIES
dotenv (~> 2.1.0)
foreman (~> 0.78.0)
foreman (~> 0.82.0)
front_matter_parser (~> 0.0.2)
rack (~> 1.6.4)
redcarpet (~> 3.3.4)
roda (~> 2.11.0)
slim (~> 2.0.3)
thin (~> 1.6.2)
roda (~> 2.18.0)
slim (~> 3.0.7)
thin (~> 1.6.4)

RUBY VERSION
ruby 2.3.1p112

BUNDLED WITH
1.12.3
1.12.5
6 changes: 3 additions & 3 deletions assets/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require('dotenv').load("../");
require('dotenv').config();

var WEB_SERVER_HOST = process.env.WEB_SERVER_HOST || 'localhost';
var ASSET_SERVER_PORT = process.env.ASSETS_SERVER_PORT || 7001;
var WEBPACK_PORT = process.env.WEBPACK_SERVER_PORT || 7002;
Expand Down Expand Up @@ -70,9 +71,8 @@ app.get("*", function(req, res, next) {
});

// Boot the server
var port = ASSET_SERVER_PORT;
var server = http.Server(app);
server.listen(port, function() {
server.listen(ASSET_SERVER_PORT, function() {
console.log("Listening at http://" + WEB_SERVER_HOST + ":" + ASSET_SERVER_PORT + "/");
});

Expand Down
14 changes: 14 additions & 0 deletions assets/targets/components/base/03-07-ordered-list-bracket.slim
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,17 @@ ol.brackets
li The Howard Florey Laboratories of Experimental Physiology were commissioned in 1963 for the purpose of the study within the University of integrative physiology by long term experiments.

li The Howard Florey Institute of Experimental Physiology and Medicine ("the Institute") was incorporated by the <strong>Howard Florey Institute of Experimental Physiology and Medicine Act 1971</strong> ("the Institute Act") for the objects of that Act.

li Each candidate may provide for publication an electoral statement of not more than 200 words.

li The returning officer may edit a candidate's electoral statement before its publication, for length or to correct spelling and grammar.

li A candidate may withdraw his or her nomination by writing to the returning officer, no later than three days before the start of the voting period.

li Where the number of nominations is the same as the number of vacancies, the returning officer must declare the candidates elected.

li Where the number of candidates exceeds the number of vacancies, the returning officer must give notice of and conduct a ballot.

li The Howard Florey Laboratories of Experimental Physiology were commissioned in 1963 for the purpose of the study within the University of integrative physiology by long term experiments.

li The Howard Florey Institute of Experimental Physiology and Medicine ("the Institute") was incorporated by the <strong>Howard Florey Institute of Experimental Physiology and Medicine Act 1971</strong> ("the Institute Act") for the objects of that Act.
4 changes: 3 additions & 1 deletion assets/targets/components/base/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,10 @@
li::before {
content: '(' counter(list1, decimal) ') ';
counter-increment: list1;
left: -1.6em;
left: -3.4em;
position: absolute;
text-align: right;
width: 3em;
}
}

Expand Down
2 changes: 1 addition & 1 deletion assets/targets/components/text/_blockquote.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
font-weight: 700;
line-height: 1.2;
margin: 0 auto;
max-width: $w-sml;
padding-right: .3em;
position: relative;
width: 94%;
Expand Down Expand Up @@ -47,7 +48,6 @@
}

@include breakpoint(desktop) {
margin: 0;
width: 100%;
}

Expand Down
100 changes: 42 additions & 58 deletions assets/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,64 @@
require('dotenv').load("../");
var ASSETS_URL = "http://"+process.env.WEB_SERVER_HOST+":"+process.env.ASSET_SERVER_PORT;
var WEBPACK_URL = "http://"+process.env.WEB_SERVER_HOST+":"+process.env.WEBPACK_SERVER_PORT;
require('dotenv').config();

var fs = require('fs');
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');

// Webpack plugins
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var ASSETS_URL = 'http://'+process.env.WEB_SERVER_HOST+':'+process.env.ASSET_SERVER_PORT;
var WEBPACK_URL = 'http://'+process.env.WEB_SERVER_HOST+':'+process.env.WEBPACK_SERVER_PORT;

// Configuration
var TARGETS = path.join(__dirname, "targets");
var BUILD = path.join(__dirname, "..", "build");

// Plugins
var plugins = [
new webpack.DefinePlugin({
'process.env': {
CDNURL: JSON.stringify(process.env.CDNURL),
GMAPSJSAPIKEY: JSON.stringify(process.env.GMAPSJSAPIKEY)
}
}),
new ExtractTextPlugin("[name].css", {
allChunks: true
})
];
if (process.env.DEVELOPMENT === "true") {
plugins.push(new webpack.HotModuleReplacementPlugin());
plugins.push(new webpack.NoErrorsPlugin());
} else {
plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }));
}
var TARGETS = path.join(__dirname, 'targets');
var BUILD = path.join(__dirname, '..', 'build');

// Configure webpack output
var output = {
path: BUILD,
// Template based on keys in entry above
// Generate hashed names for production
filename: "[name].js"
};

if (process.env.DEVELOPMENT === "true") {
output.publicPath = ASSETS_URL + "/assets/";
}
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
var isDev = process.env.NODE_ENV !== 'production';

module.exports = {
var config = {
context: TARGETS,
entry: fs.readdirSync(TARGETS).reduce(createEntries, {}),
output: output,
plugins: plugins,
output: {
path: BUILD,
filename: '[name].js'
},
plugins: [
new ExtractTextPlugin('[name].css', { allChunks: true }),
new webpack.EnvironmentPlugin(['NODE_ENV', 'CDNURL', 'GMAPSJSAPIKEY'])
],
module: {
preLoaders: [
{
test: /\.js$/, // include .js files
exclude: /node_modules|vendor/, // exclude any and all files in the node_modules folder
loader: "jshint-loader"
}
],
loaders: [
{
test: /\.(jpe?g|png|gif|svg|woff|ttf|otf|eot|ico)/,
loader: "file-loader?name=[path][name].[ext]"
loader: 'file-loader?name=[path][name].[ext]'
},
{
test: /\.es6?$/,
exclude: /(node_modules)/,
loader: 'babel'
loader: 'babel-loader'
},
{
test: /\.html$/,
loader: 'html-loader'
},
{
test: /\.json$/,
loader: 'json-loader'
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?-minimize!postcss-loader!sass-loader")
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?-autoprefixer&minimize!postcss-loader!sass-loader')
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader?-minimize!postcss-loader")
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?-autoprefixer&minimize!postcss-loader')
},
{
test: /(isotope-layout|imagesloaded)/,
loader: 'imports?define=>false&this=>window'
}
]
},
jshint: {
eqnull: true,
failOnHint: false
},
postcss: [
autoprefixer({
browsers: ['> 1% in AU', 'last 2 versions', 'Firefox ESR', 'ie >= 9', 'iOS >= 8.4', 'Safari >= 8', 'Android >= 4.4']
Expand All @@ -107,8 +76,8 @@ function isFile(file) {

function createEntries(entries, dir) {
if (isDirectory(path.join(TARGETS, dir))) {
var target = (process.env.DEVELOPMENT === "true") ? ['webpack-dev-server/client?' + WEBPACK_URL, 'webpack/hot/dev-server'] : [];
var file = path.join(TARGETS, dir, "target.js");
var target = (isDev) ? ['webpack-dev-server/client?' + WEBPACK_URL, 'webpack/hot/dev-server'] : [];
var file = path.join(TARGETS, dir, 'target.js');
try {
isFile(file);
} catch (e) {
Expand All @@ -119,3 +88,18 @@ function createEntries(entries, dir) {
}
return entries;
}

// Environment-specific configuration
if (isDev) {
config.devtool = 'source-map';
config.output.publicPath = ASSETS_URL + '/assets/';
config.plugins.push(new webpack.HotModuleReplacementPlugin());
config.plugins.push(new webpack.NoErrorsPlugin());

} else {
config.plugins.push(new webpack.optimize.UglifyJsPlugin({ compress: { warnings: false } }));
config.plugins.push(new webpack.optimize.OccurrenceOrderPlugin());
}

// Export configuration
module.exports = config;
1 change: 0 additions & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ if ENV['RACK_ENV'] == 'production'
ver.shift(2) # drop releases prefix

page = File.join('cold', ver.join('/'))
puts ENV['VERSION'].inspect

else
page = File.join('cold', ENV['VERSION'], req.path)
Expand Down
Loading

0 comments on commit 4290621

Please sign in to comment.