-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: migrate from flow to typescript
Migrates the project from flowtype to typescript. Package is now an es modules package with legacy cjs support. BREAKING CHANGE: Versions of node prior to 16.15 are no longer supported.
- Loading branch information
Showing
55 changed files
with
10,989 additions
and
23,476 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
{ | ||
"extends": ["@commitlint/config-conventional"], | ||
"rules": { | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
"feat", | ||
"fix", | ||
"docs", | ||
"style", | ||
"refactor", | ||
"perf", | ||
"test", | ||
"build", | ||
"ci", | ||
"chore", | ||
"revert" | ||
] | ||
], | ||
"body-max-line-length": [0, "always", 200] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: '/' | ||
schedule: | ||
interval: weekly | ||
time: '04:00' | ||
timezone: Europe/London | ||
open-pull-requests-limit: 5 | ||
commit-message: | ||
prefix: chore | ||
include: scope | ||
- package-ecosystem: 'github-actions' | ||
directory: '/' | ||
schedule: | ||
interval: weekly | ||
commit-message: | ||
prefix: chore | ||
include: scope |
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,16 @@ | ||
name: Request Dependabot Rebase | ||
on: | ||
push: | ||
release: | ||
types: [published] | ||
jobs: | ||
auto-rebase: | ||
name: rebase dependabot PRs | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
if: github.event_name == 'release' || github.ref_name == github.event.repository.default_branch | ||
steps: | ||
- name: request rebase | ||
uses: "bbeesley/gha-auto-dependabot-rebase@main" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PA_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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Auto Merge | ||
on: | ||
pull_request: | ||
types: | ||
- labeled | ||
pull_request_review: | ||
types: | ||
- submitted | ||
jobs: | ||
automerge: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
steps: | ||
- id: automerge | ||
name: automerge | ||
uses: "pascalgn/automerge-action@v0.15.2" | ||
if: github.actor != 'dependabot[bot]' | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GH_PA_TOKEN }}" | ||
MERGE_LABELS: "dependencies,approved" | ||
MERGE_METHOD: "rebase" |
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,55 @@ | ||
name: Build & Test Common | ||
on: | ||
workflow_call: | ||
inputs: | ||
actor: | ||
required: true | ||
type: string | ||
ref: | ||
required: true | ||
type: string | ||
commit: | ||
required: true | ||
type: string | ||
is_main_branch: | ||
required: true | ||
type: boolean | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.12.1' | ||
- uses: pnpm/action-setup@v2 | ||
name: install pnpm | ||
id: pnpm-install | ||
with: | ||
version: latest | ||
run_install: false | ||
- name: get pnpm store directory | ||
id: pnpm-cache | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
name: setup pnpm cache | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
node_modules | ||
dist | ||
key: ${{ inputs.commit }}-test | ||
- name: install dependencies | ||
run: pnpm install | ||
- name: test | ||
run: npm test |
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,42 @@ | ||
name: Build & Test PR | ||
on: | ||
pull_request_target: | ||
types: [opened, synchronize, edited] | ||
concurrency: ci-${{ github.event.pull_request.head.ref}} | ||
jobs: | ||
build-and-test: | ||
uses: ./.github/workflows/build-test-common.yml | ||
with: | ||
actor: ${{ github.actor }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
commit: ${{ github.event.pull_request.head.sha }} | ||
is_main_branch: false | ||
auto-approve: | ||
runs-on: ubuntu-latest | ||
needs: build-and-test | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: approve-dependabot | ||
if: github.actor == 'dependabot[bot]' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PA_TOKEN }} | ||
run: | | ||
gh pr review --approve || true | ||
gh pr merge --auto --rebase || true | ||
label: | ||
name: label when approved | ||
needs: auto-approve | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: label approved | ||
uses: abinoda/label-when-approved-action@master | ||
env: | ||
APPROVALS: "1" | ||
GITHUB_TOKEN: ${{ secrets.GH_PA_TOKEN }} | ||
ADD_LABEL: "approved" |
Oops, something went wrong.