Skip to content

fix: (v1) Move log helpers to @repo/utils and finish console.* migration#1301

Merged
yamcodes merged 10 commits into
v1from
1237-v1-move-log-helpers-to-repoutils-and-finish-console-migration
Jul 11, 2026
Merged

fix: (v1) Move log helpers to @repo/utils and finish console.* migration#1301
yamcodes merged 10 commits into
v1from
1237-v1-move-log-helpers-to-repoutils-and-finish-console-migration

Conversation

@yamcodes

Copy link
Copy Markdown
Owner

Fixes #1237

Summary

  • Add shared log helpers (formatBuildError, logBuildError, logBuildWarning, logWatcherError, etc.) to @repo/utils with tests
  • Migrate @arkenv/build watcher fallbacks, @arkenv/nextjs validation output, @arkenv/nuxt module errors, and @arkenv/bun-plugin schema load failures to use the helpers via alwaysBundle
  • Route arkenv CLI paths through LoggerPort: fallback TextReporter for unhandled rejections, logger-aware safeAppend, and scanner git-not-installed messages

Test plan

  • pnpm run typecheck
  • pnpm run test
  • pnpm run fix

Made with Cursor

Move log helpers to @repo/utils and finish console.* migration across
build integrations and the arkenv CLI.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yamcodes yamcodes added the enhancement New feature or improvement label Jul 11, 2026
@changeset-bot

changeset-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a4d3bc0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added docs Adds or changes documentation, or acts as documentation in and of itself arkenv Changes to the `arkenv` npm package. tests This issue or PR is about adding, removing or changing tests @arkenv/bun-plugin Issues or Pull Requests involving the Bun plugin for ArkEnv @arkenv/nextjs Issues or Pull Requests involving the Next.js integration for ArkEnv @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv labels Jul 11, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes — centralized build/watcher log helpers in @repo/utils and migrated remaining console.* call sites across the CLI and integration packages.

  • Add shared log helpers in @repo/utils with BUILD_PREFIX/WATCHER_PREFIX and unit tests.
  • Bundle helpers via alwaysBundle in @arkenv/build, @arkenv/nextjs, @arkenv/nuxt, @arkenv/bun-plugin, and arkenv so published packages keep zero extra runtime dependencies.
  • Route CLI paths through LoggerPort by passing the CLI logger into NodeWorkspace and NodeProjectScannerAdapter, and using a TextReporter fallback logger for unhandled rejections/exceptions.
  • Remove remaining ad-hoc console.* calls in build watcher fallbacks, Next.js validation output, Nuxt module errors, Bun plugin schema load failures, and the library-import guard.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread packages/internal/utils/package.json Outdated
Comment thread packages/arkenv/src/adapters/injection.ts
yamcodes and others added 2 commits July 11, 2026 16:23
Merge origin/v1 and relocate log helpers from @arkenv/build/log to
@repo/utils on top of the core/log split and nuxt flat-layout changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pkg-pr-new

pkg-pr-new Bot commented Jul 11, 2026

Copy link
Copy Markdown

Open in StackBlitz

arkenv

npm i https://pkg.pr.new/arkenv@1301

@arkenv/build

npm i https://pkg.pr.new/@arkenv/build@1301

@arkenv/bun-plugin

npm i https://pkg.pr.new/@arkenv/bun-plugin@1301

@arkenv/core

npm i https://pkg.pr.new/@arkenv/core@1301

@arkenv/fumadocs-ui

npm i https://pkg.pr.new/@arkenv/fumadocs-ui@1301

@arkenv/nextjs

npm i https://pkg.pr.new/@arkenv/nextjs@1301

@arkenv/nuxt

npm i https://pkg.pr.new/@arkenv/nuxt@1301

@arkenv/standard

npm i https://pkg.pr.new/@arkenv/standard@1301

@arkenv/vite-plugin

npm i https://pkg.pr.new/@arkenv/vite-plugin@1301

commit: a4d3bc0

@arkenv-bot

arkenv-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (Asia/Almaty)
arkenv Ready Ready Preview, Comment Jul 12 2026, 3:07 AM (Asia/Almaty)

Fall back to logBuildError from @repo/utils so append errors remain
visible outside the LoggerPort wiring path.

Co-authored-by: Cursor <cursoragent@cursor.com>
@yamcodes

Copy link
Copy Markdown
Owner Author

Addressed the safeAppend review: when no LoggerPort is passed, failures now fall back to logBuildError from @repo/utils instead of being swallowed silently. Production CLI paths still route through LoggerPort via NodeWorkspace.

Comment thread .changeset/move-log-helpers-to-repoutils.md Outdated
yamcodes and others added 3 commits July 11, 2026 22:22
Remove changesets for log-helper consolidation and prefix formatting since
those refactors have no consumer-facing API changes vs v1.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-export log helpers from @arkenv/build (main entry and ./log subpath)
via a thin shim over @repo/utils so existing imports stay compatible.

Add logBuildErrorWithCause/logErrorWithCauseVia helpers and use them in
safeAppend, bun-plugin schema loading, and build watcher fallbacks so
failures log full stack traces instead of message-only strings.

Co-authored-by: Yam C Borodetsky <hi@yam.codes>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — minor suggestions inline.

Reviewed changes — restored the @arkenv/build/log subpath export via a @repo/utils shim and switched error logging to WithCause helpers so failures preserve full stack traces.

  • Restored @arkenv/build/log subpath by re-exporting helpers from @repo/utils through a new src/log.ts shim and adding the entry back to package.json and tsdown.config.ts.
  • Added formatErrorCause and WithCause helpers to @repo/utils and re-exported them from @arkenv/build.
  • Updated safeAppend, watcher fallbacks, and Bun plugin schema loading to route errors through logBuildErrorWithCause/logErrorWithCauseVia/logWatcherErrorWithCause.
  • Expanded test coverage for formatErrorCause, logBuildErrorWithCause, and logErrorWithCauseVia.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

Comment thread packages/internal/utils/src/utils/log-helpers.test.ts
Co-authored-by: Yam C Borodetsky <hi@yam.codes>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — added direct test coverage for logWatcherErrorWithCause in packages/internal/utils/src/utils/log-helpers.test.ts.

  • Covered logWatcherErrorWithCause with a test that verifies the watcher-prefixed header and full error stack are logged to console.error.

Pullfrog  | View workflow run | Using Kimi K2 (free via Pullfrog for OSS) | 𝕏

@yamcodes yamcodes merged commit 327993a into v1 Jul 11, 2026
20 checks passed
@yamcodes yamcodes deleted the 1237-v1-move-log-helpers-to-repoutils-and-finish-console-migration branch July 11, 2026 22:07
@yamcodes yamcodes linked an issue Jul 12, 2026 that may be closed by this pull request
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@arkenv/bun-plugin Issues or Pull Requests involving the Bun plugin for ArkEnv @arkenv/nextjs Issues or Pull Requests involving the Next.js integration for ArkEnv @arkenv/nuxt Issues or Pull Requests involving the Nuxt integration for ArkEnv arkenv Changes to the `arkenv` npm package. docs Adds or changes documentation, or acts as documentation in and of itself enhancement New feature or improvement tests This issue or PR is about adding, removing or changing tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(v1) Move log helpers to @repo/utils and finish console.* migration

2 participants