From 7f1b1edef50f67c9fba3f3ef899e7e01a3febfd6 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 02:19:14 +0000 Subject: [PATCH 01/23] dev branch --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 276767e..c58ee9c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ + [![Build Status](https://secure.travis-ci.org/ApiEngine/apiengine-client.png?branch=master)](http://travis-ci.org/ApiEngine/apiengine-client) From cf09e1754a95c49c0604e1f9228dff1ae559bb45 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 08:33:35 +0000 Subject: [PATCH 02/23] removed add this for a bit --- README.md | 1 + build/build.js | 3 +-- index.html | 16 ++++++++-------- js/main.js | 2 +- js/views/apis/list.js | 7 +++---- js/views/apis/page.js | 3 ++- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c58ee9c..695b9c6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ + [![Build Status](https://secure.travis-ci.org/ApiEngine/apiengine-client.png?branch=master)](http://travis-ci.org/ApiEngine/apiengine-client) diff --git a/build/build.js b/build/build.js index cd6fe73..dd33d57 100644 --- a/build/build.js +++ b/build/build.js @@ -32,8 +32,7 @@ var rootPath = '..'; paths: { 'jquery': 'empty:', 'mustache': 'empty:', - 'underscore': 'empty:', - 'addthis': 'empty:' + //'addthis': 'empty:' }, modules: [ { diff --git a/index.html b/index.html index 294835b..8736872 100644 --- a/index.html +++ b/index.html @@ -6,15 +6,15 @@ - + ga('create', 'UA-39509998-1', 'apiengine.io'); + ga('send', 'pageview'); + diff --git a/js/main.js b/js/main.js index 6332870..19f09d8 100644 --- a/js/main.js +++ b/js/main.js @@ -17,7 +17,7 @@ require.config({ // jquery plugins autogrow : 'libs/autogrow/autogrow', // External services - addthis : "https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51176d76142335d0", + //addthis : "https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-51176d76142335d0", // Just a short cut so we can put our html outside the js dir // When you have HTML/CSS designers this aids in keeping them out of the js directory diff --git a/js/views/apis/list.js b/js/views/apis/list.js index 7ac284b..8e3c8e1 100644 --- a/js/views/apis/list.js +++ b/js/views/apis/list.js @@ -3,14 +3,13 @@ define([ 'underscore', 'backbone', 'mustache', - 'addthis', 'models/session', 'text!templates/apis/list.html', 'text!templates/apis/list-item.html', 'collections/apis', 'models/api', 'models/follower' -], function($, _, Backbone, Mustache, unused, Session, apisListTemplate, apisListItemTemplate, ApisCollection, ApiModel, FollowerModel){ +], function($, _, Backbone, Mustache, Session, apisListTemplate, apisListItemTemplate, ApisCollection, ApiModel, FollowerModel){ var ApisPage = Backbone.View.extend({ el: '.private-container', initialize: function () { @@ -110,7 +109,7 @@ define([ that.$el.html(Mustache.render(apisListTemplate, {authed: Session.get('auth'), currentUser: that.options.currentUser, _:_, is_public: that.options.is_public, apis: collection.models, username: Session.get('login'), location: that.options.location}, {listtemplate: apisListItemTemplate})); // activate the share buttons - _.each(collection.models, function(model) { + /*_.each(collection.models, function(model) { addthis.button('#' + model.get('user') + '-' + model.get('name'), { services_compact : "facebook,twitter,digg,pinterest,email", ui_click : true @@ -118,7 +117,7 @@ define([ url: Backbone.router.getBaseUrl() + model.get('user') + '/' + model.get('name'), title: model.get('name') + ' on API Engine' }); - }); + });*/ } }); diff --git a/js/views/apis/page.js b/js/views/apis/page.js index ad9fd50..09498d4 100644 --- a/js/views/apis/page.js +++ b/js/views/apis/page.js @@ -76,6 +76,7 @@ define([ this.$el.html(Mustache.render(apiDetailsTemplate, {api: this.model, owner: Session.get('login') === this.model.get('user')})); // activate addThis share button for the API + /* addthis.button('#' + this.model.get('username') + '-' + this.model.get('apiname'), { services_compact : "facebook,twitter,digg,pinterest,email", ui_click : true @@ -83,7 +84,7 @@ define([ url: Backbone.router.getBaseUrl() + this.model.get('username') + '/' + this.model.get('apiname'), title: this.model.get('apiname') + ' on API Engine' }); - + */ // switch on active tab from router if(this.options.collaborators) { var collaboratorsView = Vm.create(this, 'apipage', CollaboratorsView, _.extend({parent : this}, this.options)); From de885489227e9510ce62b5d7a442bab7920e1f9e Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 08:39:35 +0000 Subject: [PATCH 03/23] a --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 695b9c6..276767e 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ - - [![Build Status](https://secure.travis-ci.org/ApiEngine/apiengine-client.png?branch=master)](http://travis-ci.org/ApiEngine/apiengine-client) From 4170cc198dc77fde1754307b909c8126ee7dce2d Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 08:52:51 +0000 Subject: [PATCH 04/23] A --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 8736872..24a4a37 100644 --- a/index.html +++ b/index.html @@ -17,8 +17,7 @@ - - + From 1f664c469b05aea4431d724cb4f209e162149a9e Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 08:53:48 +0000 Subject: [PATCH 05/23] working on dev --- index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 24a4a37..8736872 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,8 @@ - + + From ee847e18fbe770f5a3579b87a1c0b99002b8df36 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 09:15:08 +0000 Subject: [PATCH 06/23] updated build --- build/build.js | 56 +++++++++++++++++++++++++++++++++++++++++----- build/package.json | 3 ++- 2 files changed, 53 insertions(+), 6 deletions(-) diff --git a/build/build.js b/build/build.js index dd33d57..5af2ebe 100644 --- a/build/build.js +++ b/build/build.js @@ -4,26 +4,62 @@ var http = require('http-get'); var rjs = require('requirejs'); var knox = require('knox'); var glob = require("glob") +var clc = require('cli-color'); + +// CONFIG + +var cloudfront_production = 'https://d3oqwi49u9bqjg.cloudfront.net'; +var cloudfront_stage = 'https://d51ivijxlr7mx.cloudfront.net'; + +// Logging helpers + +var types = { + default: clc.black, + error: clc.red.bold, + warn: clc.yellow, + heading: clc.blue.bold.underline, + label: clc.blue.bold, + action: clc.xterm(8).italic +}; + +var log = function (message, _type) { + var type = _type || types.default; + console.log(type(message) + '\n'); +} + +// Start build + +log('Api Engine Client Builder', types.heading) + -console.log(process.argv); -var cloudfront = 'https://d3oqwi49u9bqjg.cloudfront.net'; if(process.argv[2] === 'stage') { - var cloudfront = 'https://d51ivijxlr7mx.cloudfront.net'; + var cloudfront = cloudfront_stage; + log('Staging enviroment selected', types.label) +} else { + var cloudfront = cloudfront_production; + log('Production enviroment selected', types.label) } + var version = Date.now(); var outputFolder = 'output/version/' + version -console.log('Building client'); +log('Starting build'); var startTime = Date.now(); +log('Create output folders', types.action); + fs.removeSync('output'); fs.mkdirSync('output'); fs.mkdirSync('output/version'); fs.mkdirSync(outputFolder); + + var rootPath = '..'; +log('Running require.js optimizer', types.action) + rjs.optimize({ dir: outputFolder + '/js', mainConfigFile: rootPath + '/js/main.js', @@ -60,10 +96,16 @@ var rootPath = '..'; } ] }); +log('Optimization finished', types.action) +log('Editing index.html to contain new enviroment variables', types.action) + var index = fs.readFileSync(rootPath + '/index.html', 'ascii'); index = index.replace('css/styles.css', cloudfront + '/version/' + version + '/css/styles.css'); index = index.replace('', ''); index = index.replace(' data-main="js/main"', ' data-main="' + cloudfront + '/version/' + version + '/js/main"'); + +log('Optimization css with require.js', types.action) + fs.writeFileSync('output/index.html', index); rjs.optimize({ cssIn: rootPath + '/css/styles.css', @@ -88,6 +130,7 @@ function cssIncImages(cssFile) { fs.writeFileSync(cssFile, css, 'utf-8'); // you can overwrite the original file with this line return css; } +log('Copying accross more needed files', types.action) fs.copy(rootPath + '/googleaa49fe030680ef6c.html', 'output/googleaa49fe030680ef6c.html', function (){ fs.copy(rootPath + '/site.xml', 'output/site.xml', function (){ @@ -96,11 +139,14 @@ function cssIncImages(cssFile) { fs.copy(rootPath + '/css/img', outputFolder +'/css/img', function () { fs.copy(rootPath + '/img', outputFolder +'/img', function () { fs.copy(rootPath + '/css/fonts', outputFolder +'/css/fonts', function () { +log('Embedding images into CSS', types.action) cssIncImages(outputFolder + '/css/styles.css'); fs.copy('output', 'relic', function () { - var endTime = (Date.now() - startTime) / 1000; +log('Build finished!', types.heading) +log('Finished in ' + endTime + ' seconds', types.label) + }); }); }); diff --git a/build/package.json b/build/package.json index 95b9b4b..714b737 100644 --- a/build/package.json +++ b/build/package.json @@ -8,6 +8,7 @@ "knox": "~0.3.0", "http-get": "~0.4.2", "glob": "~3.1.12", - "chimney": "~0.2.0" + "chimney": "~0.2.0", + "cli-color": "~0.2.2", } } From dfd8e4a90910a19a474148655608f0c51459c052 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 09:26:38 +0000 Subject: [PATCH 07/23] we have a login button again --- templates/header/account-menu.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/header/account-menu.html b/templates/header/account-menu.html index f0962b8..8643a93 100644 --- a/templates/header/account-menu.html +++ b/templates/header/account-menu.html @@ -17,9 +17,8 @@ <% } else { %> -
  • - +
  • <% }; %> From 904ae895c719b0df375a029bb63c9bd837ac1482 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 09:28:04 +0000 Subject: [PATCH 08/23] Added npm module properly --- build/build.js | 2 +- build/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/build.js b/build/build.js index 5af2ebe..4c8a451 100644 --- a/build/build.js +++ b/build/build.js @@ -4,7 +4,7 @@ var http = require('http-get'); var rjs = require('requirejs'); var knox = require('knox'); var glob = require("glob") -var clc = require('cli-color'); +var clc = require('./cli-color'); // CONFIG diff --git a/build/package.json b/build/package.json index 714b737..4789573 100644 --- a/build/package.json +++ b/build/package.json @@ -9,6 +9,6 @@ "http-get": "~0.4.2", "glob": "~3.1.12", "chimney": "~0.2.0", - "cli-color": "~0.2.2", + "cli-color": "~0.2.2" } } From 6665895e97eb512473e0b63ba12cc388c813bf11 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 09:28:48 +0000 Subject: [PATCH 09/23] Added npm module properly --- build/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.js b/build/build.js index 4c8a451..5af2ebe 100644 --- a/build/build.js +++ b/build/build.js @@ -4,7 +4,7 @@ var http = require('http-get'); var rjs = require('requirejs'); var knox = require('knox'); var glob = require("glob") -var clc = require('./cli-color'); +var clc = require('cli-color'); // CONFIG From 5c792361792685a5b122f651accfeb078cca59c8 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 09:40:15 +0000 Subject: [PATCH 10/23] updated ot https only --- build/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.js b/build/build.js index 5af2ebe..643b1a6 100644 --- a/build/build.js +++ b/build/build.js @@ -8,7 +8,7 @@ var clc = require('cli-color'); // CONFIG -var cloudfront_production = 'https://d3oqwi49u9bqjg.cloudfront.net'; +var cloudfront_production = 'https://d50sg51l36z7c.cloudfront.net'; var cloudfront_stage = 'https://d51ivijxlr7mx.cloudfront.net'; // Logging helpers From 669a0b5a2a956b071ea942d8c06c423b96d7e388 Mon Sep 17 00:00:00 2001 From: Samson Date: Tue, 26 Mar 2013 10:06:32 +0000 Subject: [PATCH 11/23] a --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 276767e..c58ee9c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ + [![Build Status](https://secure.travis-ci.org/ApiEngine/apiengine-client.png?branch=master)](http://travis-ci.org/ApiEngine/apiengine-client) From 55ce1cbdad90a320a3819ceb85b42455da5dc0eb Mon Sep 17 00:00:00 2001 From: Samson Date: Thu, 28 Mar 2013 12:52:59 +0000 Subject: [PATCH 12/23] added link to public pingdom uptime for production servers --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c58ee9c..da62583 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,5 @@ When privacy is paramount we have you covered. Switch between private & public a ## PUBLIC APIs WITH GREAT POTENTIAL Build your community & start a dialogue with yo + +[http://stats.pingdom.com/wyvr99zdb86k](Pingdom Uptime) \ No newline at end of file From 4bd732a4eb8530992bde0682013ad2f0d5a57a81 Mon Sep 17 00:00:00 2001 From: markhibberd Date: Mon, 1 Apr 2013 13:13:11 +1100 Subject: [PATCH 13/23] Add vagrant support to dev branch. --- build/build.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build/build.js b/build/build.js index 643b1a6..110b0e3 100644 --- a/build/build.js +++ b/build/build.js @@ -10,6 +10,7 @@ var clc = require('cli-color'); var cloudfront_production = 'https://d50sg51l36z7c.cloudfront.net'; var cloudfront_stage = 'https://d51ivijxlr7mx.cloudfront.net'; +var cloudfront_vagrant = 'https://vagrant-client.apiengine.io:40443'; // Logging helpers @@ -31,12 +32,12 @@ var log = function (message, _type) { log('Api Engine Client Builder', types.heading) - - - if(process.argv[2] === 'stage') { var cloudfront = cloudfront_stage; log('Staging enviroment selected', types.label) +} else if(process.argv[2] === 'vagrant') { + var cloudfront = cloudfront_vagrant; + log('Vagrant enviroment selected', types.label) } else { var cloudfront = cloudfront_production; log('Production enviroment selected', types.label) From eb3dd2a0e6f22332589ac8f37c026fccebc49b2f Mon Sep 17 00:00:00 2001 From: Samson Date: Mon, 1 Apr 2013 04:16:57 +0000 Subject: [PATCH 14/23] updated build --- build/build.js | 35 ++++++++++++++++++++++++++++------- build/package.json | 3 ++- js/views/app.js | 10 ++++++++-- package.json | 3 ++- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/build/build.js b/build/build.js index 643b1a6..f22d8a5 100644 --- a/build/build.js +++ b/build/build.js @@ -28,18 +28,28 @@ var log = function (message, _type) { } // Start build +var program = require('commander'); + +program + .version('0.0.1') + .option('-e, --environment [environment]', 'Which enviroment, development, stage or production? Changes where assets are pulled from', 'develop') + .option('-s, --server [server]', 'Is there a custom server url for this build? (https://*) Changes what API server you use') + .parse(process.argv); -log('Api Engine Client Builder', types.heading) +log('Api Engine Client Builder', types.heading) -if(process.argv[2] === 'stage') { - var cloudfront = cloudfront_stage; +var cloudfront = null +if(program.environment === 'stage') { + cloudfront = cloudfront_stage; log('Staging enviroment selected', types.label) -} else { - var cloudfront = cloudfront_production; +} else if (program.environment === 'production' ) { + cloudfront = cloudfront_production; log('Production enviroment selected', types.label) +} else { + log('Development enviroment selected', types.label) } @@ -100,9 +110,20 @@ log('Optimization finished', types.action) log('Editing index.html to contain new enviroment variables', types.action) var index = fs.readFileSync(rootPath + '/index.html', 'ascii'); -index = index.replace('css/styles.css', cloudfront + '/version/' + version + '/css/styles.css'); index = index.replace('', ''); -index = index.replace(' data-main="js/main"', ' data-main="' + cloudfront + '/version/' + version + '/js/main"'); +if(cloudfront) { + index = index.replace('css/styles.css', cloudfront + '/version/' + version + '/css/styles.css'); + index = index.replace(' data-main="js/main"', ' data-main="' + cloudfront + '/version/' + version + '/js/main"'); +} else { + index = index.replace('css/styles.css', 'version/' + version + '/css/styles.css'); + index = index.replace(' data-main="js/main"', ' data-main="version/' + version + '/js/main"'); + +} + +if(program.server) { + index = index.replace('', '') +} + log('Optimization css with require.js', types.action) diff --git a/build/package.json b/build/package.json index 4789573..3ab847b 100644 --- a/build/package.json +++ b/build/package.json @@ -9,6 +9,7 @@ "http-get": "~0.4.2", "glob": "~3.1.12", "chimney": "~0.2.0", - "cli-color": "~0.2.2" + "cli-color": "~0.2.2", + "commander": "~1.1.1" } } diff --git a/js/views/app.js b/js/views/app.js index 0c9cefc..d1f479b 100644 --- a/js/views/app.js +++ b/js/views/app.js @@ -71,10 +71,13 @@ define([ }; var that = this; + $.ajaxPrefilter( function( options, originalOptions, jqXHR ) { // Your server goes below if(options.url.indexOf('proxino') === -1) { - if(window.location.host === 'apiengine.io') { + if($('[data-server-url]').length > 0) { + options.url = $('[data-server-url]').attr('data-server-url'); + } else if (window.location.host === 'apiengine.io') { options.url = 'https://x.apiengine.io' + options.url; } else { @@ -119,7 +122,10 @@ define([ }); var notifications = new Notifications(); var root = '/'; - if(window.location.hostname === 'localhost') { + if(window.location.hostname === 'localhost' && window.location.pathname.indexOf('relic') !== -1) { + root = '/repos/apiengine-client/build/relic'; + + } else if(window.location.hostname === 'localhost') { root = '/repos/apiengine-client/'; } Backbone.history.start({pushState: true, root: root}); diff --git a/package.json b/package.json index 77b568a..325c0d8 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "w3cjs": "0.1.6" }, "dependencies": { - "superagent": "~0.8.1" + "superagent": "~0.8.1", + "commander": "~1.1.1" } } From bcaeeb7bd749705065d84a4a6d6f050d92b35532 Mon Sep 17 00:00:00 2001 From: markhibberd Date: Mon, 1 Apr 2013 16:01:58 +1100 Subject: [PATCH 15/23] Include old url as suffix. --- js/views/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/views/app.js b/js/views/app.js index d1f479b..2d3b49f 100644 --- a/js/views/app.js +++ b/js/views/app.js @@ -76,7 +76,7 @@ define([ // Your server goes below if(options.url.indexOf('proxino') === -1) { if($('[data-server-url]').length > 0) { - options.url = $('[data-server-url]').attr('data-server-url'); + options.url = $('[data-server-url]').attr('data-server-url') + options.url; } else if (window.location.host === 'apiengine.io') { options.url = 'https://x.apiengine.io' + options.url; From d2a0a86cb7273dda347eb62ef55be19a813fe73e Mon Sep 17 00:00:00 2001 From: Samson Date: Mon, 1 Apr 2013 08:14:54 +0000 Subject: [PATCH 16/23] added backbone and underscore shim blah --- build/build.js | 3 ++- js/libs/backbone/backbone.cache.js | 0 js/main.js | 10 ++++++++-- js/models/billing/card.js | 12 ++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 js/libs/backbone/backbone.cache.js create mode 100644 js/models/billing/card.js diff --git a/build/build.js b/build/build.js index 0a70177..e032764 100644 --- a/build/build.js +++ b/build/build.js @@ -85,7 +85,8 @@ log('Running require.js optimizer', types.action) paths: { 'jquery': 'empty:', 'mustache': 'empty:', - //'addthis': 'empty:' + 'backbone': 'empty:', + 'underscore': 'empty:' }, modules: [ { diff --git a/js/libs/backbone/backbone.cache.js b/js/libs/backbone/backbone.cache.js new file mode 100644 index 0000000..e69de29 diff --git a/js/main.js b/js/main.js index 19f09d8..5891d21 100644 --- a/js/main.js +++ b/js/main.js @@ -3,8 +3,8 @@ require.config({ paths: { // Major libraries jquery: 'https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min', - underscore: 'libs/underscore/underscore', // https://github.com/amdjs - backbone: 'libs/backbone/backbone', // https://github.com/amdjs + underscore: 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.1.0/lodash.min', // https://github.com/amdjs + backbone: 'https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.0.0/backbone-min', // https://github.com/amdjs prettyprint: 'libs/prettyprint/prettyprint', qtip: 'libs/qtip2/jquery.qtip.min', marked: 'libs/marked/marked', @@ -23,6 +23,12 @@ require.config({ // When you have HTML/CSS designers this aids in keeping them out of the js directory templates: '../templates', legal: '../legal' + }, + shim: { + 'backbone': { + deps: ['underscore', 'jquery'], + exports: 'Backbone' + } } }); diff --git a/js/models/billing/card.js b/js/models/billing/card.js new file mode 100644 index 0000000..fcbf007 --- /dev/null +++ b/js/models/billing/card.js @@ -0,0 +1,12 @@ +define([ + 'underscore', + 'backbone' +], function(_, Backbone) { + var Card = Backbone.Model.extend({ + url: function() { + return '/user/' + this.get('login') + '/card'; + } + }); + return Card; + +}); From 1273dff4aff6a4913cf59f57b252ff4df76f6511 Mon Sep 17 00:00:00 2001 From: Samson Date: Mon, 1 Apr 2013 08:16:31 +0000 Subject: [PATCH 17/23] added backbone and underscore shim blah --- build/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 build/README.md diff --git a/build/README.md b/build/README.md new file mode 100644 index 0000000..8c1e954 --- /dev/null +++ b/build/README.md @@ -0,0 +1,14 @@ +## Build + +Some build notes will go here eventually + + + + Usage: build.js [options] + + Options: + + -h, --help output usage information + -V, --version output the version number + -e, --environment [environment] Which enviroment, development, vagrant, stage or production? Changes where assets are pulled from + -s, --server [server] Is there a custom server url for this build? (https://*) Changes what API server you use From 057e63322fe837e231cdcc0800782c0e947e2617 Mon Sep 17 00:00:00 2001 From: Samson Date: Mon, 1 Apr 2013 08:43:37 +0000 Subject: [PATCH 18/23] build changes coming --- build/build.js | 34 ++++++++++++-- index.html | 1 + js/extensions.js | 16 ++++++- js/libs/backbone/backbone.cache.js | 6 +++ js/main.js | 15 ++---- js/setup/logging.js | 48 +++++++++++++++++++ js/setup/setup.js | 7 +++ js/views/app.js | 74 +++++------------------------- 8 files changed, 121 insertions(+), 80 deletions(-) create mode 100644 js/setup/logging.js create mode 100644 js/setup/setup.js diff --git a/build/build.js b/build/build.js index e032764..143e630 100644 --- a/build/build.js +++ b/build/build.js @@ -12,6 +12,9 @@ var cloudfront_production = 'https://d50sg51l36z7c.cloudfront.net'; var cloudfront_stage = 'https://d51ivijxlr7mx.cloudfront.net'; var cloudfront_vagrant = 'https://vagrant-client.apiengine.io:40443'; +var server_production = 'https://x.apiengine.io'; +var server_staging = 'https://s.apiengine.io'; + // Logging helpers var types = { @@ -41,8 +44,33 @@ program log('Api Engine Client Builder', types.heading) +var server = null; +var cloudfront = null; + +if(program.environment === 'stage') { + cloudfront = cloudfront_stage; + log('Staging enviroment selected', types.label) + server = server_staging; + +} else if (program.environment === 'production' ) { + log('Production enviroment selected', types.label) + cloudfront = cloudfront_production; + server = server_production; + +} else if(program.environment === 'vagrant') { + var cloudfront = cloudfront_vagrant; + server = server_staging; + log('Vagrant enviroment selected', types.label) + +} else { + server = server_staging; + log('Development enviroment selected', types.label) +} + +if(program.server) { + server = program.server; +} -var cloudfront = null if(program.environment === 'stage') { cloudfront = cloudfront_stage; log('Staging enviroment selected', types.label) @@ -128,9 +156,7 @@ if(cloudfront) { } -if(program.server) { - index = index.replace('', '') -} +index = index.replace('', '') log('Optimization css with require.js', types.action) diff --git a/index.html b/index.html index 8736872..49e411a 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ API Engine - Great apps start with great apis +