Skip to content

Commit fb03119

Browse files
committed
Merged changes
2 parents 57cf62c + 7ad36cd commit fb03119

File tree

10 files changed

+46
-234
lines changed

10 files changed

+46
-234
lines changed

.eslintrc.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,11 @@ module.exports = {
88
env: {
99
browser: true,
1010
},
11-
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
12-
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
1311
extends: ['airbnb-base'],
14-
// required to lint *.vue files
15-
// check if imports actually resolve
16-
// add your custom rules here
1712
rules: {
1813
"linebreak-style": "off",
14+
"indent": ["error", 2],
1915
'max-len': ["error", { "code": 250 }],
20-
// don't require .vue extension when importing
2116
'import/extensions': ['error', 'always', {
2217
js: 'never',
2318
}],
@@ -36,6 +31,6 @@ module.exports = {
3631
optionalDependencies: ['test/unit/index.js']
3732
}],
3833
// allow debugger during development
39-
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
34+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
4035
}
4136
}

.travis.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ notifications:
77
email:
88
on_success: always
99
on_failure: change
10-
1110
cache:
1211
directories:
1312
- node_modules
@@ -16,6 +15,8 @@ node_js:
1615
install:
1716
- npm install
1817
- npm install -g codecov
18+
before_script:
19+
- npm prune
1920
script:
2021
- npm run lint
2122
- npm run test:cover
@@ -24,12 +25,7 @@ after_success:
2425
- npm run coveralls
2526
- bash <(curl -s https://codecov.io/bash)
2627
- npm run publish:docs
27-
before_deploy:
28-
- cd dist
29-
deploy:
30-
provider: npm
31-
32-
skip_cleanup: true
33-
api_key: $NPM_TOKEN
34-
on:
35-
branch: master
28+
- npm run semantic-release
29+
branches:
30+
except:
31+
- /^v\d+\.\d+\.\d+$/

CHANGELOG.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
## Babel Starter Kit Change Log
1+
## Change Log
22

33
All notable changes to this project will be documented in this file.
4-
5-
### [Unreleased][unreleased]
6-
7-
- Allow to execute tests in a browser environment (PLANNED)
8-
9-
### [v1.2.0] - 2016-05-04
10-
11-
- Add `tools/build.js` script
12-
- Build source files into `dist` folder
13-
- Update npm modules
14-
- Publish as CommonJS, ES2015 and UMD via [Rollup](http://rollupjs.org/). See `tools/build.js`.
15-
16-
### [v1.1.2] - 2016-04-03
17-
18-
- Add `npm run test:watch` npm script for running tests in watch mode
19-
- Add a recipe: Testing with `mocha` and `jsdom`
20-
- Add a recipe: Throwing errors with FB's `invariant` (`fbjs`) library
21-
- Update `eslint` and `babel-eslint` npm modules to the latest versions
22-
- Update unit test code sample
23-
- Add [CONTRIBUTING.md](CONTRIBUTING.md) and [CHANGELOG.md](CHANGELOG.md) files
24-
25-
### [v1.1.0] - 2016-03-31
26-
27-
- Add code coverage in unit tests with [Istanbul](https://github.com/gotwarlost/istanbul) and [Coveralls](https://coveralls.io/) [#8](https://github.com/kriasoft/babel-starter-kit/pull/8)
28-
29-
### [v1.0.0] - 2016-03-30
30-
31-
- Clean up the code and `package.json` file, update project dependencies
32-
- Integrate [Easystatic](https://easystatic.com) that generates a static site from the `docs/*.md` files
33-
34-
[unreleased]: https://github.com/kriasoft/babel-starter-kit/compare/v1.2.0...HEAD
35-
[v1.2.0]: https://github.com/kriasoft/babel-starter-kit/compare/v1.1.2...v1.2.0
36-
[v1.1.2]: https://github.com/kriasoft/babel-starter-kit/compare/v1.1.0...v1.1.2
37-
[v1.1.0]: https://github.com/kriasoft/babel-starter-kit/compare/v1.0.0...v1.1.0
38-
[v1.0.0]: https://github.com/kriasoft/babel-starter-kit/compare/v0.1.1...v1.0.0

CONTRIBUTING.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# aspnet-auth
2-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![codecov](https://codecov.io/gh/Halceyon/aspnet-auth/branch/master/graph/badge.svg)](https://codecov.io/gh/Halceyon/aspnet-auth) [![Build Status](https://travis-ci.org/Halceyon/aspnet-auth.svg?branch=master)](https://travis-ci.org/Halceyon/aspnet-auth) [![npm](https://img.shields.io/npm/dm/aspnet-auth.svg)](https://npm-stat.com/charts.html?package=aspnet-auth) [![npm](https://img.shields.io/npm/v/aspnet-auth.svg)](https://www.npmjs.com/package/aspnet-auth) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/Halceyon/aspnet-auth.svg)](http://isitmaintained.com/project/Halceyon/aspnet-auth "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/Halceyon/aspnet-auth.svg)](http://isitmaintained.com/project/Halceyon/aspnet-auth "Percentage of issues still open")
2+
3+
[![Greenkeeper badge](https://badges.greenkeeper.io/Halceyon/aspnet-auth.svg)](https://greenkeeper.io/)
4+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Halceyon/aspnet-auth/blob/master/LICENSE.txt) [![codecov](https://codecov.io/gh/Halceyon/aspnet-auth/branch/master/graph/badge.svg)](https://codecov.io/gh/Halceyon/aspnet-auth) [![Build Status](https://travis-ci.org/Halceyon/aspnet-auth.svg?branch=master)](https://travis-ci.org/Halceyon/aspnet-auth) [![npm](https://img.shields.io/npm/dm/aspnet-auth.svg)](https://npm-stat.com/charts.html?package=aspnet-auth) [![npm](https://img.shields.io/npm/v/aspnet-auth.svg)](https://www.npmjs.com/package/aspnet-auth) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/Halceyon/aspnet-auth.svg)](http://isitmaintained.com/project/Halceyon/aspnet-auth "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/Halceyon/aspnet-auth.svg)](http://isitmaintained.com/project/Halceyon/aspnet-auth "Percentage of issues still open")
35

46
A standalone lightweight javascript library for authenticating with ASP.NET OWIN site.
57

@@ -32,7 +34,7 @@ const aspnetAuth = new AspnetAuth({
3234

3335
**register**
3436
```js
35-
aspnetAuth.register('[email protected]', 'SomePassword', 'SomePassword').then((result) => {
37+
aspnetAuth.register('[email protected]', 'SomePassword').then((result) => {
3638
// returns result.status = 200 on success
3739
done();
3840
})

package.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "aspnet-auth",
33
"version": "1.0.1",
4-
"description": "A standalone lightweight javascript library for authenticating with ASP.NET OWIN site.",
4+
"description": "A standalone promise-based javascript library for authenticating with ASP.NET OWIN site.",
55
"author": "Craig Pretorius <[email protected]>",
66
"homepage": "https://halceyon.github.io/aspnet-auth",
77
"repository": "Halceyon/aspnet-auth",
@@ -10,8 +10,8 @@
1010
],
1111
"license": "MIT",
1212
"keywords": [],
13-
"main": "aspnet-auth.js",
14-
"jsnext:main": "aspnet-auth.es.js",
13+
"main": "dist/aspnet-auth.js",
14+
"jsnext:main": "dist/aspnet-auth.es.js",
1515
"babel": {
1616
"presets": [
1717
"latest",
@@ -26,7 +26,7 @@
2626
"extends": "airbnb-base"
2727
},
2828
"dependencies": {
29-
"axios": "^0.17.1",
29+
"axios": "^0.18.0",
3030
"babel-runtime": "^6.11.6",
3131
"browser-cookies": "^1.2.0",
3232
"qs": "^6.5.1",
@@ -35,39 +35,43 @@
3535
"devDependencies": {
3636
"babel-cli": "^6.16.0",
3737
"babel-core": "^6.17.0",
38-
"babel-eslint": "^7.2.3",
38+
"babel-eslint": "^8.2.2",
3939
"babel-plugin-transform-runtime": "^6.15.0",
4040
"babel-preset-latest": "^6.16.0",
4141
"babel-preset-stage-0": "^6.16.0",
4242
"babel-register": "^6.16.3",
4343
"chai": "^4.0.0-canary.1",
44-
"coveralls": "^2.11.14",
45-
"del": "^2.2.2",
44+
"coveralls": "^3.0.0",
45+
"del": "^3.0.0",
4646
"easystatic": "^0.1.12",
47-
"eslint": "^3.8.0",
48-
"eslint-config-airbnb-base": "^10.0.1",
47+
"eslint": "^4.18.1",
48+
"eslint-config-airbnb-base": "^12.1.0",
4949
"eslint-plugin-import": "^2.2.0",
5050
"faker": "^4.1.0",
5151
"istanbul": "^1.1.0-alpha.1",
5252
"json-stable-stringify": "^1.0.1",
5353
"json-stringify-safe": "^5.0.1",
54-
"mocha": "^3.1.2",
54+
"mocha": "^5.0.1",
5555
"parse-json": "^4.0.0",
56-
"rollup": "^0.36.3",
57-
"rollup-plugin-babel": "^2.6.1",
56+
"rollup": "^0.56.2",
57+
"rollup-plugin-babel": "^3.0.3",
5858
"semantic-release": "^12.4.1",
59-
"sinon": "^2.0.0-pre.3",
60-
"sinon-stub-promise": "^4.0.0"
59+
"sinon": "^4.4.1",
60+
"sinon-stub-promise": "^4.0.0",
61+
"travis-deploy-once": "^4.3.4"
6162
},
6263
"scripts": {
6364
"lint": "eslint src test tools",
65+
"lint-fix": "eslint src test tools --fix",
6466
"test": "mocha --compilers js:babel-register",
6567
"test:watch": "mocha --compilers js:babel-register --reporter min --watch",
6668
"test:cover": "babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha",
6769
"coveralls": "type ./coverage/lcov.info | coveralls",
6870
"build": "node tools/build",
6971
"prepublish": "npm run build",
7072
"publish:docs": "easystatic deploy docs --repo Halceyon/aspnet-auth",
71-
"dev": "easystatic start docs"
73+
"dev": "easystatic start docs",
74+
"travis-deploy-once": "travis-deploy-once",
75+
"semantic-release": "semantic-release"
7276
}
7377
}

src/AspnetAuth.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ const qs = require('qs');
1414
const stringify = require('json-stable-stringify');
1515

1616
class AspnetAuth {
17-
1817
constructor(options) {
1918
const defaults = {
2019
url: '',
@@ -63,13 +62,12 @@ class AspnetAuth {
6362
client_id: this.options.client_id,
6463
client_secret: this.options.client_secret,
6564
grant_type: 'password',
66-
}),
67-
)
68-
.then((response) => {
69-
this.saveAuth(response.data);
70-
this.fillAuth();
71-
return response;
72-
});
65+
}))
66+
.then((response) => {
67+
this.saveAuth(response.data);
68+
this.fillAuth();
69+
return response;
70+
});
7371
}
7472

7573
loginExternal(tokenRequest) {

test/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
],
1313
"no-unused-expressions": "off",
1414
"padded-blocks": "off",
15-
"no-console": "off",
15+
"no-console": "off"
1616
}
1717
}

test/aspnet-authSpec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ describe('AspnetAuth', () => {
102102
aspnetAuth.loginExternal({
103103
token: '',
104104
})
105-
.then((response) => {
106-
done();
107-
expect(response.data.access_token).to.eq('175f0a68e51a420eb27ec707a53cce70');
108-
})
109-
.catch((err) => {
110-
console.log(err);
111-
});
105+
.then((response) => {
106+
done();
107+
expect(response.data.access_token).to.eq('175f0a68e51a420eb27ec707a53cce70');
108+
})
109+
.catch((err) => {
110+
console.log(err);
111+
});
112112

113113
axios.get.restore();
114114
});

0 commit comments

Comments
 (0)