-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
92ba409
commit 9f1017b
Showing
17 changed files
with
1,350 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
{ | ||
"root": true, | ||
"extends": "@sapphire", | ||
"ignorePatterns": ["**/dist/*"], | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"@typescript-eslint/no-base-to-string": "off", | ||
"@typescript-eslint/consistent-type-imports": "error", | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/no-unsafe-member-access": "error", | ||
"@typescript-eslint/no-unsafe-argument": "error", | ||
"@typescript-eslint/no-unsafe-assignment": "error", | ||
"@typescript-eslint/no-unnecessary-condition": "error", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "error", | ||
"no-console": "error" | ||
} | ||
"extends": ["mahir/common", "mahir/node", "mahir/typescript", "mahir/prettier"], | ||
"ignorePatterns": ["**/dist/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn pretty-quick --staged && yarn lint-staged | ||
yarn lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
name: NPM Auto Deprecate | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
jobs: | ||
auto-deprecate: | ||
name: NPM Auto Deprecate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Deprecate versions | ||
run: true || yarn npm-deprecate | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
auto-deprecate: | ||
name: NPM Auto Deprecate | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Deprecate versions | ||
run: true || yarn npm-deprecate | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
name: Code Scanning | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '30 1 * * 0' | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '30 1 * * 0' | ||
|
||
jobs: | ||
CodeQL: | ||
runs-on: ubuntu-latest | ||
CodeQL: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 | ||
|
||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@807578363a7869ca324a79039e6db9c843e0e100 # tag=v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
name: Continuous Delivery | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
prNumber: | ||
description: The number of the PR that is being deployed | ||
required: true | ||
ref: | ||
description: The branch that is being deployed. Should be a branch on the given repository | ||
required: false | ||
default: main | ||
repository: | ||
description: The {owner}/{repository} that is being deployed. | ||
required: false | ||
default: imranbarbhuiya/package-template | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
prNumber: | ||
description: The number of the PR that is being deployed | ||
required: true | ||
ref: | ||
description: The branch that is being deployed. Should be a branch on the given repository | ||
required: false | ||
default: main | ||
repository: | ||
description: The {owner}/{repository} that is being deployed. | ||
required: false | ||
default: imranbarbhuiya/package-template | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Publish: | ||
name: Publish Next to npm | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'imranbarbhuiya' | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
with: | ||
fetch-depth: 0 | ||
repository: ${{ github.event.inputs.repository || 'imranbarbhuiya/package-template' }} | ||
ref: ${{ github.event.inputs.ref || 'main' }} | ||
- name: Add TypeScript problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/tsc.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.yarnpkg.com/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Bump Version & Publish | ||
run: | | ||
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events. | ||
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}') | ||
yarn config set npmAuthToken ${NODE_AUTH_TOKEN} | ||
yarn config set npmPublishRegistry "https://registry.yarnpkg.com" | ||
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)" | ||
true || yarn npm publish --tag ${TAG} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
Publish: | ||
name: Publish Next to npm | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'imranbarbhuiya' | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
with: | ||
fetch-depth: 0 | ||
repository: ${{ github.event.inputs.repository || 'imranbarbhuiya/package-template' }} | ||
ref: ${{ github.event.inputs.ref || 'main' }} | ||
- name: Add TypeScript problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/tsc.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.yarnpkg.com/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Bump Version & Publish | ||
run: | | ||
# Resolve the tag to be used. "next" for push events, "pr-{prNumber}" for dispatch events. | ||
TAG=$([[ ${{ github.event_name }} == 'push' ]] && echo 'next' || echo 'pr-${{ github.event.inputs.prNumber }}') | ||
yarn config set npmAuthToken ${NODE_AUTH_TOKEN} | ||
yarn config set npmPublishRegistry "https://registry.yarnpkg.com" | ||
yarn bump --preid "${TAG}.$(git rev-parse --verify --short HEAD)" | ||
true || yarn npm publish --tag ${TAG} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,89 @@ | ||
name: Continuous Integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
Linting: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Add problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/eslint.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Run ESLint | ||
run: yarn lint --fix=false | ||
Linting: | ||
name: Linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Add problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/eslint.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Run ESLint | ||
run: yarn lint --fix=false | ||
|
||
Testing: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Run tests | ||
run: yarn test --coverage | ||
- name: Store code coverage report | ||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3 | ||
with: | ||
name: coverage | ||
path: coverage/ | ||
Testing: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Run tests | ||
run: yarn test --coverage | ||
- name: Store code coverage report | ||
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # tag=v3 | ||
with: | ||
name: coverage | ||
path: coverage/ | ||
|
||
Building: | ||
name: Compile source code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Add problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/tsc.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Build Code | ||
run: yarn build | ||
Building: | ||
name: Compile source code | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
- name: Add problem matcher | ||
run: echo "::add-matcher::.github/problemMatchers/tsc.json" | ||
- name: Use Node.js v16 | ||
uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b # tag=v3 | ||
with: | ||
node-version: 16 | ||
cache: yarn | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install Dependencies | ||
run: yarn --immutable | ||
- name: Build Code | ||
run: yarn build | ||
|
||
Upload_Coverage_Report: | ||
name: Upload coverage report to codecov | ||
needs: [Testing] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Download Coverage report | ||
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3 | ||
with: | ||
name: coverage | ||
path: coverage/ | ||
- name: Codecov Upload | ||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # tag=v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: coverage/ | ||
fail_ci_if_error: true | ||
Upload_Coverage_Report: | ||
name: Upload coverage report to codecov | ||
needs: [Testing] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Project | ||
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # tag=v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Download Coverage report | ||
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741 # tag=v3 | ||
with: | ||
name: coverage | ||
path: coverage/ | ||
- name: Codecov Upload | ||
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # tag=v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
directory: coverage/ | ||
fail_ci_if_error: true |
Oops, something went wrong.