Skip to content

Commit

Permalink
Updated Builds for Beta Release
Browse files Browse the repository at this point in the history
  • Loading branch information
jonobr1 committed Nov 3, 2018
1 parent 05e954b commit f51aaa2
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 77 deletions.
8 changes: 7 additions & 1 deletion build/two.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,13 @@ SOFTWARE.
* @name Two.Version
* @property {String} - The current working version of the library.
*/
Version: 'v0.7.0',
Version: 'v0.7.0-beta.1',

/**
* @name Two.PublishDate
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
*/
PublishDate: '2018-11-03T10:28:50+01:00',

/**
* @name Two.Identifier
Expand Down
94 changes: 47 additions & 47 deletions build/two.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion build/two.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,13 @@ SOFTWARE.
* @name Two.Version
* @property {String} - The current working version of the library.
*/
Version: 'v0.7.0',
Version: 'v0.7.0-beta.1',

/**
* @name Two.PublishDate
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
*/
PublishDate: '2018-11-03T10:28:50+01:00',

/**
* @name Two.Identifier
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "two.js",
"version": "0.7.0",
"version": "0.7.0-beta.1",
"description": "A renderer agnostic two-dimensional drawing api for the web.",
"module": "build/two.module.js",
"files": [
Expand Down Expand Up @@ -49,9 +49,10 @@
"blueimp-canvas-to-blob": "^2.1.0",
"jsdoc": "~3.5.5",
"jsdoc-to-markdown": "^4.0.1",
"moment": "^2.22.2",
"node-minify": "^2.0.3",
"qunitjs": "^2.4.0",
"resemblejs": "^1.1.1",
"underscore": "^1.6.0"
"underscore": "^1.9.1"
}
}
8 changes: 7 additions & 1 deletion src/two.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,13 @@
* @name Two.Version
* @property {String} - The current working version of the library.
*/
Version: 'v0.7.0',
Version: 'v0.7.0-beta.1',

/**
* @name Two.PublishDate
* @property {String} - The automatically generated publish date in the build process to verify version release candidates.
*/
PublishDate: '<%= publishDate %>',

/**
* @name Two.Identifier
Expand Down
72 changes: 47 additions & 25 deletions utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

var path = require('path');
var compressor = require('node-minify');
var _ = require('underscore');
var fs = require('fs');
var moment = require('moment');

var files = [
path.resolve(__dirname, './start-comment.js'),
Expand Down Expand Up @@ -41,37 +44,56 @@ compressor.minify({
input: files,
output: path.resolve(__dirname, '../build/two.js'),
callback: function(e) {

if (!e) {

console.log('concatenation complete');
var source = fs.readFileSync(path.resolve(__dirname, '../build/two.js'), {
encoding: 'utf-8'
});
var template = _.template(source);
source = template({
publishDate: moment().format()
});
fs.writeFileSync(path.resolve(__dirname, '../build/two.js'), source, {
encoding: 'utf-8'
});

// Minified
compressor.minify({
compressor: 'gcc',
input: path.resolve(__dirname, '../build/two.js'),
output: path.resolve(__dirname, '../build/two.min.js'),
callback: function(e) {
if (!e) {
console.log('minified complete');
} else {
console.log('unable to minify', e);
}
}
});

compressor.minify({
compressor: 'no-compress',
input: [
path.resolve(__dirname, '../build/two.js'),
path.resolve(__dirname, './exports.js')
],
output: path.resolve(__dirname, '../build/two.module.js'),
callback: function(e) {
if (!e) {
console.log('module complete');
} else {
console.log('unable to create module', e);
}
}
});

} else {

console.log('unable to concatenate', e);
}
}
});

// Minified
compressor.minify({
compressor: 'gcc',
input: files,
output: path.resolve(__dirname, '../build/two.min.js'),
callback: function(e) {
if (!e) {
console.log('minified complete');
} else {
console.log('unable to minify', e);
}
}
});

compressor.minify({
compressor: 'no-compress',
input: files.concat(path.resolve(__dirname, './exports.js')),
output: path.resolve(__dirname, '../build/two.module.js'),
callback: function(e) {
if (!e) {
console.log('module complete');
} else {
console.log('unable to create module', e);
}
}
});

0 comments on commit f51aaa2

Please sign in to comment.