Skip to content

Commit 25f4166

Browse files
committed
Merge pull request #76 from seegno/support/package-browser
Update `package.json`
2 parents 6519e27 + 4d7a0db commit 25f4166

File tree

6 files changed

+34
-27
lines changed

6 files changed

+34
-27
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ language: node_js
33
sudo: false
44

55
before_script:
6-
- ./node_modules/.bin/bower install
76
- export DISPLAY=:99.0
87
- sh -e /etc/init.d/xvfb start
98

@@ -16,5 +15,3 @@ node_js:
1615
cache:
1716
directories:
1817
- node_modules
19-
- bower_components
20-

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,10 @@ It will be awesome if you can help us evolve `angular-oauth2`. Want to help?
177177

178178
1. [Fork it](https://github.com/seegno/angular-oauth2).
179179
2. `npm install`.
180-
3. `bower install`
181-
4. Do your magic.
182-
5. Run the tests: `gulp test`.
183-
6. Build: `gulp build`
184-
7. Create a [Pull Request](https://github.com/seegno/angular-oauth2/compare).
180+
3. Do your magic.
181+
4. Run the tests: `gulp test`.
182+
5. Build: `gulp build`
183+
6. Create a [Pull Request](https://github.com/seegno/angular-oauth2/compare).
185184

186185
*The source files are written in ES6.*
187186

gulpfile.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,24 @@ var config = {
2727
umd: {
2828
namespace: 'angularOAuth2',
2929
exports: 'ngModule',
30-
deps: [
31-
'angular',
32-
{ name: 'query-string', globalName: 'queryString', paramName: 'queryString' }
33-
]
30+
template: `
31+
(function(root, factory) {
32+
if (typeof define === 'function' && define.amd) {
33+
define([ "angular", "angular-cookies", "query-string" ], factory);
34+
} else if (typeof exports === 'object') {
35+
module.exports = factory(require("angular"), require("angular-cookies"), require("query-string"));
36+
} else {
37+
root.<%= namespace %> = factory(root.angular, 'ngCookies', root.queryString);
38+
}
39+
}(this, function(angular, ngCookies, queryString) {
40+
<% if (exports) { %>
41+
<%= contents %>
42+
return <%= exports %>;
43+
<% } else { %>
44+
return <%= contents %>;
45+
<% } %>
46+
}));
47+
`
3448
},
3549
banner: ['/**',
3650
' * <%= pkg.name %> - <%= pkg.description %>',

karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ module.exports = function(config) {
1414
basePath: './',
1515
browsers: [argv.browsers || 'Chrome'],
1616
files: [
17-
'bower_components/angular/angular.js',
18-
'bower_components/angular-cookies/angular-cookies.js',
19-
'bower_components/query-string/query-string.js',
17+
'node_modules/angular/angular.js',
18+
'node_modules/angular-cookies/angular-cookies.js',
19+
'node_modules/query-string/query-string.js',
2020
'node_modules/lodash/dist/lodash.js',
2121
'node_modules/angular-mocks/angular-mocks.js',
2222
'dist/angular-oauth2.js',

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"url": "https://github.com/seegno/angular-oauth2/issues"
2222
},
2323
"homepage": "https://github.com/seegno/angular-oauth2",
24+
"dependencies": {
25+
"angular": "^1.4.0",
26+
"angular-cookies": "^1.4.0",
27+
"query-string": "^1.0.0"
28+
},
2429
"devDependencies": {
2530
"6to5ify": "^3.1.2",
2631
"angular-mocks": "^1.3.9",
@@ -45,21 +50,13 @@
4550
"karma-should": "0.0.1",
4651
"karma-sinon": "^1.0.4",
4752
"lodash": "^2.4.1",
53+
"mocha": "^2.4.5",
4854
"should": "^4.6.0",
55+
"sinon": "^1.17.3",
4956
"yargs": "^3.6.0"
5057
},
51-
"browser": {
52-
"angular": "./bower_components/angular/angular.js",
53-
"angular-cookies": "./bower_components/angular-cookies/angular-cookies.js",
54-
"query-string": "./bower_components/query-string/query-string.js"
55-
},
5658
"scripts": {
5759
"changelog": "./node_modules/.bin/github-changes -o seegno -r angular-oauth2 -a --only-pulls --use-commit-body --title 'Changelog' --date-format '/ YYYY-MM-DD'",
5860
"test": "./node_modules/.bin/gulp test --browsers Firefox"
59-
},
60-
"browserify-shim": {
61-
"angular": {
62-
"exports": "angular"
63-
}
6461
}
6562
}

src/angular-oauth2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import OAuthProvider from './providers/oauth-provider';
88
import OAuthTokenProvider from './providers/oauth-token-provider';
99
import oauthConfig from './config/oauth-config';
1010
import oauthInterceptor from './interceptors/oauth-interceptor';
11-
import 'angular-cookies';
11+
import ngCookies from 'angular-cookies';
1212

1313
var ngModule = angular.module('angular-oauth2', [
14-
'ngCookies'
14+
ngCookies
1515
])
1616
.config(oauthConfig)
1717
.factory('oauthInterceptor', oauthInterceptor)

0 commit comments

Comments
 (0)