Skip to content

Commit

Permalink
Preparing for 0.8.36 release
Browse files Browse the repository at this point in the history
Conflicts:
	bower.json
	package.json
  • Loading branch information
sbellity committed Jul 22, 2014
2 parents 80c3c3f + 9dec8de commit ab701c1
Show file tree
Hide file tree
Showing 28 changed files with 373 additions and 94 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ app/app.js
/build
/local_components
/grunt-aws.json
app/*html
2 changes: 1 addition & 1 deletion .grunt/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"domready",
"lib/bootstrap"
],
"out": "dist/<%= PKG_VERSION %>/hull.api.js",
"out": "dist/<%= PKG_VERSION %>/hull.api.debug.js",
"wrap": {
"start": "(function(){var require, requirejs, define, root={}, HULL_ENV='api'; (function () {",
"end": ";}).call(root);})();"
Expand Down
2 changes: 1 addition & 1 deletion .grunt/client.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"lib/bootstrap",
"moment"
],
"out": "dist/<%= PKG_VERSION %>/hull.js",
"out": "dist/<%= PKG_VERSION %>/hull.debug.js",
"wrap": {
"start": "(function(){var require, requirejs, define, root={jQuery: window.jQuery}, HULL_ENV = 'client'; (function () {",
"end": ";}).call(root);})();"
Expand Down
13 changes: 13 additions & 0 deletions .grunt/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ module.exports = function (grunt) {
}]
}
};
},
updateDistTask: function (config, isDev) {
config = config.dist;
if (!isDev || !config) return;

var subKeys = ['remote', 'api', 'client'];
subKeys.forEach(function (key) {
var subTask = config[key];
var lookedUpName = 'uglify:' + key;
var lookedUpIdx = subTask.indexOf(lookedUpName);
if (lookedUpIdx === -1) return;
subTask.splice(lookedUpIdx, 1, 'copy:' + key);
});
}
};
};
2 changes: 1 addition & 1 deletion .grunt/remote.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
"aura-extensions/aura-purl",
"aura-extensions/aura-uuid"
],
"out": "dist/<%= PKG_VERSION %>/hull-remote.js"
"out": "dist/<%= PKG_VERSION %>/hull-remote.debug.js"
}
}
86 changes: 68 additions & 18 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-symlink');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-hull-dox');
grunt.loadNpmTasks('grunt-hull-widgets');
grunt.loadNpmTasks('grunt-hull-components');
grunt.loadNpmTasks('grunt-s3');
grunt.loadNpmTasks('grunt-git-describe');
grunt.loadNpmTasks('grunt-wrap');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-invalidate-cloudfront');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-copy');

var clientConfig = grunt.file.readJSON('.grunt/client.json');
var remoteConfig = grunt.file.readJSON('.grunt/remote.json');
Expand Down Expand Up @@ -51,20 +53,20 @@ module.exports = function (grunt) {
//Augment the require.js configuation with some computed elements
var apiRJSConfig = (function () {
var _c = apiConfig.requireJS;
_c.optimize = grunt.option('dev') ? "none" : "uglify";
_c.optimize = 'none';
return _c;
})();
var clientRJSConfig = (function () {
var _c = clientConfig.requireJS;
_c.include = _c.include.concat(auraExtensions).concat(clientLibs);
_c.optimize = grunt.option('dev') ? "none" : "uglify";
_c.optimize = 'none';
return _c;
})();

var remoteRJSConfig = (function () {
var _c = remoteConfig.requireJS;
_c.include = _c.include.concat(remoteLibs).concat(vendorLibs);
_c.optimize = grunt.option('dev') ? "none" : "uglify";
_c.optimize = 'none';
return _c;
})();

Expand All @@ -75,6 +77,47 @@ module.exports = function (grunt) {
configFile: 'karma.conf.js'
}
},
copy: {
api: {
files: [{
expand: false,
src: ['dist/<%= PKG_VERSION%>/hull.api.debug.js'],
dest: 'dist/<%= PKG_VERSION%>/hull.api.js'
}]
},
client: {
files: [{
expand: false,
src: ['dist/<%= PKG_VERSION%>/hull.debug.js'],
dest: 'dist/<%= PKG_VERSION%>/hull.js'
}]
},
remote: {
files: [{
expand: false,
src: ['dist/<%= PKG_VERSION%>/hull-remote.debug.js'],
dest: 'dist/<%= PKG_VERSION%>/hull-remote.js'
}]
}
},
uglify: {
options: {},
api: {
files: {
'dist/<%= PKG_VERSION%>/hull.api.js' : ['dist/<%= PKG_VERSION%>/hull.api.debug.js']
}
},
client: {
files: {
'dist/<%= PKG_VERSION%>/hull.js' : ['dist/<%= PKG_VERSION%>/hull.debug.js']
}
},
remote: {
files: {
'dist/<%= PKG_VERSION%>/hull-remote.js' : ['dist/<%= PKG_VERSION%>/hull-remote.debug.js']
}
}
},
clean: {
client: {
src: ['dist/current', 'lib/client/**/*']
Expand Down Expand Up @@ -141,17 +184,19 @@ module.exports = function (grunt) {
options: (function (c) {
c.paths.underscore = 'empty:';
c.paths.backbone = 'empty:';
c.out = c.out.replace('hull.js', 'hull.no-backbone.js');
c.out = c.out.replace('hull.debug.js', 'hull.no-backbone.js');
c.wrap.start = c.wrap.start + ";root._ = window._;";
c.wrap.start = c.wrap.start + ";root.Backbone = window.Backbone;";
c.optimize = "uglify";
return c;
})(clone(clientRJSConfig, true))
},
"client-no-underscore": {
options: (function (c) {
c.paths.underscore = 'empty:';
c.out = c.out.replace('hull.js', 'hull.no-underscore.js');
c.out = c.out.replace('hull.debug.js', 'hull.no-underscore.js');
c.wrap.start = c.wrap.start + ";root._ = window._;";
c.optimize = "uglify";
return c;
})(clone(clientRJSConfig, true))
},
Expand All @@ -175,9 +220,9 @@ module.exports = function (grunt) {
}
},
watch: {
widgets: {
components: {
files: ['aura_components/**/*'],
tasks: ['dist:widgets', 'cssmin']
tasks: ['dist:components', 'cssmin']
},
remote: {
files: remoteConfig.coffeeFiles,
Expand All @@ -204,13 +249,15 @@ module.exports = function (grunt) {
template: "define(function () { return '<%= PKG_VERSION %>';});",
dest: 'lib/utils/version.js'
},
hull_widgets: {
hull_components: {
options: {
optimize: !grunt.option('dev')
},
hull: {
sourceName: "hull",
src: 'aura_components',
before: [],
dest: 'dist/<%= PKG_VERSION%>',
optimize: !grunt.option('dev')
}
dest: 'dist/<%= PKG_VERSION%>/aura_components'
},
},
describe: {
out: 'dist/<%= PKG_VERSION%>/REVISION'
Expand Down Expand Up @@ -243,27 +290,30 @@ module.exports = function (grunt) {
}
},
dist: {
"remote": ['version', 'clean:remote', 'coffee:remote', 'wrap', 'version', 'requirejs:remote', 'symlink:current'],
"client": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client', 'cssmin', 'symlink:current'],
"api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'symlink:current'],
"remote": ['version', 'clean:remote', 'coffee:remote', 'wrap', 'version', 'requirejs:remote', 'uglify:remote', 'symlink:current'],
"client": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client', 'uglify:client', 'cssmin', 'symlink:current'],
"api": ['version', 'clean:client', 'coffee:api', 'wrap', 'version', 'requirejs:api', 'uglify:api', 'symlink:current'],
"client-no-underscore": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-underscore'],
"client-no-backbone": ['version', 'clean:client', 'coffee:client', 'wrap', 'version', 'requirejs:client-no-backbone'],
"widgets": ["version", "hull_widgets"],
"components": ["version", "hull_components:hull"],
"docs": ['dox'],
"describe": ['describe']
}
};

helpers.updateDistTask(gruntConfig, !!grunt.option('dev'));

helpers.appendAWSConfig(gruntConfig);
helpers.cloudFrontConfig(gruntConfig);
grunt.initConfig(gruntConfig);

grunt.registerTask('test', ['version', 'karma:test']);

grunt.registerTask('reset', ['clean:reset']);

//These tasks are the only ones needed to be used
grunt.registerTask('default', 'server');
grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'dist:api', 'dist:widgets', 'watch']);
grunt.registerTask('server', ['connect', 'dist:remote', 'dist:client', 'test', 'dist:api', 'dist:components', 'watch']);
grunt.registerTask('deploy', ['dist', 's3:prod']);

require('./.grunt/customTasks')(grunt);
Expand Down
9 changes: 3 additions & 6 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@

<title>Hull App...</title>
<script src="//code.jquery.com/jquery-1.8.3.js"></script>
<script src="../dist/current/hull.js"></script>
<script src="//js.hull.dev/dist/current/hull.js"></script>
<script src="app.js"></script>
</head>
<body>
<div class="container">
<a id="trigger" class="btn" href="#">Hello</a>
<div data-hull-component='login/shopify_checkout@hull'
data-hull-target="#trigger" data-hull-main-color="#50b2da"></div>
</div>
<div data-hull-component="login/profile@hull"></div>
<div data-hull-component="login/form@hull"></div>
</body>
</html>
2 changes: 1 addition & 1 deletion aura_components/comments/list/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Hull.component({

beforeRender: function(data) {
this.sandbox.util._.each(data.comments, function(c) {
c.isDeletable = (c.user.id === data.me.id);
c.isDeletable = (c.user && c.user.id === data.me.id);
return c;
}, this);
return data;
Expand Down
3 changes: 2 additions & 1 deletion aura_components/login/shopify/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Hull.component({
authFailedMessage: 'You did not fully authorize or "{{provider}}" app is not well configured.',
windowClosedMessage: 'Authorization window has been closed.',
customerExistsMessage: '"{{email}}" is already associated with an account... Please <a href="/account/login">log in with your password</a>. If you have forgotten your password, you can <a href="/account/login#recover">reset your password here</a>.',
disabledCustomerMessage: 'An email has been sent to {{email}}, please click the link included to verify your email address.',
fallbackMessage: 'Bummer, something went wrong during authentication.'
},

Expand Down Expand Up @@ -151,7 +152,7 @@ Hull.component({
this._templates = this._templates || {};

if (!this._templates[key]) {
this._templates[key] = Hull.util.Handlebars.compile(this.options[key] || this.defaultMessages[key]);
this._templates[key] = this.sandbox.util.Handlebars.compile(this.options[key] || this.defaultMessages[key]);
}

return this._templates[key](locals);
Expand Down
12 changes: 12 additions & 0 deletions aura_components/login/shopify/options.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Shopify Component Options
=========================

You can customize your login buttons by adding options to your snippet.

```html
<div data-hull-component="login/shopify@hull">Loading Social Login...</div>;
```

This is the default snippet. Let's say we want to change the 'Sign In with Facebook' to 'Connect with Facebook'. To do that we need to set the `data-sign-in-message` to `Connect with {{provider}}`.

```html
<div data-hull-component="login/shopify@hull" data-sign-in-message="Connect with {{provider}}">Loading Social Login...</div>;
```

## Core

### `data-show-link-identity`
Expand Down
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "hull-js",
"version": "0.8.31",
"version": "0.8.36",
"main": "./lib/hull.js",
"dependencies": {
"jquery": "1.10.*",
"aura": "hull/aura#28f8475389ff5f3cdad493b98768ac5c684e0103",
"backbone": "0.9.9",
"analytics": "hull/analytics#1.0.8-hull",
"analytics": "hull/analytics#1.3.30-hull",
"cookies-js": "0.3.1",
"base64": "0.1.1",
"jquery-file-upload": "7.2.1",
"moment": "1.7.2",
"moment": "2.6.0",
"underscore.string": "2.3.1",
"twitter-text": "1.6.1",
"q": "~0.9.7",
Expand All @@ -25,6 +25,6 @@
"purl" : "2.3.1"
},
"devDependencies": {
"squire": "*"
"squire": "0.2.0"
}
}
31 changes: 16 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hull-js",
"version": "0.8.31",
"version": "0.8.36",
"devDependencies": {
"grunt": "~0.4.1",
"grunt": "0.4.2",
"grunt-s3": "0.2.0-alpha",
"grunt-git-describe": "git://github.com/hull/grunt-git-describe.git",
"grunt-contrib-clean": "0.4.0",
Expand All @@ -11,26 +11,27 @@
"grunt-contrib-connect": "0.1.2",
"grunt-contrib-handlebars": "0.5.9",
"grunt-contrib-requirejs": "0.4.0",
"grunt-contrib-uglify": "0.1.1",
"grunt-contrib-uglify": "0.4.0",
"grunt-contrib-watch": "0.5.3",
"grunt-contrib-symlink": "0.2.0",
"grunt-hull-dox": "git://github.com/hull/grunt-hull-dox.git",
"grunt-hull-widgets": "~0.7.0",
"bower": "~1.3.1",
"grunt-wrap": "~0.2.0",
"git-rev": "~0.2.1",
"grunt-contrib-copy": "~0.4.1",
"karma": "~0.10.8",
"karma-mocha": "~0.1.1",
"grunt-hull-components": "0.2.0-beta",
"bower": "1.3.1",
"grunt-wrap": "0.2.0",
"git-rev": "0.2.1",
"grunt-contrib-copy": "0.4.1",
"karma": "0.10.9",
"karma-mocha": "0.1.1",
"grunt-karma": "~0.6.2",
"karma-coffee-preprocessor": "~0.1.1",
"karma-coffee-preprocessor": "0.1.2",
"karma-chai": "0.0.2",
"karma-chai-sinon": "0.1.0",
"karma-spec-reporter": "0.0.6",
"semver": "~2.2.1",
"semver": "2.2.1",
"grunt-bump": "0.0.13",
"grunt-invalidate-cloudfront": "~0.1.4",
"grunt-contrib-cssmin": "0.9.0"
"grunt-invalidate-cloudfront": "0.1.4",
"grunt-contrib-cssmin": "0.9.0",
"mocha": "1.17.1"
},
"scripts": {
"postinstall": "$(npm bin)/bower install",
Expand All @@ -40,6 +41,6 @@
"node": "~0.10.0"
},
"dependencies": {
"bower": "~1.3.1"
"bower": "1.3.1"
}
}
4 changes: 2 additions & 2 deletions spec/api/current_user_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ define(['lib/api/current-user'], function (currentUserFn) {
this.updateListener({});
expect(this.userFn()).to.be.false;
});
it('should delegate to login if the update has id', function () {
it('should not delegate to login if the update has id', function () {
var user = { id: 'yop' };
this.updateListener(user);
this.femit.emit.should.have.been.calledWith('hull.auth.login', user);
this.femit.emit.should.not.have.been.calledWith('hull.auth.login', user);
});
});
describe('when there is a current user', function () {
Expand Down
Loading

0 comments on commit ab701c1

Please sign in to comment.