Skip to content

Commit

Permalink
refactor: migrate from flow to typescript
Browse files Browse the repository at this point in the history
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
bbeesley committed Jan 6, 2023
1 parent 98943fa commit 283a41c
Show file tree
Hide file tree
Showing 55 changed files with 10,989 additions and 23,476 deletions.
25 changes: 0 additions & 25 deletions .babelrc

This file was deleted.

68 changes: 0 additions & 68 deletions .circleci/config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .commitlintrc.json
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]
}
}
15 changes: 0 additions & 15 deletions .dependabot/config.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .eslintrc.json

This file was deleted.

9 changes: 0 additions & 9 deletions .flowconfig

This file was deleted.

19 changes: 19 additions & 0 deletions .github/dependabot.yml
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
16 changes: 16 additions & 0 deletions .github/workflows/auto-rebase.yml
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 }}
21 changes: 21 additions & 0 deletions .github/workflows/automerge.yml
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"
55 changes: 55 additions & 0 deletions .github/workflows/build-test-common.yml
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
42 changes: 42 additions & 0 deletions .github/workflows/build-test-on-pr.yml
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"
Loading

0 comments on commit 283a41c

Please sign in to comment.