From e83d541cda3a32436f7d3289a27963da43aae011 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Jul 2026 13:15:42 +0000 Subject: [PATCH] Version Packages --- .changeset/fix-edge-runtime-warnings.md | 10 ---------- CHANGELOG.md | 12 ++++++++++++ package.json | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 .changeset/fix-edge-runtime-warnings.md create mode 100644 CHANGELOG.md diff --git a/.changeset/fix-edge-runtime-warnings.md b/.changeset/fix-edge-runtime-warnings.md deleted file mode 100644 index 7f8a131..0000000 --- a/.changeset/fix-edge-runtime-warnings.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -"@developerehsan/nextjs-logger": patch ---- - -Fix Edge Runtime compatibility: - -- `relaySecret` derivation was eager (ran at module-import time for the `log` singleton and every `createLogger()` call), so an app using only server-side `log.info()` — never wiring up the client relay — would crash on import in production when `LOGGER_RELAY_SECRET` wasn't set. Derivation is now lazy, only triggered by code paths that actually verify a relay token. -- Replaced a `Buffer`-only base64 fallback (used when deriving the secret from `NEXTAUTH_SECRET`/`APP_SECRET`) with a `Buffer`-free encoder, for true Edge/Workers runtimes that don't polyfill `Buffer`. -- Removed all literal `process.stdout`/`process.stderr`/`process.cwd()`/`Buffer.from()` references from the compiled output (now routed through indirect accessors in `src/utils/node-globals.ts`), eliminating Next.js's "A Node.js API is used ... which is not supported in the Edge Runtime" build warning for any consumer app that imports this package from an Edge-eligible file (middleware/proxy.ts, Edge Route Handlers). Runtime behavior is unchanged — these were always guarded by `isServer()`/`isEdgeRuntime()` checks; this only stops the bundler's static scan from false-positiving on reachable-looking-but-unreachable code. -- Added a `postbuild` script (`scripts/check-edge-safety.mjs`) that fails the build if any of those literal Node API references reappear in `dist/`, plus regression tests for both the lazy-secret behavior and the Edge-safe global accessors. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c59ba9f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,12 @@ +# @developerehsan/nextjs-logger + +## 1.0.1 + +### Patch Changes + +- c3ce1b8: Fix Edge Runtime compatibility: + + - `relaySecret` derivation was eager (ran at module-import time for the `log` singleton and every `createLogger()` call), so an app using only server-side `log.info()` — never wiring up the client relay — would crash on import in production when `LOGGER_RELAY_SECRET` wasn't set. Derivation is now lazy, only triggered by code paths that actually verify a relay token. + - Replaced a `Buffer`-only base64 fallback (used when deriving the secret from `NEXTAUTH_SECRET`/`APP_SECRET`) with a `Buffer`-free encoder, for true Edge/Workers runtimes that don't polyfill `Buffer`. + - Removed all literal `process.stdout`/`process.stderr`/`process.cwd()`/`Buffer.from()` references from the compiled output (now routed through indirect accessors in `src/utils/node-globals.ts`), eliminating Next.js's "A Node.js API is used ... which is not supported in the Edge Runtime" build warning for any consumer app that imports this package from an Edge-eligible file (middleware/proxy.ts, Edge Route Handlers). Runtime behavior is unchanged — these were always guarded by `isServer()`/`isEdgeRuntime()` checks; this only stops the bundler's static scan from false-positiving on reachable-looking-but-unreachable code. + - Added a `postbuild` script (`scripts/check-edge-safety.mjs`) that fails the build if any of those literal Node API references reappear in `dist/`, plus regression tests for both the lazy-secret behavior and the Edge-safe global accessors. diff --git a/package.json b/package.json index 7b32167..622a790 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@developerehsan/nextjs-logger", - "version": "1.0.0", + "version": "1.0.1", "description": "A secure, terminal-only logging library for Next.js 16 with TanStack Pacer-backed client queueing. console.log DX, server-only output.", "license": "MIT", "repository": {