Skip to content

Commit 25e0b3b

Browse files
committed
chore: update configuration files, add Prettier ignore rules, and fix file formatting
1 parent 4a94b9f commit 25e0b3b

17 files changed

+155
-145
lines changed

.github/workflows/publish.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
name: Publish 📦
22
on:
3-
release:
4-
types: [published]
3+
release:
4+
types: [published]
55

66
jobs:
7-
build:
8-
runs-on: ubuntu-latest
9-
steps:
10-
- name: Checkout 🛎️
11-
uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
13-
with:
14-
node-version: 20
15-
- uses: pnpm/action-setup@v2
16-
with:
17-
version: 8
18-
- name: Install ⚡
19-
run: pnpm install
20-
- name: Lint ✨
21-
run: pnpm lint
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 20
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 8
18+
- name: Install ⚡
19+
run: pnpm install
20+
- name: Lint ✨
21+
run: pnpm lint
2222

23-
publish:
24-
needs: build
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v4
28-
- uses: actions/setup-node@v4
29-
with:
30-
node-version: 20
31-
registry-url: https://registry.npmjs.org/
32-
- uses: pnpm/action-setup@v2
33-
with:
34-
version: 8
35-
- name: Install ⚡
36-
run: pnpm install
37-
- name: Build 🔨
38-
run: pnpm prepublishOnly
39-
- name: Publish 🚀
40-
run: pnpm publish --no-git-checks
41-
env:
42-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
publish:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: 20
31+
registry-url: https://registry.npmjs.org/
32+
- uses: pnpm/action-setup@v2
33+
with:
34+
version: 8
35+
- name: Install ⚡
36+
run: pnpm install
37+
- name: Build 🔨
38+
run: pnpm prepublishOnly
39+
- name: Publish 🚀
40+
run: pnpm publish --no-git-checks
41+
env:
42+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,18 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2-
3-
# dependencies
1+
# Dependencies
42
/node_modules
5-
/.pnp
6-
.pnp.js
7-
.yarn/install-state.gz
8-
9-
/.idea/*
10-
!/.idea/runConfigurations
11-
12-
# testing
13-
/coverage
143

15-
# next.js
16-
.next/
17-
/out/
18-
19-
# production
20-
/build
4+
# Build output
215
/dist
226

23-
# misc
24-
.DS_Store
25-
*.pem
26-
27-
# debug
28-
npm-debug.log*
29-
yarn-debug.log*
30-
yarn-error.log*
31-
32-
# local env files
33-
.env*.local
34-
35-
# vercel
36-
.vercel
37-
38-
# typescript
7+
# TypeScript
398
*.tsbuildinfo
409

10+
# Environment files
4111
.env
12+
.env*.local
13+
14+
# Logs
15+
pnpm-debug.log*
4216

43-
/dev/media
17+
# OS files
18+
.DS_Store

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# TypeScript files
2+
*.ts
3+
4+
# Distribution folder
5+
dist/
6+
7+
# PNPM files
8+
pnpm-lock.yaml

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"singleQuote": true,
33
"trailingComma": "all",
4-
"printWidth": 100,
4+
"printWidth": 120,
55
"semi": false
66
}

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Built on top of `@payloadcms/plugin-cloud-storage` for easy integration with Pay
3535
## ⚡ Performance Recommendation
3636

3737
> Set `disablePayloadAccessControl: true` for best performance.
38-
>
38+
>
3939
> This lets users download files directly from Bunny's CDN servers instead of through your Payload server - making content delivery much faster.
4040
4141
## Installation
@@ -92,12 +92,12 @@ Define which collections will use Bunny Storage:
9292
collections: {
9393
// Simple
9494
media: true,
95-
95+
9696
// With options
9797
[collectionSlug]: {
9898
// Store files in a specific folder
9999
prefix: 'media',
100-
100+
101101
// Control how files are accessed
102102
disablePayloadAccessControl: true
103103
}
@@ -114,13 +114,13 @@ Connect to Bunny Storage:
114114
storage: {
115115
// Your Storage API key
116116
apiKey: string,
117-
117+
118118
// Your CDN domain (e.g., 'files.example.b-cdn.net')
119119
hostname: string,
120-
120+
121121
// Your storage zone name
122122
zoneName: string,
123-
123+
124124
// Optional: Region code ('uk', 'ny', etc.)
125125
region?: string
126126
}
@@ -136,21 +136,21 @@ Optional settings for video handling:
136136
stream: {
137137
// Your Stream API key
138138
apiKey: string,
139-
139+
140140
// Stream CDN domain
141141
hostname: string,
142-
142+
143143
// Your library ID
144144
libraryId: string, // like "123456"
145-
145+
146146
// Enable MP4 downloads (required with access control)
147147
mp4Fallback: {
148148
enabled: true
149149
},
150-
150+
151151
// Deprecated: Use mp4Fallback instead
152152
mp4FallbackQuality?: '240p' | '360p' | '480p' | '720p',
153-
153+
154154
// When to take the thumbnail (milliseconds)
155155
thumbnailTime?: number
156156
}
@@ -168,16 +168,17 @@ Enable automatic CDN cache purging for storage files (not applicable to Stream):
168168
purge: {
169169
// Enable cache purging
170170
enabled: true,
171-
171+
172172
// Your Bunny API key
173173
apiKey: string,
174-
174+
175175
// Optional: wait for purge to complete (default: false)
176176
async?: boolean
177177
}
178178
```
179179

180180
When enabled, the plugin will automatically purge the CDN cache after:
181+
181182
- File uploads
182183
- File deletions
183184

@@ -193,7 +194,7 @@ adminThumbnail: true // Default
193194
adminThumbnail: {
194195
// Add timestamp to bust cache
195196
appendTimestamp: boolean,
196-
197+
197198
// Custom image parameters (works with Bunny Optimizer)
198199
queryParams: {
199200
width: '300',
@@ -214,21 +215,23 @@ collections: {
214215
media: {
215216
// Optional folder prefix
216217
prefix: 'media',
217-
218+
218219
// How files are accessed
219220
disablePayloadAccessControl: true
220221
}
221222
}
222223
```
223224

224225
If `disablePayloadAccessControl` is not `true`:
226+
225227
- Files go through Payload's API
226228
- Your access rules work
227229
- Videos need MP4 fallback enabled
228230
- MP4s are served instead of HLS
229231
- Good for files that need protection
230232

231233
When `disablePayloadAccessControl: true`:
234+
232235
- Files go directly from Bunny CDN
233236
- No access rules
234237
- Videos use HLS streams (`playlist.m3u8`)
@@ -273,6 +276,7 @@ adminThumbnail: {
273276
This approach only affects how images are displayed in the admin panel and doesn't purge the actual CDN cache. It appends a timestamp parameter (`?t=1234567890`) to image URLs, causing Bunny CDN to treat each timestamped URL as a unique cache entry.
274277

275278
Choose the approach that best fits your needs:
279+
276280
- Use **automatic cache purging** for immediate updates everywhere
277281
- Use **timestamp-based cache busting** for a simpler setup that only affects the admin panel
278282

@@ -443,4 +447,4 @@ bunnyStorage({
443447
},
444448
},
445449
})
446-
```
450+
```

0 commit comments

Comments
 (0)