Skip to content

Commit e73b1a0

Browse files
authored
Merge pull request #31 from pawcoding/next
General repository improvements
2 parents cc91cef + 1481c8a commit e73b1a0

Some content is hidden

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

55 files changed

+5429
-747
lines changed

.github/workflows/release.yaml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,40 @@ jobs:
3333

3434
# Install dependencies
3535
- name: 📦 Install dependencies
36-
run: |
37-
npm ci
36+
run: npm ci
3837

3938
# Lint code
4039
- name: 🧹 Lint code
4140
run: npm run lint
4241

42+
# Check format
43+
- name: 🧹 Check format
44+
run: npm run format:check
45+
46+
# Run tests
47+
- name: 🧪 Run unit tests
48+
run: npm run test:unit
49+
50+
# Setup PocketBase
51+
- name: 🗄️ Download and setup PocketBase
52+
run: npm run test:e2e:setup
53+
54+
# Start PocketBase
55+
- name: 🚀 Start PocketBase
56+
run: ./.pocketbase/pocketbase serve &
57+
58+
# Wait for PocketBase to be ready
59+
- name: ⏳ Wait for PocketBase
60+
run: |
61+
until curl -s --fail http://localhost:8090/api/health; do
62+
echo 'Waiting for PocketBase...'
63+
sleep 5
64+
done
65+
66+
# Run tests
67+
- name: 🧪 Run e2e tests
68+
run: npm run test:e2e
69+
4370
# Create release
4471
- name: 🚀 Create release
4572
id: release

.github/workflows/test.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: 🧪 Test code
2+
# Run this on every push except master and next
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
- "!master"
8+
- "!next"
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
# Use the latest version of Ubuntu
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
issues: write
19+
pull-requests: write
20+
id-token: write
21+
steps:
22+
# Checkout repository
23+
- name: 📥 Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
28+
# Setup Node
29+
- name: 📦 Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: "lts/*"
33+
cache: "npm"
34+
35+
# Install dependencies
36+
- name: 📦 Install dependencies
37+
run: npm ci
38+
39+
# Lint code
40+
- name: 🧹 Lint code
41+
run: npm run lint
42+
43+
# Check format
44+
- name: 🧹 Check format
45+
run: npm run format:check
46+
47+
# Run tests
48+
- name: 🧪 Run unit tests
49+
run: npm run test:unit
50+
51+
# Setup PocketBase
52+
- name: 🗄️ Download and setup PocketBase
53+
run: npm run test:e2e:setup
54+
55+
# Start PocketBase
56+
- name: 🚀 Start PocketBase
57+
run: ./.pocketbase/pocketbase serve &
58+
59+
# Wait for PocketBase to be ready
60+
- name: ⏳ Wait for PocketBase
61+
run: |
62+
until curl -s --fail http://localhost:8090/api/health; do
63+
echo 'Waiting for PocketBase...'
64+
sleep 5
65+
done
66+
67+
# Run tests
68+
- name: 🧪 Run e2e tests
69+
run: npm run test:e2e

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# build output
22
dist/
3+
.eslintcache
4+
coverage/
35
# generated types
46
.astro/
57

@@ -12,7 +14,6 @@ yarn-debug.log*
1214
yarn-error.log*
1315
pnpm-debug.log*
1416

15-
1617
# environment variables
1718
.env
1819
.env.production
@@ -22,3 +23,6 @@ pnpm-debug.log*
2223

2324
# jetbrains setting folder
2425
.idea/
26+
27+
# PocketBase folder
28+
.pocketbase/

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
npm run lint
1+
npx lint-staged

.prettierignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# build output
2+
dist/
3+
.eslintcache
4+
CHANGELOG.md
5+
# generated types
6+
.astro/
7+
8+
# dependencies
9+
node_modules/
10+
11+
# logs
12+
npm-debug.log*
13+
yarn-debug.log*
14+
yarn-error.log*
15+
pnpm-debug.log*
16+
17+
18+
# environment variables
19+
.env
20+
.env.production
21+
22+
# macOS-specific files
23+
.DS_Store
24+
25+
# jetbrains setting folder
26+
.idea/
27+
28+
# misc
29+
.husky/
30+
.prettierignore

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"trailingComma": "none",
3+
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
4+
}

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default { extends: ["@commitlint/config-conventional"] };

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import eslint from "@eslint/js";
22
import stylistic from "@stylistic/eslint-plugin";
3+
import prettier from "eslint-config-prettier";
34
import globals from "globals";
45
import tseslint from "typescript-eslint";
56

67
const config = tseslint.config({
78
files: ["**/*.{js,mjs,cjs,ts}"],
9+
ignores: [".pocketbase/**/*"],
810
languageOptions: {
911
globals: { ...globals.browser, ...globals.node }
1012
},
1113
extends: [
1214
eslint.configs.recommended,
15+
prettier,
1316
...tseslint.configs.recommended,
1417
...tseslint.configs.stylistic
1518
],

index.ts

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

0 commit comments

Comments
 (0)