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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ The payload is validated against `TokenPayloadSchema` before encryption. Throws

### Logger

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

```typescript
import { createLogger, logger } from "assembly-kit/logger";
Expand All @@ -409,7 +409,7 @@ import { logger } from "assembly-kit/logger";
logger.info("starting up");
```

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.
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.

### App Bridge (React Hooks)

Expand Down
55 changes: 12 additions & 43 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "assembly-kit",
"version": "0.0.1",
"version": "0.0.2",
"description": "TypeScript SDK for the Assembly platform",
"homepage": "https://github.com/outsidestudio/assembly-kit#readme",
"bugs": {
Expand Down Expand Up @@ -49,7 +49,6 @@
"@typescript/native-preview": "7.0.0-dev.20260505.1",
"bumpp": "^11.0.1",
"pino": "^10.3.1",
"pino-pretty": "^13.1.3",
"react": "^19.2.5",
"typescript": "^6.0.3",
"vite-plus": "^0.1.20",
Expand All @@ -58,7 +57,6 @@
"peerDependencies": {
"@assembly-js/app-bridge": "^1.1.1",
"pino": ">=9",
"pino-pretty": ">=10",
"react": ">=18",
"typescript": ">=5",
"zod": ">=4"
Expand All @@ -70,9 +68,6 @@
"pino": {
"optional": true
},
"pino-pretty": {
"optional": true
},
"react": {
"optional": true
},
Expand Down
7 changes: 3 additions & 4 deletions src/logger/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import type { Logger, LoggerOptions } from "pino";

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

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

const buildLogger = (options: LoggerOptions = {}): Logger =>
Expand Down
Loading