From ea74fea7eb930c25daa1c6c8f2ebfb28f70a98cf Mon Sep 17 00:00:00 2001 From: Rui Silva Date: Thu, 4 Feb 2016 14:38:33 +0000 Subject: [PATCH 1/5] Update peer dependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index ea3d80e..c6c45ac 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,9 @@ "karma-should": "0.0.1", "karma-sinon": "^1.0.4", "lodash": "^2.4.1", + "mocha": "^2.4.5", "should": "^4.6.0", + "sinon": "^1.17.3", "yargs": "^3.6.0" }, "browser": { From 4f3ee8aa96e1409014856c4208f3d4cd382b5153 Mon Sep 17 00:00:00 2001 From: Rui Silva Date: Thu, 4 Feb 2016 14:39:14 +0000 Subject: [PATCH 2/5] Remove `browser` and `shims` from `package.json` This was creating conflicts when using it with webpack. --- package.json | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/package.json b/package.json index c6c45ac..1706e69 100644 --- a/package.json +++ b/package.json @@ -50,18 +50,8 @@ "sinon": "^1.17.3", "yargs": "^3.6.0" }, - "browser": { - "angular": "./bower_components/angular/angular.js", - "angular-cookies": "./bower_components/angular-cookies/angular-cookies.js", - "query-string": "./bower_components/query-string/query-string.js" - }, "scripts": { "changelog": "./node_modules/.bin/github-changes -o seegno -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'", "test": "./node_modules/.bin/gulp test --browsers Firefox" - }, - "browserify-shim": { - "angular": { - "exports": "angular" - } } } From bdb2d960a0135d96836d318a3a36281b724781a5 Mon Sep 17 00:00:00 2001 From: Rui Silva Date: Fri, 5 Feb 2016 13:29:54 +0000 Subject: [PATCH 3/5] Add `npm` dependencies --- README.md | 9 ++++----- karma.conf.js | 6 +++--- package.json | 5 +++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 818e183..2f181d6 100644 --- a/README.md +++ b/README.md @@ -177,11 +177,10 @@ It will be awesome if you can help us evolve `angular-oauth2`. Want to help? 1. [Fork it](https://github.com/seegno/angular-oauth2). 2. `npm install`. -3. `bower install` -4. Do your magic. -5. Run the tests: `gulp test`. -6. Build: `gulp build` -7. Create a [Pull Request](https://github.com/seegno/angular-oauth2/compare). +3. Do your magic. +4. Run the tests: `gulp test`. +5. Build: `gulp build` +6. Create a [Pull Request](https://github.com/seegno/angular-oauth2/compare). *The source files are written in ES6.* diff --git a/karma.conf.js b/karma.conf.js index ac63bc0..d43dca8 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,9 +14,9 @@ module.exports = function(config) { basePath: './', browsers: [argv.browsers || 'Chrome'], files: [ - 'bower_components/angular/angular.js', - 'bower_components/angular-cookies/angular-cookies.js', - 'bower_components/query-string/query-string.js', + 'node_modules/angular/angular.js', + 'node_modules/angular-cookies/angular-cookies.js', + 'node_modules/query-string/query-string.js', 'node_modules/lodash/dist/lodash.js', 'node_modules/angular-mocks/angular-mocks.js', 'dist/angular-oauth2.js', diff --git a/package.json b/package.json index 1706e69..fd5214c 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,11 @@ "url": "https://github.com/seegno/angular-oauth2/issues" }, "homepage": "https://github.com/seegno/angular-oauth2", + "dependencies": { + "angular": "^1.4.0", + "angular-cookies": "^1.4.0", + "query-string": "^1.0.0" + }, "devDependencies": { "6to5ify": "^3.1.2", "angular-mocks": "^1.3.9", From af84c5b3b49a09f7b3003287688139fba1e09e9c Mon Sep 17 00:00:00 2001 From: Rui Silva Date: Fri, 5 Feb 2016 13:30:57 +0000 Subject: [PATCH 4/5] Update travis config --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e58244..ea427c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: node_js sudo: false before_script: - - ./node_modules/.bin/bower install - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start @@ -16,5 +15,3 @@ node_js: cache: directories: - node_modules - - bower_components - From 4d7a0db6a8de3c3115e51f44ec46aa43f5ca2d86 Mon Sep 17 00:00:00 2001 From: Rui Silva Date: Fri, 5 Feb 2016 15:37:34 +0000 Subject: [PATCH 5/5] Update UMD wrapper to include `angular-cookies` --- gulpfile.js | 22 ++++++++++++++++++---- src/angular-oauth2.js | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 1559f62..d6b5057 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,10 +27,24 @@ var config = { umd: { namespace: 'angularOAuth2', exports: 'ngModule', - deps: [ - 'angular', - { name: 'query-string', globalName: 'queryString', paramName: 'queryString' } - ] + template: ` + (function(root, factory) { + if (typeof define === 'function' && define.amd) { + define([ "angular", "angular-cookies", "query-string" ], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require("angular"), require("angular-cookies"), require("query-string")); + } else { + root.<%= namespace %> = factory(root.angular, 'ngCookies', root.queryString); + } + }(this, function(angular, ngCookies, queryString) { + <% if (exports) { %> + <%= contents %> + return <%= exports %>; + <% } else { %> + return <%= contents %>; + <% } %> + })); + ` }, banner: ['/**', ' * <%= pkg.name %> - <%= pkg.description %>', diff --git a/src/angular-oauth2.js b/src/angular-oauth2.js index befc76f..c2e8b16 100644 --- a/src/angular-oauth2.js +++ b/src/angular-oauth2.js @@ -8,10 +8,10 @@ import OAuthProvider from './providers/oauth-provider'; import OAuthTokenProvider from './providers/oauth-token-provider'; import oauthConfig from './config/oauth-config'; import oauthInterceptor from './interceptors/oauth-interceptor'; -import 'angular-cookies'; +import ngCookies from 'angular-cookies'; var ngModule = angular.module('angular-oauth2', [ - 'ngCookies' + ngCookies ]) .config(oauthConfig) .factory('oauthInterceptor', oauthInterceptor)