Skip to content

Commit 54b638b

Browse files
authored
358 doc add tree diagram of folder structure to readme (#370)
* docs: 📝 add detailed project folder structure to README * chore: ♻️ enhance Renovate configuration and VS Code settings * style: 🎨 Reformat code * chore: ♻️ migrate from npm to pnpm and update CI/CD workflows * refactor: ♻️ optimize Dockerfile with multi-stage build and pnpm * chore: 🔥 remove Husky, lint-staged, and related configurations * chore: ♻️ add Vitest V8 coverage and update configuration * docs: 📝 add GitHub Actions CI badge to README
1 parent 2e61dd6 commit 54b638b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3894
-5935
lines changed

.github/actions/setup-pnpm/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "Setup pnpm"
2+
description: "Sets up pnpm with caching"
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Extract pnpm version from .tool-versions
8+
id: pnpm-version
9+
shell: bash
10+
run: |
11+
PNPM_VERSION=$(grep 'pnpm' .tool-versions | awk '{print $2}')
12+
echo "Using pnpm version: $PNPM_VERSION"
13+
echo "version=$PNPM_VERSION" >> $GITHUB_OUTPUT
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
with:
18+
version: ${{ steps.pnpm-version.outputs.version }}
19+
20+
- name: Get pnpm store directory
21+
shell: bash
22+
run: |
23+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
24+
25+
- name: Restore pnpm cache
26+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4
27+
with:
28+
path: ${{ env.STORE_PATH }}
29+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-pnpm-
32+
33+
- name: Install dependencies
34+
shell: bash
35+
run: pnpm install

.github/renovate.json

Lines changed: 47 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,49 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:recommended", "customManagers:biomeVersions"],
4-
"labels": ["chore: dependencies"],
5-
"dependencyDashboard": true,
6-
"lockFileMaintenance": {
7-
"enabled": true
8-
},
9-
"packageRules": [
10-
{
11-
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
12-
"groupName": "all non-major dependencies",
13-
"groupSlug": "all-minor-patch",
14-
"automerge": true
15-
},
16-
{
17-
"matchPackageNames": ["@biomejs/biome"],
18-
"groupName": "biome",
19-
"groupSlug": "biome",
20-
"automerge": true
21-
},
22-
{
23-
"matchPackageNames": ["@commitlint/cli", "@commitlint/config-conventional"],
24-
"groupName": "commitlint",
25-
"groupSlug": "commitlint",
26-
"automerge": true
27-
},
28-
{
29-
"packagePatterns": ["@types", "typescript"],
30-
"groupName": "typescript"
31-
},
32-
{
33-
"packagePatterns": ["@vitest", "vitest"],
34-
"groupName": "vitest"
35-
}
36-
]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended",
5+
"customManagers:biomeVersions",
6+
"customManagers:dockerfileVersions",
7+
"customManagers:githubActionsVersions",
8+
":automergeRequireAllStatusChecks",
9+
"helpers:pinGitHubActionDigests"
10+
],
11+
"timezone": "America/Chicago",
12+
"labels": ["dependencies"],
13+
"dependencyDashboard": true,
14+
"lockFileMaintenance": {
15+
"enabled": true
16+
},
17+
"packageRules": [
18+
{
19+
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
20+
"groupName": "all non-major dependencies",
21+
"groupSlug": "all-minor-patch",
22+
"automerge": true
23+
},
24+
{
25+
"matchPackageNames": ["@biomejs/biome"],
26+
"groupName": "biome",
27+
"groupSlug": "biome",
28+
"automerge": true
29+
},
30+
{
31+
"matchPackageNames": ["typescript", "/^@types//", "/^ts-/"],
32+
"groupName": "TypeScript and type definitions",
33+
"groupSlug": "typescript",
34+
"automerge": true
35+
},
36+
{
37+
"matchPackageNames": ["vitest", "@vitest/coverage-v8", "supertest", "@types/supertest"],
38+
"groupName": "Testing packages",
39+
"groupSlug": "testing",
40+
"automerge": true
41+
}
42+
],
43+
"prHourlyLimit": 4,
44+
"prConcurrentLimit": 10,
45+
"rangeStrategy": "pin",
46+
"separateMajorMinor": true,
47+
"separateMultipleMajor": true,
48+
"commitMessagePrefix": "⬆️ "
3749
}

.github/workflows/build.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
setup:
14+
name: Setup and Install
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
18+
- name: Setup pnpm
19+
uses: ./.github/actions/setup-pnpm
20+
21+
quality:
22+
name: Code Quality
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
26+
- uses: biomejs/setup-biome@c016c38f26f2c4a6eb3662679143614a254263fd # v2
27+
with:
28+
version: latest
29+
- run: biome ci .
30+
31+
build:
32+
name: Build
33+
needs: setup
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
37+
- uses: ./.github/actions/setup-pnpm
38+
- run: pnpm build
39+
40+
test:
41+
name: Test
42+
needs: setup
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
46+
- uses: ./.github/actions/setup-pnpm
47+
- run: pnpm test
48+
49+
docker:
50+
name: Docker Build and Push
51+
needs: [build, test]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
55+
with:
56+
fetch-depth: 0 # Fetch all history for proper versioning
57+
# Set up Docker Buildx
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
60+
with:
61+
driver-opts: |
62+
image=moby/buildkit:v0.12.0
63+
# Login to GitHub Container Registry
64+
- name: Login to GitHub Container Registry
65+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
66+
with:
67+
registry: ghcr.io
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
# Generate Docker metadata (tags, labels)
71+
- name: Docker metadata
72+
id: meta
73+
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5
74+
with:
75+
images: ghcr.io/${{ github.repository }}
76+
tags: |
77+
type=raw,value=${{ github.sha }}
78+
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }}
79+
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
80+
type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
81+
type=ref,event=branch
82+
type=ref,event=pr
83+
type=sha,format=long
84+
# Build and push
85+
- name: Build and push
86+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6
87+
with:
88+
context: .
89+
push: ${{ github.event_name != 'pull_request' }}
90+
tags: ${{ steps.meta.outputs.tags }}
91+
labels: ${{ steps.meta.outputs.labels }}
92+
cache-from: type=gha
93+
cache-to: type=gha,mode=max
94+
95+
summary:
96+
name: Workflow Summary
97+
needs: [setup, quality, build, test, docker]
98+
runs-on: ubuntu-latest
99+
if: always() # Run even if previous jobs fail
100+
steps:
101+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
102+
103+
- name: Generate CI Summary
104+
run: |
105+
echo "# 📋 CI Workflow Summary" >> $GITHUB_STEP_SUMMARY
106+
echo "" >> $GITHUB_STEP_SUMMARY
107+
108+
# Build info
109+
echo "" >> $GITHUB_STEP_SUMMARY
110+
echo "## 🔨 Build Information" >> $GITHUB_STEP_SUMMARY
111+
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
112+
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
113+
echo "| **Repository** | ${{ github.repository }} |" >> $GITHUB_STEP_SUMMARY
114+
echo "| **Branch/Tag** | ${{ github.ref_name }} |" >> $GITHUB_STEP_SUMMARY
115+
echo "| **Commit** | [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }}) |" >> $GITHUB_STEP_SUMMARY
116+
echo "| **Triggered by** | ${{ github.event_name }} |" >> $GITHUB_STEP_SUMMARY
117+
echo "| **Workflow Run** | [View Details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) |" >> $GITHUB_STEP_SUMMARY
118+
119+
# Docker image info (when applicable)
120+
if [[ "${{ needs.docker.result }}" == "success" && "${{ github.event_name }}" != "pull_request" ]]; then
121+
echo "" >> $GITHUB_STEP_SUMMARY
122+
echo "## 🐳 Docker Image" >> $GITHUB_STEP_SUMMARY
123+
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
124+
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY
125+
echo "| **Repository** | ghcr.io/${{ github.repository }} |" >> $GITHUB_STEP_SUMMARY
126+
echo "| **Latest Tag** | ghcr.io/${{ github.repository }}:${{ github.sha }} |" >> $GITHUB_STEP_SUMMARY
127+
echo "| **Package URL** | [View on GitHub](https://github.com/${{ github.repository }}/pkgs/container/$(echo '${{ github.repository }}' | cut -d'/' -f2)) |" >> $GITHUB_STEP_SUMMARY
128+
fi

.github/workflows/code-quality.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/docker-image.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

.husky/pre-push

Lines changed: 0 additions & 5 deletions
This file was deleted.

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
nodejs 23.9.0
2+
pnpm 10.6.2

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["esbenp.prettier-vscode", "biomejs.biome"]
3+
}

0 commit comments

Comments
 (0)