Skip to content

Commit b270adf

Browse files
priosshrsthclaude
andauthored
fix: remove pino-pretty (breaks serverless/Vercel) (#24)
* fix: remove pino-pretty (breaks serverless/Vercel) pino-pretty uses a worker-thread transport that fails in serverless runtimes. Drop the dev-only transport config and emit plain JSON in all environments; pipe through the pino-pretty CLI locally for pretty output. Removes pino-pretty from dependencies, peerDependencies, and peerDependenciesMeta. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * chore: bump version to 0.0.2 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3d90412 commit b270adf

4 files changed

Lines changed: 18 additions & 55 deletions

File tree

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ The payload is validated against `TokenPayloadSchema` before encryption. Throws
394394

395395
### Logger
396396

397-
A request-scoped Pino logger is available from `assembly-kit/logger`. Requires `pino` and `pino-pretty` as peer dependencies.
397+
A request-scoped Pino logger is available from `assembly-kit/logger`. Requires `pino` as a peer dependency.
398398

399399
```typescript
400400
import { createLogger, logger } from "assembly-kit/logger";
@@ -409,7 +409,7 @@ import { logger } from "assembly-kit/logger";
409409
logger.info("starting up");
410410
```
411411

412-
The logger uses `pino-pretty` in non-production environments and plain JSON in production (`NODE_ENV=production`). The default log level respects the `LOG_LEVEL` environment variable.
412+
The logger emits plain JSON in all environments (no worker-thread transport, so it works in serverless runtimes like Vercel). Pipe output through the `pino-pretty` CLI locally if you want human-readable logs. The default log level respects the `LOG_LEVEL` environment variable.
413413

414414
### App Bridge (React Hooks)
415415

‎bun.lock‎

Lines changed: 12 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "assembly-kit",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "TypeScript SDK for the Assembly platform",
55
"homepage": "https://github.com/outsidestudio/assembly-kit#readme",
66
"bugs": {
@@ -49,7 +49,6 @@
4949
"@typescript/native-preview": "7.0.0-dev.20260505.1",
5050
"bumpp": "^11.0.1",
5151
"pino": "^10.3.1",
52-
"pino-pretty": "^13.1.3",
5352
"react": "^19.2.5",
5453
"typescript": "^6.0.3",
5554
"vite-plus": "^0.1.20",
@@ -58,7 +57,6 @@
5857
"peerDependencies": {
5958
"@assembly-js/app-bridge": "^1.1.1",
6059
"pino": ">=9",
61-
"pino-pretty": ">=10",
6260
"react": ">=18",
6361
"typescript": ">=5",
6462
"zod": ">=4"
@@ -70,9 +68,6 @@
7068
"pino": {
7169
"optional": true
7270
},
73-
"pino-pretty": {
74-
"optional": true
75-
},
7671
"react": {
7772
"optional": true
7873
},

‎src/logger/index.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@ import type { Logger, LoggerOptions } from "pino";
55

66
export type { Logger, LoggerOptions } from "pino";
77

8+
// pino-pretty uses a worker-thread transport that breaks in serverless
9+
// runtimes (Vercel, Cloudflare). Emit plain JSON everywhere; pipe through
10+
// the pino-pretty CLI locally if you want pretty output.
811
const DEFAULT_OPTIONS: LoggerOptions = {
912
level: process.env.LOG_LEVEL ?? "info",
10-
transport:
11-
process.env.NODE_ENV === "production"
12-
? undefined
13-
: { options: { colorize: true }, target: "pino-pretty" },
1413
};
1514

1615
const buildLogger = (options: LoggerOptions = {}): Logger =>

0 commit comments

Comments
 (0)