Skip to content

Commit 3676da1

Browse files
committed
2 parents 8ebe15b + 732d25f commit 3676da1

File tree

8 files changed

+29
-46
lines changed

8 files changed

+29
-46
lines changed

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vscode/
2+
node_modules/
3+
coverage/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ notifications:
88
on_success: always
99
on_failure: change
1010
node_js:
11-
- '6'
11+
- '9'
1212
before_install:
1313
- npm i -g npm@^2.0.0
1414
install:

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11

22
# vue-aspnet-auth
3-
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vue-aspnet-auth/blob/master/LICENSE) [![Build Status](https://travis-ci.org/Halceyon/vue-aspnet-auth.svg?branch=master)](https://travis-ci.org/Halceyon/vue-aspnet-auth) [![npm](https://img.shields.io/npm/v/vue-aspnet-auth.svg)](https://www.npmjs.com/package/vue-aspnet-auth)
3+
4+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vue-aspnet-auth/blob/master/LICENSE) [![Build Status](https://travis-ci.org/Halceyon/vue-aspnet-auth.svg?branch=master)](https://travis-ci.org/Halceyon/vue-aspnet-auth) [![codecov](https://codecov.io/gh/Halceyon/aspnet-auth/branch/master/graph/badge.svg)](https://codecov.io/gh/Halceyon/aspnet-auth) [![npm](https://img.shields.io/npm/v/vue-aspnet-auth.svg)](https://www.npmjs.com/package/vue-aspnet-auth) [![Greenkeeper badge](https://badges.greenkeeper.io/Halceyon/vue-aspnet-auth.svg)](https://greenkeeper.io/) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
45

56
A [Vue](https://vuejs.org) plugin wrapper for [aspnet-auth](https://github.com/halceyon/aspnet-auth).
67

78
# Getting Started
89

910
## Install
1011

11-
From CDN
12-
13-
```html
14-
<script src="https://cdn.jsdelivr.net/npm/vue-aspnet-auth"></script>
15-
```
16-
1712
From [npm](https://npmjs.org)
1813

1914
```sh

package.json

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-aspnet-auth",
3-
"version": "1.2.0-development",
3+
"version": "0.0.0-beta",
44
"description": "Vue plugin for auth to OWIN MVC",
55
"repository": {
66
"type": "git",
@@ -18,8 +18,8 @@
1818
"url": "https://github.com/Halceyon/vue-aspnet-auth/issues"
1919
},
2020
"homepage": "https://github.com/Halceyon/vue-aspnet-auth#readme",
21-
"main": "vue-aspnet-auth.js",
22-
"jsnext:main": "vue-aspnet-auth.es.js",
21+
"main": "dist/vue-aspnet-auth.js",
22+
"jsnext:main": "dist/vue-aspnet-auth.es.js",
2323
"babel": {
2424
"presets": [
2525
"latest",
@@ -40,25 +40,26 @@
4040
"devDependencies": {
4141
"babel-cli": "^6.16.0",
4242
"babel-core": "^6.17.0",
43-
"babel-eslint": "^7.0.0",
43+
"babel-eslint": "^8.2.2",
4444
"babel-plugin-transform-runtime": "^6.15.0",
4545
"babel-preset-latest": "^6.16.0",
4646
"babel-preset-stage-0": "^6.16.0",
4747
"babel-register": "^6.16.3",
4848
"browser-cookies": "^1.2.0",
4949
"chai": "^4.0.0-canary.1",
50-
"coveralls": "^2.13.3",
51-
"del": "^2.2.2",
52-
"eslint": "^3.19.0",
53-
"eslint-config-airbnb-base": "^10.0.1",
50+
"coveralls": "^3.0.0",
51+
"del": "^3.0.0",
52+
"eslint": "^4.18.1",
53+
"eslint-config-airbnb-base": "^12.1.0",
5454
"eslint-plugin-import": "^2.2.0",
5555
"istanbul": "^1.1.0-alpha.1",
56-
"mocha": "^3.1.2",
56+
"json-stable-stringify": "^1.0.1",
57+
"mocha": "^5.0.1",
5758
"parse-json": "^4.0.0",
58-
"rollup": "^0.36.3",
59-
"rollup-plugin-babel": "^2.6.1",
59+
"rollup": "^0.56.2",
60+
"rollup-plugin-babel": "^3.0.3",
6061
"semantic-release": "^12.4.1",
61-
"sinon": "^2.0.0-pre.3",
62+
"sinon": "^4.4.0",
6263
"sinon-stub-promise": "^4.0.0",
6364
"travis-deploy-once": "^4.3.4",
6465
"vue": "^2.5.13"
@@ -69,6 +70,6 @@
6970
"test:cover": "babel-node ./node_modules/istanbul/lib/cli.js cover ./node_modules/mocha/bin/_mocha",
7071
"travis-deploy-once": "travis-deploy-once",
7172
"semantic-release": "semantic-release",
72-
"coveralls": "type /coverage/lcov.info | coveralls"
73+
"coveralls": "cat ./coverage/lcov.info | coveralls"
7374
}
7475
}

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99

1010
import aspnetAuth from 'aspnet-auth';
1111
export const AspnetAuth = {
12-
install(Vue) {
13-
Vue.prototype.$auth = new aspnetAuth({
14-
url: 'http://localhost'
15-
});
12+
install(Vue, options) {
13+
Vue.prototype.$auth = new aspnetAuth(options);
1614
}
1715
}

test/.eslintrc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
"mocha": true
44
},
55
"rules": {
6-
"import/no-extraneous-dependencies": [
7-
"error",
8-
{
9-
"optionalDependencies": false,
10-
"peerDependencies": false
11-
}
12-
],
13-
"no-unused-expressions": "off",
14-
"padded-blocks": "off",
156
"no-console": "off"
167
}
178
}

test/vue-aspnet-auth-Spec.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,18 @@ describe('vue-aspnet-auth', () => {
1717

1818
before(() => {
1919
sinon.stub(cookies, 'get').returns(null);
20-
Vue.use(AspnetAuth);
20+
Vue.use(AspnetAuth, {
21+
url: 'http://localhost'
22+
});
2123
});
2224
after(() => {
2325
cookies.get.restore();
2426
});
2527

28+
it('should receive the url as an option', () => {
29+
expect(Vue.prototype.$auth.options.url).to.eq('http://localhost');
30+
});
31+
2632
it('attached itself to vue as $auth', () => {
2733
expect(Vue.prototype.$auth).to.be.an('object');
2834
});

tools/build.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,4 @@ promise = promise.then(() => del(['dist/*']));
3737
})));
3838
});
3939

40-
// Copy package.json and LICENSE
41-
promise = promise.then(() => {
42-
delete pkg.private;
43-
delete pkg.devDependencies;
44-
delete pkg.scripts;
45-
delete pkg.eslintConfig;
46-
delete pkg.babel;
47-
fs.writeFileSync('dist/package.json', JSON.stringify(pkg, null, ' '), 'utf-8');
48-
fs.writeFileSync('dist/LICENSE', fs.readFileSync('LICENSE', 'utf-8'), 'utf-8');
49-
});
50-
5140
promise.catch(err => console.error(err.stack)); // eslint-disable-line no-console

0 commit comments

Comments
 (0)