diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..7509fe9 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,132 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +contact@divlo.fr. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series +of actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or +permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within +the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.0, available at +[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][mozilla coc]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][faq]. Translations are available +at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..0372c2c --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,54 @@ +# πŸ’‘ Contributing + +Thanks a lot for your interest in contributing to **Thream/socketio-jwt**! πŸŽ‰ + +## Code of Conduct + +**Thream** has adopted the [Contributor Covenant](https://www.contributor-covenant.org/) as its Code of Conduct, and we expect project participants to adhere to it. Please read [the full text](./CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated. + +## Open Development + +All work on **Thream** happens directly on [GitHub](https://github.com/Thream). Both core team members and external contributors send pull requests which go through the same review process. + +## Types of contributions + +- Reporting a bug. +- Suggest a new feature idea. +- Correct spelling errors, improvements or additions to documentation files (README, CONTRIBUTING...). +- Improve structure/format/performance/refactor/tests of the code. + +## Pull Requests + +- **Please first discuss** the change you wish to make via [issue](https://github.com/Thream/socketio-jwt/issues) before making a change. It might avoid a waste of your time. + +- Ensure your code respect [Typescript Standard Style](https://www.npmjs.com/package/ts-standard). + +- Make sure your **code passes the tests**. + +If you're adding new features to **Thream/socketio-jwt**, please include tests. + +## Commits + +The commit message guidelines respect [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) and [Semantic Versioning](https://semver.org/) for releases. + +### Types + +Types define which kind of changes you made to the project. + +| Types | Description | +| -------- | ------------------------------------------------------------------------------------------------------------ | +| feat | A new feature. | +| fix | A bug fix. | +| docs | Documentation only changes. | +| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc). | +| refactor | A code change that neither fixes a bug nor adds a feature. | +| perf | A code change that improves performance. | +| test | Adding missing tests or correcting existing tests. | +| build | Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm). | +| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs). | +| chore | Other changes that don't modify src or test files. | +| revert | Reverts a previous commit. | + +### Scopes + +Scopes define what part of the code changed. diff --git a/.github/ISSUE_TEMPLATE/BUG.md b/.github/ISSUE_TEMPLATE/BUG.md new file mode 100644 index 0000000..5e562d9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/BUG.md @@ -0,0 +1,19 @@ +--- +name: 'πŸ› Bug Report' +about: 'Report an unexpected problem or unintended behavior.' +labels: 'bug' +--- + + + +## Steps To Reproduce + +1. Step 1 +2. Step 2 + +## The current behavior + +## The expected behavior diff --git a/.github/ISSUE_TEMPLATE/DOCUMENTATION.md b/.github/ISSUE_TEMPLATE/DOCUMENTATION.md new file mode 100644 index 0000000..4405fb7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/DOCUMENTATION.md @@ -0,0 +1,20 @@ +--- +name: 'πŸ“œ Documentation' +about: 'Correct spelling errors, improvements or additions to documentation files (README, CONTRIBUTING...).' +labels: 'documentation' +--- + + + +### Documentation : + +- [ ] Is Missing +- [ ] Is Confusing +- [ ] Has Typo errors +- [ ] Not Sure? + +### Proposal diff --git a/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md new file mode 100644 index 0000000..e41c331 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md @@ -0,0 +1,19 @@ +--- +name: '✨ Feature Request' +about: 'Suggest a new feature idea.' +labels: 'feature request' +--- + + + +### Description + + + +### Describe the solution you'd like + + + +### Describe alternatives you've considered + + diff --git a/.github/ISSUE_TEMPLATE/IMPROVEMENT.md b/.github/ISSUE_TEMPLATE/IMPROVEMENT.md new file mode 100644 index 0000000..cec5b46 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/IMPROVEMENT.md @@ -0,0 +1,21 @@ +--- +name: 'πŸ”§ Improvement' +about: 'Improve structure/format/performance/refactor/tests of the code.' +labels: 'improvement' +--- + + + +### Type of Improvement : + +- [ ] Files and Folders Structure +- [ ] Performance +- [ ] Refactoring code +- [ ] Tests +- [ ] Not Sure? + +### Proposal diff --git a/.github/ISSUE_TEMPLATE/QUESTION.md b/.github/ISSUE_TEMPLATE/QUESTION.md new file mode 100644 index 0000000..a0945ea --- /dev/null +++ b/.github/ISSUE_TEMPLATE/QUESTION.md @@ -0,0 +1,7 @@ +--- +name: 'πŸ™‹ Question' +about: 'Further information is requested.' +labels: 'question' +--- + +### Question diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..b29d07e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + +### What type of change does this PR introduce? + +- [ ] Bugfix +- [ ] Feature +- [ ] Refactor +- [ ] Documentation +- [ ] Not Sure? + +### Does this PR introduce breaking changes? + +- [ ] Yes +- [ ] No + +### List any relevant issue numbers: + +### Description: diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..eba656e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# For more information see: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' + + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'daily' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..8fab969 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,41 @@ +# For more information see: https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code + +name: 'CodeQL' + +on: + push: + branches: [master, develop] + pull_request_review: + branches: [master, develop] + types: [submitted] + +jobs: + analyze: + if: ${{ (github.event_name == 'push') || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'OWNER') && !github.event.pull_request.draft && github.event.pull_request.state == 'open') }} + name: 'Analyze' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ['javascript'] + + steps: + - name: 'Checkout repository' + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - run: git checkout HEAD^2 + if: ${{ github.event_name == 'pull_request' }} + + - name: 'Initialize CodeQL' + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: 'Autobuild' + uses: github/codeql-action/autobuild@v1 + + - name: 'Perform CodeQL Analysis' + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml new file mode 100644 index 0000000..4d92cc6 --- /dev/null +++ b/.github/workflows/commitlint.yml @@ -0,0 +1,20 @@ +# For more information see: https://github.com/marketplace/actions/commit-linter + +name: 'Lint Commit Messages' + +on: + push: + branches: [master, develop] + pull_request_review: + branches: [master, develop] + types: [submitted] + +jobs: + commitlint: + if: ${{ (github.event_name == 'push') || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'OWNER') && !github.event.pull_request.draft && github.event.pull_request.state == 'open') }} + runs-on: ubuntu-latest + steps: + - uses: 'actions/checkout@v2' + with: + fetch-depth: 0 + - uses: 'wagoid/commitlint-github-action@v2' diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..6a9d5fa --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,38 @@ +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: 'Node.js CI' + +on: + push: + branches: [master, develop] + pull_request_review: + branches: [master, develop] + types: [submitted] + +jobs: + ci_app: + if: ${{ (github.event_name == 'push') || (github.event_name == 'pull_request_review' && github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'OWNER') && !github.event.pull_request.draft && github.event.pull_request.state == 'open') }} + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [14.x] + steps: + - uses: 'actions/checkout@v2' + + - name: Use Node.js ${{ matrix.node-version }} + uses: 'actions/setup-node@v2.1.4' + with: + node-version: ${{ matrix.node-version }} + + - name: 'Cache dependencies' + uses: 'actions/cache@v2' + with: + path: | + **/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package.json') }} + + - name: 'Install dependencies' + run: 'npm install' + + - name: 'Run the tests' + run: 'npm test' diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 601edb9..0000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,35 +0,0 @@ -# Issue Report - -If you are reporting a bug, please fill the sections below (if they are applicable), otherwise feel free to delete those that don't apply. Thank you! πŸ™πŸΌ - -### Description - -What are you reporting? - -### Expected behaviour - -Tell us what you think should happen. - -### Actual behaviour - -Tell us what actually happens. - -### Steps to reproduce the problem - -Tell us what we should do to reproduce the issue. - -### Language / Framework Versions - -1. **Language used:** -2. **Framework used:** - -### Testing environment - -1. **Operating system:** -2. **Browser version:** - -### Screenshots - -Feel free to insert here any screenshots that you consider helpful in solving your issue. - -**Filling this, you're helping yourself and repo maintainers in solving your issues quicker! Teamwork makes the dreamwork πŸ€œπŸΌπŸ€›πŸ»** diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 06b9a63..0000000 --- a/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,32 +0,0 @@ -# Pull Request Report - -Please include a summary of the change you made with relevant motivation and context why such change has been made. Filling sections below will allow us to get your changes reviewed and merged easier. If you feel like certain section is not applicable, feel free to delete it. Thanks for co-operation! πŸ™πŸΌ - -### Description - -Tell us what you changed, why you did it and what additional value it will bring. - -### Type of change - -- [ ] Bug fix (fix to an issue) -- [ ] New feature (changes to functionality) -- [ ] Big change (fix or feature that would cause existing functionality to work as expected) - -### Testing - -Please describe the tests that you ran to verify your changes. Provide any instructions that will allow us to reproduce it. Please also list any relevant details for your test configuration. - -**Test Configuration** - -- Framework version: -- Language version: -- Browser version: - -### Additional info - -- [ ] I have performed a self-review of my own code -- [ ] I have commented my code, particularly in hard-to-understand areas -- [ ] I have made corresponding changes to the documentation -- [ ] My changes generate no new warnings and errors -- [ ] I have added tests that prove my fix is effective or that my feature works -- [ ] New and existing unit tests pass locally with my changes