Skip to content

Commit 0ae7719

Browse files
committed
Rewrite to Typescript
1 parent 0809ea7 commit 0ae7719

25 files changed

+3331
-1114
lines changed

Makefile

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

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![codecov](https://codecov.io/gh/feedbackfruits/passport-brightspace/branch/master/graph/badge.svg)](https://codecov.io/gh/feedbackfruits/passport-brightspace)
44

55
> [!IMPORTANT]
6-
> Media now require yarn v4+, make sure to upgrade your local yarn by running `corepack enable`
6+
> This repo now requires yarn v4+, make sure to upgrade your local yarn by running `corepack enable`. You may also need to run `yarn install` to install the correct dependencies.
77
88
[Passport](http://passportjs.org/) strategy for authenticating with [Brightspace](http://docs.valence.desire2learn.com/reference.html)
99
using the OAuth 2.0 API.
@@ -16,9 +16,9 @@ unobtrusively integrated into any application or framework that supports
1616

1717
## Install
1818
```sh
19-
npm install passport-brightspace
19+
npm install https://github.com/feedbackfruits/passport-brightspace
2020
# or
21-
yarn add passport-brightspace
21+
yarn add https://github.com/feedbackfruits/passport-brightspace
2222
```
2323

2424
## Usage
@@ -54,21 +54,21 @@ For example, as route middleware in an [Express](http://expressjs.com/)
5454
application:
5555

5656
```js
57-
app.get('/auth/brightspace',
58-
passport.authenticate('brightspace', { }));
59-
60-
app.get('/auth/brightspace/callback',
61-
passport.authenticate('brightspace', { failureRedirect: '/login' }),
62-
function(req, res) {
63-
// Successful authentication, redirect home.
64-
res.redirect('/');
65-
});
57+
app.get('/auth/brightspace',
58+
passport.authenticate('brightspace', { }));
59+
60+
app.get('/auth/brightspace/callback',
61+
passport.authenticate('brightspace', { failureRedirect: '/login' }),
62+
function(req, res) {
63+
// Successful authentication, redirect home.
64+
res.redirect('/');
65+
});
6666
```
6767

6868
## Tests
6969

7070
```sh
71-
yarn
71+
yarn install
7272
yarn test
7373
```
7474

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import fbfConfig from '@feedbackfruits/eslint-config';
2+
3+
export default [
4+
...fbfConfig,
5+
{
6+
rules: {
7+
'no-shadow': 0,
8+
'import/named': 0,
9+
'import/no-named-as-default': 0,
10+
'import/no-named-as-default-member': 0,
11+
'@typescript-eslint/no-empty-object-type': 0,
12+
'@typescript-eslint/no-unused-vars': 0,
13+
'@typescript-eslint/no-require-imports': 0
14+
}
15+
}
16+
];

lib/index.js

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

lib/profile.js

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

lib/strategy.js

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

package.json

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "passport-brightspace",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Brightspace authentication strategy for Passport.",
55
"scripts": {
6+
"build": "tsc",
67
"test": "mocha 'test/*.test.js'",
7-
"test:cov": "nyc mocha 'test/*.test.js'"
8+
"test:cov": "nyc mocha 'test/*.test.js'",
9+
"prepublish": "yarn build"
810
},
911
"keywords": [
1012
"passport",
@@ -26,15 +28,24 @@
2628
"url": "http://github.com/feedbackfruits/passport-brightspace/issues"
2729
},
2830
"license": "MIT",
29-
"main": "./lib",
31+
"main": "./dist",
3032
"dependencies": {
31-
"passport-oauth2": "1.8.0",
32-
"querystring": "0.2.1"
33+
"passport-oauth2": "1.8.0"
3334
},
3435
"devDependencies": {
35-
"chai": "4.5.0",
36-
"mocha": "10.8.2",
37-
"nyc": "17.1.0"
36+
"@feedbackfruits/eslint-config": "2.0.1",
37+
"@feedbackfruits/tsconfig": "1.0.2",
38+
"@types/passport-oauth2": "1.4.17",
39+
"@typescript-eslint/eslint-plugin": "8.34.1",
40+
"@typescript-eslint/parser": "8.34.1",
41+
"chai": "5.2.0",
42+
"eslint": "9.29.0",
43+
"eslint-plugin-import": "2.31.0",
44+
"mocha": "11.7.0",
45+
"nyc": "17.1.0",
46+
"passport": "^0.7.0",
47+
"sinon": "^21.0.0",
48+
"typescript": "5.8.3"
3849
},
3950
"engines": {
4051
"node": "20.*"

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Strategy from './strategy';
2+
3+
export default Strategy;

0 commit comments

Comments
 (0)