-
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
Showing
21 changed files
with
287 additions
and
88 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,2 +1,3 @@ | ||
jest.config.ts | ||
/__tests__/* | ||
vitest.config.ts | ||
release.config.cjs |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
name: Bug Report | ||
about: Report a bug | ||
labels: bug | ||
--- | ||
|
||
## Search terms | ||
|
||
<!-- Include keywords that might help others with the same problem find this issue --> | ||
|
||
## Environment | ||
|
||
- Fastify plugin version: | ||
- TypeScript version: | ||
- Node.js version: | ||
- OS: | ||
|
||
## Expected Behavior | ||
|
||
<!-- How did you expect your code to work? --> | ||
|
||
## Actual Behavior | ||
|
||
<!-- What does this plugin fail to do? --> | ||
|
||
## Steps to reproduce the bug | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
name: Question | ||
about: Ask a question | ||
labels: question | ||
--- | ||
|
||
## Search terms | ||
|
||
<!-- Include keywords that might help others with the same question find this issue --> | ||
|
||
## Question |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"LABEL": { | ||
"name": "title needs formatting", | ||
"color": "EEEEEE" | ||
}, | ||
"CHECKS": { | ||
"prefixes": ["[Bot] docs: "], | ||
"regexp": "^(feat|fix|docs|test|ci|chore)!?(\\(.*\\))?!?:.*" | ||
}, | ||
"MESSAGES": { | ||
"success": "PR title is valid", | ||
"failure": "PR title is invalid", | ||
"notice": "PR Title needs to pass regex '^(feat|fix|docs|test|ci|chore)!?(\\(.*\\))?!?:.*" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Dependabot Auto-Merge | ||
|
||
on: | ||
pull_request_target: | ||
types: [review_requested] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
packages: read | ||
|
||
jobs: | ||
Dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1.3.4 | ||
with: | ||
github-token: "${{ secrets.GH_TOKEN }}" | ||
skip-commit-verification: true | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Approve PR, if not already approved | ||
run: | | ||
gh pr checkout "$PR_URL" | ||
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; then | ||
gh pr review --approve "$PR_URL" | ||
else | ||
echo "PR Already Approved."; | ||
fi | ||
env: | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: Run unit tests | ||
run: | | ||
npm test | ||
- name: Aggregate Dependabot PRs | ||
id: aggregate_prs | ||
run: | | ||
PR_URL=$(gh pr list --json state:open author:dependabot[bot] base:$PR_BASE_BRANCH -q '.[].url' | jq -r 'join(" ")') | ||
echo "::set-output name=pr_url::$PR_URL" | ||
env: | ||
PR_BASE_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: Merge aggregated PRs | ||
if: steps.aggregate_prs.outputs.pr_url != '' | ||
run: | | ||
gh pr merge --auto --merge ${{ steps.aggregate_prs.outputs.pr_url }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "PR: Lint Title" | ||
|
||
on: | ||
pull_request_target: | ||
types: [opened, edited, reopened, synchronize] | ||
|
||
# IMPORTANT: No checkout actions, scripts, or builds should be added to this workflow. Permissions should always be used | ||
# with extreme caution. https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
permissions: {} | ||
|
||
# PR updates can happen in quick succession, leading to this | ||
# workflow being trigger a number of times. This limits it | ||
# to one run per PR. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
|
||
jobs: | ||
Validate: | ||
permissions: | ||
contents: read | ||
pull-requests: read | ||
name: Validate PR Title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: thehanimo/pr-title-checker@v1.4.2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
configuration_path: ".github/pr-title-checker-config.json" |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "PR: Unit Tests" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
Test: | ||
name: Run Unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [ 20.x, 'lts/*' ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Dependencies | ||
run: npm install --ignore-scripts | ||
- name: Run Lint Fix | ||
run: npm run lint:fix | ||
- name: Run Unit Tests | ||
run: npm run test | ||
- name: Check test results | ||
run: exit ${{ steps.Test.outputs.test_result }} | ||
id: check_test_result |
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,8 +1,13 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"typeRoots": ["../node_modules/@types", "../@types"] | ||
"rootDir": ".", | ||
}, | ||
"include": ["./**/*"] | ||
} | ||
"references": [ | ||
{ "path": "../src/" } | ||
], | ||
"include": [ | ||
"./**/*", | ||
"../src" | ||
] | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"include": [ | ||
"**/*.ts" | ||
], | ||
"exclude": [ | ||
"./vitest.config.ts", | ||
"./release.config.{cjs|js}" | ||
] | ||
} |
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,9 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.build.json", | ||
"compilerOptions": { | ||
"declaration": false, | ||
"sourceMap": false, | ||
"module": "commonjs", | ||
"outDir": "./lib/cjs" | ||
"outDir": "../lib/cjs", | ||
"declaration": false, | ||
"sourceMap": false | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.build.json", | ||
"compilerOptions": { | ||
"module": "ESNext", | ||
"outDir": "../lib/esm", | ||
"declaration": true, | ||
"sourceMap": false | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "../dist", | ||
"rootDir": ".", | ||
}, | ||
"include": ["**/*.ts"], | ||
"exclude": ["node_modules"] | ||
} |
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
Oops, something went wrong.