Skip to content

Commit

Permalink
Merge pull request #22 from passport-next/project-restructure
Browse files Browse the repository at this point in the history
Project restructure
  • Loading branch information
rwky authored Jun 25, 2019
2 parents 0ad9f48 + 3ce6644 commit e056ba7
Show file tree
Hide file tree
Showing 67 changed files with 4,800 additions and 1,618 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
coverage/
node_modules/
node_modules/
var/
110 changes: 97 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,108 @@
module.exports = {
env: {
// jest: true,
mocha: true,
node: true,
browser: false
},
extends: [
'airbnb-base',
'@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],
}
},
{
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'
}
}
],
globals: {
// By some ESLint bug, config overrides not working with globals
require: 'readonly',
module: 'readonly',
exports: 'writable'
},
plugins: [
// 'jest'
],
rules: {
"comma-dangle": 0,
"no-underscore-dangle": 0,
"no-param-reassign": 0,
"prefer-destructuring": 0,
// '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],
'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 until ready to tackle
'require-jsdoc': 0,

// Disable current preferences of ash-nazg
'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,
}]
}
};
};
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug Report
about: Report a bug
title: ''
labels: bug
assignees: ''
---

# READ THIS FIRST!

#### Is this a security issue?

If you discover a security issue please create an issue stating you've discovered a security
issue but don't divulge the issue, one of the maintainers will respond with an email address
you can send the details to. Once the issue has been patched the details can be made public.

<!-- Provide a brief summary of the issue in the title field above. -->

<!-- Provide a detailed description of your use case, including as much -->
<!-- detail as possible about what you are trying to accomplish and why. -->

### Expected behavior
<!-- Provide a detailed description of how you expected the software to -->
<!-- behave. -->

### Actual behavior
<!-- Provide a detailed description of how the software actually behaved, -->
<!-- including any rationale for why that behavior is incorrect. -->

### Steps to reproduce
<!-- Provide an unambiguous series of steps that can be used to reproduce -->
<!-- this issue, including any code if applicable. -->

```js
// Format code using Markdown code blocks
```

### Environment

* Operating System:
* Node version: <!-- $ node -v -->
* passport version: <!-- $ npm list @passport-next/passport -->
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Feature Request
about: Report a new feature
title: ''
labels: enhancement
assignees: ''
---

# READ THIS FIRST!

#### Is this a security issue?

If you discover a security issue please create an issue stating you've discovered a security
issue but don't divulge the issue, one of the maintainers will respond with an email address
you can send the details to. Once the issue has been patched the details can be made public.

<!-- Provide a brief summary of the feature in the title field above. -->

<!-- Provide a detailed description of your use case, including as much -->
<!-- detail as possible about what you are trying to accomplish and why. -->

### Environment

* Operating System:
* Node version: <!-- $ node -v -->
* passport version: <!-- $ npm list @passport-next/passport -->
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
** READ THIS FIRST! **
# READ THIS FIRST!

#### Is this a security patch?

Expand All @@ -19,7 +19,9 @@ you can send the details to. Once the issue has been patched the details can be
<!-- we will help. -->

- [ ] I have read the [CONTRIBUTING](https://github.com/passport-next/passport/blob/master/CONTRIBUTING.md) guidelines.
- [ ] I have updated the UNRELEASED section of the [CHANGELOG](https://github.com/passport-next/passport/blob/master/CHANGELOG.md).
- [ ] I have added myself to the contributors section of package.json if I wish to be listed
- [ ] I have added test cases which verify the correct operation of this feature or patch.
- [ ] I have added documentation pertaining to this feature or patch.
- [ ] The automated test suite (`$ make test`) executes successfully.
- [ ] The automated test suite (`$ npm test`) executes successfully.
- [ ] The automated code linting (`$ npm run-script lint`) executes successfully.
8 changes: 8 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Need help?

Please raise an [issue](https://github.com/passport-next/passport/issues) and/or ask a question on [Stackoverflow](https://stackoverflow.com) with the `passport.js` tag.

## Support policy

We support all [node versions](https://github.com/nodejs/Release) supported by the Node Foundation

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
docs/
reports/
docs/
var/



# Mac OS X
.DS_Store
Expand Down
18 changes: 0 additions & 18 deletions .jshintrc

This file was deleted.

14 changes: 8 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
CONTRIBUTING.md
Makefile
SPONSORS.md
docs/
.DS_Store
.eslintignore
.eslintrc.js
examples/
.github/
.gitlab-ci.yml
Makefile
reports/
templates
test/

.github/
.jshintrc
.travis.yml
.gitlab-ci.yml
var/
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: "node_js"
node_js:
- "8"
- "10"
- "11"
- "12"

before_install:
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
This changelog follows Semantic Versioning https://semver.org/

# 3.0.0 (UNRELEASED)

### Major

* Major lint changes, there are no functional changes but due to the massive
amount of code changes this is being marked as a major bump for caution sake
this will hopefully be the last of the changes like this for a while.

# 2.1.1 (2019-04-30)

### Patch
Expand Down Expand Up @@ -27,7 +35,7 @@ This changelog follows Semantic Versioning https://semver.org/
### Major

* Added eslint configuration, and fixed a pletora of lint errors @idurotola
* This change should have been a patch (to 1.0.2) but because of the size of the
This change should have been a patch (to 1.0.2) but because of the size of the
number of lines changed it was made a major.

# 1.0.1 (2018-08-11)
Expand Down
29 changes: 24 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Contributing

Pull Requests are welcome for any issues, if you have any questions please
Pull Requests are welcome for any issues, if you have any questions please
[raise an issue](https://github.com/passport-next/passport/issues).

If you discover a security issue please create an issue stating you've discovered a security
Expand All @@ -10,7 +10,7 @@ you can send the details to. Once the issue has been patched the details can be
If you wish to join the team please raise an issue and one of the maintainers will assess your
request.

### Tests
## Tests

The test suite is located in the `test/` directory. All new features are
expected to have corresponding test cases with complete code coverage. Patches
Expand All @@ -19,17 +19,36 @@ that increase test coverage are happily accepted.
Ensure that the test suite passes by executing:

```bash
$ make test
$ npm test
```

Ensure that lint passes
```bash
$ npm run-script lint
```

Some lint errors can be fixed with

```bash
npm run-script lintfix
```

Coverage reports can be generated and viewed by executing:

```bash
$ make test-cov
$ make view-cov
npm run-script test-cov
npm run-script view-cov
```

Templates such as README.md can be updated via

```bash
npm run-script templates
```

If you are starting a new project run

```bash
npm run-script init-new-project
```
**WARNING** This will overwrite files which are listed in the `ignoreExisting` array of `templates/variables.js`
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ view-docs:
open ./docs/index.html

view-cov:
open ./reports/coverage/lcov-report/index.html
open ./var/cov/index.html

clean: clean-docs clean-cov
-rm -r $(REPORTSDIR)
Expand Down
Loading

0 comments on commit e056ba7

Please sign in to comment.