-
Notifications
You must be signed in to change notification settings - Fork 5
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
f22b78e
commit 8a0f689
Showing
61 changed files
with
5,875 additions
and
10,765 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.eslintrc.js | ||
.prettierrc.js | ||
node_modules | ||
build | ||
coverage | ||
commitlint.config.cjs | ||
lint-staged.config.cjs | ||
vitest.config.ts |
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,45 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/eslintrc", | ||
"root": true, | ||
"env": { | ||
"node": true, | ||
"es2022": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": ["./tsconfig.json"] | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
// Common | ||
"eslint:recommended", | ||
"plugin:import/recommended", | ||
// TS | ||
"plugin:import/typescript", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"plugin:@typescript-eslint/strict", | ||
// Prettier | ||
"plugin:prettier/recommended" | ||
], | ||
"settings": { | ||
"import/resolver": { | ||
"typescript": {} | ||
} | ||
}, | ||
"rules": { | ||
"import/newline-after-import": "error", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"newlines-between": "always", | ||
"alphabetize": { "order": "asc", "caseInsensitive": true } | ||
} | ||
], | ||
"object-shorthand": ["error", "always"], | ||
"no-console": "error", | ||
"func-style": ["error", "declaration"], | ||
"@typescript-eslint/explicit-function-return-type": "error", | ||
"@typescript-eslint/promise-function-async": "error" | ||
} | ||
} |
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,4 @@ | ||
NODE_ENV="development" | ||
LOGGER_LEVEL="trace" | ||
PROXY_PORT=8000 | ||
COMMIT_SHA="local" |
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 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,108 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
NODE_VERSION: 18 | ||
PNPM_VERSION: 7 | ||
IMAGE_PLATFORMS: 'linux/amd64,linux/arm64' | ||
IMAGE_REGISTRY: 'ghcr.io' | ||
IMAGE_NAME: ${{ github.repository }} | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
BRANCH_OR_TAG: ${{ github.event.pull_request.head.ref || github.ref_name }} | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.PNPM_VERSION }} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: pnpm | ||
|
||
- name: Install NPM dependencies | ||
run: make install-ci | ||
|
||
- name: Build TypeScript | ||
run: make build-ci | ||
|
||
- name: Run tests | ||
run: make test-ci | ||
|
||
- name: Format & lint | ||
run: make lint-ci | ||
|
||
docker: | ||
needs: [check] | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
if: contains(env.IMAGE_PLATFORMS, ',') | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Extract metadata for Docker | ||
id: docker-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Git metadata | ||
id: git-meta | ||
run: | | ||
echo "BRANCH_OR_TAG_NORMALIZED_WITH_SHA=$(echo ${{ env.BRANCH_OR_TAG }} | tr '/' '-'),${{ env.COMMIT_SHA }}" >> $GITHUB_OUTPUT | ||
- name: Build and push image to registry | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
provenance: false | ||
build-args: | | ||
NODE_VERSION=${{ env.NODE_VERSION }} | ||
PNPM_VERSION=${{ env.PNPM_VERSION }} | ||
COMMIT_SHA=${{ steps.git-meta.outputs.BRANCH_OR_TAG_NORMALIZED_WITH_SHA }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: ${{ env.IMAGE_PLATFORMS }} | ||
tags: ${{ steps.docker-meta.outputs.tags }} | ||
labels: ${{ steps.docker-meta.outputs.labels }} |
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,77 @@ | ||
name: Publish release to Docker Hub | ||
|
||
on: | ||
workflow_dispatch: | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
NODE_VERSION: 18 | ||
PNPM_VERSION: 7 | ||
IMAGE_PLATFORMS: 'linux/amd64,linux/arm64' | ||
IMAGE_REGISTRY: 'ghcr.io' | ||
IMAGE_NAME: ${{ github.repository }} | ||
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }} | ||
BRANCH_OR_TAG: ${{ github.event.pull_request.head.ref || github.ref_name }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
if: contains(env.IMAGE_PLATFORMS, ',') | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Extract metadata for Docker | ||
id: docker-meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
${{ env.IMAGE_NAME }} | ||
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.IMAGE_REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_HUB_USERNAME }} | ||
password: ${{ secrets.DOCKER_HUB_TOKEN }} | ||
|
||
- name: Git metadata | ||
id: git-meta | ||
run: | | ||
echo "BRANCH_OR_TAG_NORMALIZED_WITH_SHA=$(echo ${{ env.BRANCH_OR_TAG }} | tr '/' '-'),${{ env.COMMIT_SHA }}" >> $GITHUB_OUTPUT | ||
- name: Build and push image to registry | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
provenance: false | ||
build-args: | | ||
NODE_VERSION=${{ env.NODE_VERSION }} | ||
PNPM_VERSION=${{ env.PNPM_VERSION }} | ||
COMMIT_SHA=${{ steps.git-meta.outputs.BRANCH_OR_TAG_NORMALIZED_WITH_SHA }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
platforms: ${{ env.IMAGE_PLATFORMS }} | ||
tags: ${{ steps.docker-meta.outputs.tags }} | ||
labels: ${{ steps.docker-meta.outputs.labels }} |
Oops, something went wrong.