diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index af6b7a5..affc061 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -9,6 +9,7 @@ First off, thanks for taking the time to contribute! You are awesome! :tada::cla - [Reporting Bugs](#reporting-bugs) - [Suggesting Enhancements](#suggesting-enhancements) - [Provide Code via Pull Requests](#provide-code-via-pull-requests) + - [Coding Style](#coding-style) - [Git Commit Messages](#git-commit-messages) - [Providing Translations](#providing-translations) - [Beta-Testing](#beta-testing) @@ -17,15 +18,28 @@ First off, thanks for taking the time to contribute! You are awesome! :tada::cla ### Reporting Bugs -Before creating bug reports, please make sure there isn't already an existing issue describing your problem, for bugs are tracked as [GitHub issues](https://github.com/devmount/third-stats/issues). Simply create an issue and provide the necessary information by filling in [the bug-report template](https://github.com/devmount/third-stats/issues/new?template=bug_report.md). +Before creating bug reports, please make sure there isn't already [an existing issue](https://github.com/devmount/third-stats/issues?q=state%3Aopen%20label%3A%22bug%22) describing your problem. Create the new issue and provide the necessary information by filling in [the bug-report template](https://github.com/devmount/third-stats/issues/new?template=bug_report.md). ### Suggesting Enhancements -Enhancement suggestions are also tracked as [GitHub issues](https://github.com/devmount/third-stats/issues). Before creating enhancement suggestions, please check the existing issues as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please include as many details as possible. Fill in [the feature-request template](https://github.com/devmount/third-stats/issues/new?template=feature_request.md), including the steps that you imagine you would take if the feature you're requesting existed. +Enhancement suggestions are also tracked as [GitHub issues](https://github.com/devmount/third-stats/issues). Before creating enhancement suggestions, please check [the existing issues](https://github.com/devmount/third-stats/issues?q=state%3Aopen%20label%3A%enhancement%22) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please include as many details as possible. Fill in [the feature-request template](https://github.com/devmount/third-stats/issues/new?template=feature_request.md), including the steps that you imagine you would take if the feature you're requesting existed. ### Provide Code via Pull Requests -Simply fill in [the required template](PULL_REQUEST_TEMPLATE.md). Please do not include issue numbers in the PR title, but mention it in the PR body. +Simply fill in [the required template](PULL_REQUEST_TEMPLATE.md). Please do not include issue numbers in the PR title, but add it in the PR body, e.g. via "Closes #1234". + +All code must pass the validation workflow automatically running when pushing to a PR. All tests must pass to protect against regressions. + +Always run `pnpm lint` and `pnpm format` before pushing to this repo. + +#### Coding Style + +Please always use the existing code as a guide for new code. Linter and formatter should cover most of the code styling automatically. Other than that + +- Custom components follow the PascalCalse when importing and dash-case when adding them to the markup. +- Use destructuring where reasonable +- Favor template literals over string concatenation where applicable +- Modularize code where reasonable #### Git Commit Messages diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ebbbc17..a47f165 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,4 +1,4 @@ -# This workflow will make sure the code is linted and valid +# This workflow will make sure the code is linted, tested and valid name: Validate @@ -15,8 +15,20 @@ on: jobs: oxlint: - name: Lint JS + name: Linting runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - run: npx --yes oxlint@1.50.0 --deny-warnings # change to the latest release + - run: npx --yes oxlint@latest --deny-warnings # change to the latest release + + test: + name: Testing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Setup pnpm + uses: pnpm/action-setup@v6 + - name: Install dependencies + run: pnpm install --frozen-lockfile + - name: Run tests + run: pnpm test --coverage diff --git a/.gitignore b/.gitignore index b10e17c..8751ac6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # build files node_modules dist +coverage # scripts and config deploy.sh diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..fac63f2 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +dist +node_modules +pnpm-lock.yaml +public/_locales diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..770f4ab --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "useTabs": true, + "singleQuote": true, + "semi": true, + "trailingComma": "es5", + "printWidth": 120, + "arrowParens": "always" +} diff --git a/README.md b/README.md index 1df13b0..8711075 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ ThirdStats is a Thunderbird add-on for beautifully visualized email account stat

release last commit -CodeQL analysis +CodeQL analysis license contributions welcome

diff --git a/index.options.html b/index.options.html index eed863a..51217f8 100644 --- a/index.options.html +++ b/index.options.html @@ -5,7 +5,7 @@ ThirdStats: Options - +