Skip to content

Commit b26111b

Browse files
jeninhampcode-com
andcommitted
Add CI/CD pipeline, Dependabot, ESLint, Prettier, and Vitest
- Add GitHub Actions CI with lint, format, type check, test, build, and Docker jobs - Add Dependabot for npm and GitHub Actions dependency updates - Add ESLint with TypeScript and Svelte plugins - Add Prettier with Svelte plugin - Add Vitest with initial validation tests - Fix lint errors: unused var, missing resolve(), missing each key, catch any Amp-Thread-ID: https://ampcode.com/threads/T-019c90df-8957-7547-8cec-79145121657b Co-authored-by: Amp <amp@ampcode.com>
1 parent 3b0e35f commit b26111b

File tree

15 files changed

+2203
-178
lines changed

15 files changed

+2203
-178
lines changed

.github/dependabot.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /resolution-frontend
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
9+
- package-ecosystem: github-actions
10+
directory: /
11+
schedule:
12+
interval: weekly
13+
open-pull-requests-limit: 5

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
defaults:
10+
run:
11+
working-directory: resolution-frontend
12+
13+
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: npm
24+
cache-dependency-path: resolution-frontend/package-lock.json
25+
26+
- run: npm ci
27+
28+
- run: npm run lint
29+
30+
format:
31+
name: Format
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- uses: actions/setup-node@v4
37+
with:
38+
node-version: 20
39+
cache: npm
40+
cache-dependency-path: resolution-frontend/package-lock.json
41+
42+
- run: npm ci
43+
44+
- run: npm run format:check
45+
46+
check:
47+
name: Type Check
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: actions/setup-node@v4
53+
with:
54+
node-version: 20
55+
cache: npm
56+
cache-dependency-path: resolution-frontend/package-lock.json
57+
58+
- run: npm ci
59+
60+
- run: npm run check
61+
62+
test:
63+
name: Test
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- uses: actions/setup-node@v4
69+
with:
70+
node-version: 20
71+
cache: npm
72+
cache-dependency-path: resolution-frontend/package-lock.json
73+
74+
- run: npm ci
75+
76+
- run: npm run test
77+
78+
build:
79+
name: Build
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
84+
- uses: actions/setup-node@v4
85+
with:
86+
node-version: 20
87+
cache: npm
88+
cache-dependency-path: resolution-frontend/package-lock.json
89+
90+
- run: npm ci
91+
92+
- run: npm run build
93+
94+
docker:
95+
name: Docker Build
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
100+
- uses: docker/setup-buildx-action@v3
101+
102+
- uses: docker/build-push-action@v6
103+
with:
104+
context: resolution-frontend
105+
push: false
106+
cache-from: type=gha
107+
cache-to: type=gha,mode=max
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
.svelte-kit/
3+
node_modules/
4+
package-lock.json
5+
bun.lock

resolution-frontend/.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [
8+
{
9+
"files": "*.svelte",
10+
"options": {
11+
"parser": "svelte"
12+
}
13+
}
14+
]
15+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import js from '@eslint/js';
2+
import ts from 'typescript-eslint';
3+
import svelte from 'eslint-plugin-svelte';
4+
import prettier from 'eslint-config-prettier';
5+
import globals from 'globals';
6+
7+
export default ts.config(
8+
js.configs.recommended,
9+
...ts.configs.recommended,
10+
...svelte.configs.recommended,
11+
prettier,
12+
...svelte.configs.prettier,
13+
{
14+
languageOptions: {
15+
globals: {
16+
...globals.browser,
17+
...globals.node
18+
}
19+
}
20+
},
21+
{
22+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
23+
languageOptions: {
24+
parserOptions: {
25+
parser: ts.parser
26+
}
27+
}
28+
},
29+
{
30+
ignores: ['build/', '.svelte-kit/', 'node_modules/']
31+
}
32+
);

0 commit comments

Comments
 (0)