Skip to content

Commit e83f63c

Browse files
authored
setup autoformatting (#64)
Closes #9 * ci(deps): add prettier * ci: add format script * chore: format everything * ci: add autofix
1 parent e9674e6 commit e83f63c

13 files changed

Lines changed: 6779 additions & 3637 deletions

File tree

.all-contributorsrc

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"files": [
3-
"README.md"
4-
],
2+
"files": ["README.md"],
53
"imageSize": 100,
64
"commit": false,
75
"commitType": "docs",
@@ -12,29 +10,21 @@
1210
"name": "Hannes",
1311
"avatar_url": "https://avatars.githubusercontent.com/u/127860003?v=4",
1412
"profile": "https://github.com/Han2-Ro",
15-
"contributions": [
16-
"code",
17-
"doc"
18-
]
13+
"contributions": ["code", "doc"]
1914
},
2015
{
2116
"login": "MrGreenTea",
2217
"name": "Jonas",
2318
"avatar_url": "https://avatars.githubusercontent.com/u/9407731?v=4",
2419
"profile": "http://bulik.dev",
25-
"contributions": [
26-
"infra",
27-
"code"
28-
]
20+
"contributions": ["infra", "code"]
2921
},
3022
{
3123
"login": "aprevrah",
3224
"name": "ap",
3325
"avatar_url": "https://avatars.githubusercontent.com/u/119614085?v=4",
3426
"profile": "https://github.com/aprevrah",
35-
"contributions": [
36-
"code"
37-
]
27+
"contributions": ["code"]
3828
}
3929
],
4030
"contributorsPerLine": 7,

.github/workflows/autofix.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: autofix.ci
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
autofix:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v4
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
cache: "pnpm"
21+
- name: Install Node Dependencies
22+
run: pnpm install
23+
- run: pnpm run format
24+
- uses: autofix-ci/action@551dded8c6cc8a1054039c8bc0b8b48c51dfc6ef

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,58 @@
11
# CMS for YoungVision.org - Built with Payload CMS
22

33
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
4+
45
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors-)
6+
57
<!-- ALL-CONTRIBUTORS-BADGE:END -->
68

79
This is the content management system (CMS) for [youngvision.org](https://www.youngvision.org/) ([repository](https://github.com/YoungVision-eV/website)), built using [Payload CMS](https://payloadcms.com/). It is currently used to create and manage the events displayed on our website.
810

911
## 📦 Prerequisites
1012

1113
Before you begin, ensure you have the following installed:
14+
1215
- Node.js (v16 or higher)
1316
- pnpm
1417
- docker / podman
1518

1619
## 🏃 Getting Started
1720

1821
1. **Clone the repository**
22+
1923
```bash
2024
git clone https://github.com/YoungVision-eV/website-cms.git
2125
cd website-cms
2226
```
2327

2428
1. **Install dependencies**
29+
2530
```bash
2631
pnpm install
2732
```
2833

2934
1. **Environment Setup**
35+
3036
- Copy the `.env.example` file to `.env`
3137

3238
1. **MongoDB Setup**
39+
3340
- Start MongoDB for example with Docker:
3441
```bash
3542
docker run --name mongodb-website-cms -p 27017:27017 mongo:latest
3643
```
3744
- If needed update the `DATABASE_URI` in the `.env` file
3845

3946
1. **Development**
47+
4048
- Start the development server:
4149
```bash
4250
pnpm dev
4351
```
4452
- The CMS will be available at `http://localhost:3000/admin`
4553

4654
1. **Build for Production**
55+
4756
```bash
4857
pnpm build
4958
```
@@ -67,7 +76,7 @@ Before you begin, ensure you have the following installed:
6776
- `pnpm serve` - Start production server
6877
- `pnpm generate:types` - Generate TypeScript types (which are used in the [Frontend](https://github.com/YoungVision-eV/website/blob/main/src/data/payload-types.ts))
6978

70-
## ✨ Contributors
79+
## ✨ Contributors
7180

7281
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
7382

docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ services:
1111
- PAYLOAD_SECRET
1212
- DATABASE_URI=mongodb://mongo:27017/website
1313
volumes:
14-
- 'payload-uploads:/app/dist/uploads'
14+
- "payload-uploads:/app/dist/uploads"
1515
env_file:
16-
- path: '.env'
16+
- path: ".env"
1717
required: false
1818
restart: unless-stopped
1919
healthcheck:
20-
test: 'wget --spider http://localhost:3000/api/health || exit 1'
20+
test: "wget --spider http://localhost:3000/api/health || exit 1"
2121
interval: 10s
2222
timeout: 10s
2323
retries: 5
@@ -28,18 +28,18 @@ services:
2828
command:
2929
- --storageEngine=wiredTiger
3030
volumes:
31-
- 'payload-mongo-data:/data/db'
32-
- 'payload-mongo-config:/data/configdb'
31+
- "payload-mongo-data:/data/db"
32+
- "payload-mongo-config:/data/configdb"
3333
env_file:
34-
- path: '.env'
34+
- path: ".env"
3535
required: false
3636
restart: unless-stopped
3737
healthcheck:
3838
test: echo 'db.runCommand("ping").ok' | mongo mongo:27017/website --quiet
3939
interval: 10s
4040
timeout: 10s
4141
retries: 5
42-
start_period: 40s
42+
start_period: 40s
4343
volumes:
4444
payload-uploads:
4545
payload-mongo-data:

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/",
1515
"generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
1616
"generate:graphQLSchema": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema",
17-
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
17+
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload",
18+
"format": "prettier --write ."
1819
},
1920
"dependencies": {
2021
"@payloadcms/bundler-webpack": "^1.0.0",
@@ -31,6 +32,7 @@
3132
"@types/express": "^4.17.9",
3233
"copyfiles": "^2.4.1",
3334
"nodemon": "^3.0.0",
35+
"prettier": "^3.5.1",
3436
"ts-node": "^10.0.0",
3537
"typescript": "^5.0.0"
3638
}

0 commit comments

Comments
 (0)