Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .changeset/initial-release.md

This file was deleted.

33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# @cyb3rcore/sharpify

## 0.2.0

### Minor Changes

- ae55e9d: Initial release of `@cyb3rcore/sharpify` — a Fastify plugin for on-the-fly image transformation with sharp.

Commits included:

- `aa94c26` — chore: scaffold project structure
- `97181e5` — feat: add type definitions (SharpifyOptions, NormalizedParams, FormatResult)
- `2546b47` — feat: add param parsing with security caps (parseParams, normalizeParams)
- `9f183ea` — feat: add format negotiation with Accept header (negotiateFormat, getFormatOptions)
- `3d5c87f` — feat: add cache key computation and LRU manager (computeCacheKey, CacheManager)
- `d32b650` — fix: make prune tests write files in subdirectories that prune actually scans
- `8d7eaf9` — feat: add sharp pipeline builder with all operations (buildPipeline, transformAndCache)
- `472ebc5` — feat: add plugin registration with route handler (sharpifyPlugin)
- `39fd1df` — fix: address final review — propagate format negotiation, prune cache, add error tests
- `bd557b4` — ci: add CI/CD workflows with changesets release pipeline

### Features

- On-the-fly image resize, format conversion, and processing via URL query params (`?w=400&fmt=webp&q=80`)
- Accept-header content negotiation (AVIF > WebP > JPEG > PNG)
- 30+ sharp operations: resize, crop, blur, sharpen, rotate, greyscale, modulate, tint, trim, flip, flop, normalize, negate, gamma, threshold, median, linear, pad, strip-alpha
- Disk cache with SHA-256 key, two-char subdirectory layout, LRU eviction
- Atomic cache writes (`.tmp` + `renameSync`)
- Full `@fastify/static` integration via `reply.sendFile()`
- DoS protections: dimension caps (max 4096), processing timeout (30s), concurrency semaphore, without-enlargement guard, path traversal prevention
- Error fallback: processing failures serve the original image
- Per-derivative Cache-Control via `setHeaders`
- Format-specific options: progressive JPEG, mozjpeg, lossless WebP/AVIF, indexed PNG, chroma subsampling, encoding effort
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cyb3rcore/sharpify",
"version": "0.1.0",
"version": "0.2.0",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand All @@ -10,7 +10,9 @@
"import": "./dist/index.js"
}
},
"files": ["dist"],
"files": [
"dist"
],
"scripts": {
"build": "tsc",
"test": "vitest run",
Expand Down
Loading