Skip to content

Commit

Permalink
Merge pull request #79 from paulcwatts/cognito-sdk
Browse files Browse the repository at this point in the history
Cognito SDK fix
  • Loading branch information
paulcwatts authored Mar 31, 2018
2 parents ef3b03f + d63f6c3 commit 5277335
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 516 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ env:
matrix:
# we recommend new addons test the current and previous LTS
# as well as latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=amazon-cognito-identity-js-1.x
- EMBER_TRY_SCENARIO=ember-lts-2.12
- EMBER_TRY_SCENARIO=ember-lts-2.16
- EMBER_TRY_SCENARIO=ember-lts-2.18
Expand Down
8 changes: 8 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ module.exports = function() {
return {
useYarn: true,
scenarios: [
{
name: 'amazon-cognito-identity-js-1.x',
npm: {
dependencies: {
'amazon-cognito-identity-js': '^1.31.0'
}
}
},
{
name: 'ember-lts-2.12',
npm: {
Expand Down
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-env node */
'use strict';
const VersionChecker = require('ember-cli-version-checker');

module.exports = {
name: 'ember-cognito',
Expand All @@ -21,7 +22,11 @@ module.exports = {
},
included: function(app) {
this._super.included.apply(this, arguments);
app.import('vendor/amazon-cognito-identity-js/aws-cognito-sdk.js');
let checker = new VersionChecker(this);
let cognito = checker.for('amazon-cognito-identity-js');
if (cognito.lt('2.0.2')) {
app.import('vendor/amazon-cognito-identity-js/aws-cognito-sdk.js');
}
app.import('vendor/amazon-cognito-identity-js/amazon-cognito-identity.min.js');
app.import('vendor/shims/amazon-cognito-identity-js.js');
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@
"ember-cli-shims": "^1.2.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.0.0",
"ember-cli-update": "^0.14.0",
"ember-cli-update": "^0.15.0",
"ember-cli-version-checker": "^2.1.0",
"ember-disable-prototype-extensions": "^1.1.2",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-native-dom-helpers": "^0.6.2",
"ember-resolver": "^4.0.0",
"ember-simple-auth": "^1.5.1",
"ember-sinon": "^1.0.0",
"ember-sinon": "^2.1.0",
"ember-sinon-qunit": "^3.1.0",
"ember-source": "~3.0.0",
"ember-source-channel-url": "^1.0.1",
Expand Down
Loading

0 comments on commit 5277335

Please sign in to comment.