Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promises #21

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
31dea32
- Breaking change: Stop supporting older behavior against layers of a…
brettz9 May 8, 2019
fb9d5b0
- Linting (ESLint): Avoid "useless" catch error; adhere to stricter j…
brettz9 Jun 26, 2019
2215b0b
- Linting: example whitespace
brettz9 Jul 13, 2019
f763a0e
- npm: Update devDeps
brettz9 Sep 11, 2019
4b99cc5
- Docs: Indicate usage of test-one script
brettz9 Sep 11, 2019
6505c94
- Refactoring: Avoid `let` in unneeded higher scope
brettz9 Sep 11, 2019
445a673
- Fix: Avoid erring upon missing failure with callback and `authentic…
brettz9 Sep 12, 2019
357727a
- Testing: Delete `_passport` object when simulating without `initial…
brettz9 Sep 12, 2019
c220b5b
- Fix: Check for `instance` property (as in check earlier in the same…
brettz9 Sep 12, 2019
ee8ac43
- Testing: Expand coverage (still incomplete)
brettz9 Sep 12, 2019
504f7b1
- Testing: For login test now, delete `_passport` object when simulat…
brettz9 Sep 12, 2019
3026221
- Fix: Avoid unfulfilled Promise condition (and simplify Promise retu…
brettz9 Sep 12, 2019
017745f
- Fix: Returning `undefined` to continue promise chain
brettz9 Sep 12, 2019
45502ba
- Refactoring: Use async/await syntax for authenticator.js
brettz9 Sep 12, 2019
e45b79e
- Fix: transformAuthInfo and `undefined`
brettz9 Sep 12, 2019
ce4b40a
- Testing: Additional tests with `undefined`
brettz9 Sep 12, 2019
b3fd8e1
- Refactoring: Simplify to avoid additional catch
brettz9 Sep 12, 2019
dbf7c51
- Testing: Complete coverage (add tests for erring without callbacks)
brettz9 Sep 13, 2019
cb38add
- Linting (ESLint): Apply to any HTML files; confine overrides to tes…
brettz9 Sep 13, 2019
36fb361
- npm/Docs (Contributing): Update templates
brettz9 Sep 13, 2019
786d028
- Linting: Add chai-friendly plugin to avoid need for disabling `no-u…
brettz9 Sep 16, 2019
4a347da
- npm: update package-lock.json
brettz9 Sep 20, 2019
e67601d
- INCOMPLETE (need to get PR for ash-nazg upgraded and switch back to…
brettz9 Jan 13, 2020
92127f6
- Convey intent with Chai expect registration in CLI call
brettz9 Jul 6, 2020
10a72c6
Merge commit 'ad4f18ab7d55952612f081caa054a768f288971e' into promises
brettz9 Jul 6, 2020
14dbfd2
- Travis: Drop EOL'd Node 8; add Node 14
brettz9 Jul 6, 2020
e7d0338
- npm: Update lock file
brettz9 Jul 6, 2020
14aacbc
- npm: Update template
brettz9 Jul 6, 2020
ef547ce
- Linting: As per latest ash-nazg
brettz9 Jul 6, 2020
a568183
Merge branch 'master' into promises
brettz9 Feb 2, 2021
6d7883b
- npm: Update template variables
brettz9 Feb 2, 2021
455e3e0
- npm: Move vulnerable node-static server to http-server
brettz9 Feb 14, 2021
901cc0b
- Linting: Use ESLint 7 new processor API as now targeted by `eslint-…
brettz9 Feb 15, 2021
32f0c0f
- Linting: As per latest ash-nazg
brettz9 Jul 1, 2021
58066c9
- Breaking change: Drop Node 10
brettz9 Jul 1, 2021
cf5b846
- Linting: Add back line breaks with `@example`
brettz9 Jul 1, 2021
29fee11
- Docs: Fix JSDoc values
brettz9 Jul 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
; EditorConfig file: https://EditorConfig.org
; Install the "EditorConfig" plugin into your editor to use

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[package.json]
; indent_style = tab
indent_size = 4
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.git
coverage/
node_modules/
var/
docs/jsdoc
226 changes: 126 additions & 100 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,108 +1,134 @@
'use strict';
module.exports = {
env: {
node: true,
browser: false
},
extends: [
'@passport-next/eslint-config-passport-next/sauron-node.js',
// Override ash-nazg's current preference for ESM
'plugin:node/recommended-script'
],
overrides: [
{
files: ['test/**'],
env: {
// jest: true,
mocha: true
},
globals: {
expect: 'readonly'
},
rules: {
'jsdoc/require-jsdoc': 'off'
// 'jest/no-disabled-tests': [2],
// 'jest/no-focused-tests': [2],
// 'jest/no-identical-title': [2],
// 'jest/prefer-to-have-length': [2],
// 'jest/valid-expect': [2],
}
env: {
node: true,
browser: false
},
extends: [
'eslint-config-ash-nazg/sauron-node.js',
// Override eslint-config-passport-next's current preference for ESM
'plugin:node/recommended-script'
],
settings: {
polyfills: [
// Needing these for some reason to avoid an error
'Promise',
'Promise.reject',
'Promise.resolve'
]
},
overrides: [
{
files: ['test/**/*.test.js'],
env: {
// jest: true,
mocha: true
},
globals: {
expect: 'readonly'
},
{
files: ['**/*.md'],
rules: {
'eol-last': 'off',
'no-console': 'off',
'no-undef': 'off',
'no-unused-vars': 'warn',
'padded-blocks': 'off',
'import/unambiguous': 'off',
'import/no-unresolved': 'off',
'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'func-names': 'off',
'import/newline-after-import': 'off',
strict: 'off',
// Disable until eslint-plugin-jsdoc may fix: https://github.com/gajus/eslint-plugin-jsdoc/issues/211
indent: 'off'
}
plugins: [
'chai-friendly'
],
rules: {
'no-unused-expressions': 'off',
'chai-friendly/no-unused-expressions': ['error', {
allowShortCircuit: false,
allowTernary: false,
allowTaggedTemplates: false
}],
'jsdoc/require-jsdoc': 'off'
// 'jest/no-disabled-tests': [2],
// 'jest/no-focused-tests': [2],
// 'jest/no-identical-title': [2],
// 'jest/prefer-to-have-length': [2],
// 'jest/valid-expect': [2],
}
],
globals: {
// By some ESLint bug, config overrides not working with globals
require: 'readonly',
module: 'readonly',
exports: 'writable'
},
plugins: [
// 'jest'
],
rules: {
'no-underscore-dangle': 0,
'no-param-reassign': 0,
{
files: ['**/*.md'],
processor: 'markdown/markdown'
},
{
files: '**/*.md/*.js',
rules: {
'eol-last': 'off',
'no-console': 'off',
'no-undef': 'off',
'no-unused-vars': 'warn',
'padded-blocks': 'off',
'import/unambiguous': 'off',
'import/no-unresolved': 'off',
'node/no-missing-import': 'off',
'node/no-missing-require': 'off',
'func-names': 'off',
'import/newline-after-import': 'off',
strict: 'off',
// Disable until eslint-plugin-jsdoc may fix: https://github.com/gajus/eslint-plugin-jsdoc/issues/211
indent: 'off'
}
}
],
globals: {
// By some ESLint bug, config overrides not working with globals
require: 'readonly',
module: 'readonly',
exports: 'writable'
},
plugins: [
// 'jest'
],
rules: {
'no-underscore-dangle': 0,
'no-param-reassign': 0,

// Disable until implementing promises and Node version supporting
'promise/prefer-await-to-callbacks': 0,
'promise/prefer-await-to-then': 0,
// Disable as middleware approach requires some callbacks
'promise/prefer-await-to-callbacks': 0,

// Disable until ready to tackle
'require-jsdoc': 0,
// Disable until ready to tackle
'eslint-comments/require-description': 0,

// Disable current preferences of ash-nazg
'import/no-commonjs': 0,
'node/exports-style': 0,
// Disable current preferences of eslint-config-passport-next
'import/no-commonjs': 0,
'node/exports-style': 0,

// add back different or stricter rules from airbnb
'object-curly-spacing': ['error', 'always'],
'func-names': 'warn',
'max-len': ['error', 100, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }],
'arrow-parens': ['error', 'as-needed', {
requireForBlockBody: true,
}],
'no-empty-function': ['error', {
allow: [
'arrowFunctions',
'functions',
'methods',
]
}],
'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
'no-multi-assign': ['error'],
'no-unused-expressions': ['error', {
allowShortCircuit: false,
allowTernary: false,
allowTaggedTemplates: false,
}]
}
};
// add back different or stricter rules from airbnb
'object-curly-spacing': ['error', 'always'],
'func-names': 'warn',
'max-len': ['error', 100, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true
}],
'space-before-function-paren': ['error', {
anonymous: 'always',
named: 'never',
asyncArrow: 'always'
}],
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0 }],
'arrow-parens': ['error', 'as-needed', {
requireForBlockBody: true
}],
'no-empty-function': ['error', {
allow: [
'arrowFunctions',
'functions',
'methods'
]
}],
'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
'no-multi-assign': ['error'],
'no-unused-expressions': ['error', {
allowShortCircuit: false,
allowTernary: false,
allowTaggedTemplates: false
}],
'jsdoc/tag-lines': ['error', 'never', {
tags: {
example: { lines: 'always' }
}
}]
}
};
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
reports/
docs/
docs/jsdoc
var/


Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: "node_js"
node_js:
- "10"
- "12"
- "14"
- 12
- 14
- 16

script:
- "npm run test"
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ Ensure that the test suite passes by executing:
$ npm test
```

You can also run a single test file:

```bash
$ npm run test-one -- test/sessionmanager.test.js
```

Ensure that lint passes
```bash
$ npm run lint
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Passport-Next/Passport
# Passport-Next/Passport

Status:
[![NPM version](https://img.shields.io/npm/v/@passport-next/passport.svg)](https://www.npmjs.com/package/@passport-next/passport)
Expand Down Expand Up @@ -44,4 +44,3 @@ We support all [node versions](https://github.com/nodejs/Release) supported by t
## Contributing

Please see [CONTRIBUTING.md](https://github.com/passport-next/passport/blob/master/CONTRIBUTING.md)

32 changes: 32 additions & 0 deletions docs/jsdoc-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';

module.exports = {
recurseDepth: 10,
source: {
exclude: [
'node_modules',
'dist',
'var',
'coverage',
'test'
]
// excludePattern: ''
},
sourceType: 'module',
tags: {
allowUnknownTags: false
},
templates: {
cleverLinks: true,
monospaceLinks: false /* ,
default: {
layoutFile: 'docs/layout.tmpl'
} */
},
opts: {
recurse: true,
verbose: true,
destination: 'docs/jsdoc'
// tutorials: 'docs/tutorials'
}
};
Loading