Skip to content

fix(flame): quiet the Node/Deno build log in CI - #428

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/flame-quiet-ci-build-log
Oct 26, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/flame-quiet-ci-build-log

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

A flame build of the template on Node/Deno, run outside a git repository (a common CI setup), buried its real output under noise. This PR removes both kinds of noise and leaves real warnings in place.

Template build, no .git Before After
MODULE_LEVEL_DIRECTIVE diagnostics (multi-line each) 19 0
git output console.error with every page path, git's stderr and a full stack trace none, dates fall back to file mtime
failing git log spawns 1 batch + 1 per page 1 batch

The "Some chunks are larger than 500 kB" warning (mermaid) is real and still shows.

1. "use client" and '' directive warnings: .docu/node/hydrate.node.ts

Rolldown warns MODULE_LEVEL_DIRECTIVE for any module-level directive other than "use strict". In the client bundle these came from two sources:

  • 14 × "use client" in flame's components (Theme, Sidebar, Toc, Menu, Context, Search, …) and in @docubook/ui-react's dist/ (dropdown, theme-controller, …).
  • 5 × '' in @mdx-js/mdx and hast-util-to-estree. These are empty string statements left by JSDoc-only /** @import */ blocks, not real directives.

Neither has any meaning in a browser-only bundle. The new clientBuildOnWarn is passed as onwarn and drops only those two cases. Other directives (for example "use server") and all other warnings pass through. The Bun build (Bun.build) never printed these warnings and is unchanged.

2. Missing git history: .docu/node/git.ts

When git log could not run, getGitLastModifiedBatch called console.error("Failed to get git last modified batch for", <every path>, err). Now:

  • Silent when git has no history to offer: exit code 128 (not a repository, a fresh git init with no commits, dubious ownership) or ENOENT (git not installed). Page dates fall back to file mtime, as before.
  • After such a batch, getGitLastModified returns null right away, so build no longer spawns one failing git log per page. The flag resets on every batch, so a later build that does have history works again.
  • Any other failure is a single warning line with no path list or stack trace: [git] last-modified lookup failed, falling back to file mtime: <first line of git's stderr>.

Verification

  • Template build outside a git repo, and again after git init with no commits, on Node: exit 0, 0 directive warnings, 0 git lines. Before the change, the same build printed 19 diagnostics plus a stack trace.
  • Bun build of flame's own docs: exit 0, no directive or git output.
  • @docubook/flame: 35 files, 676 tests passed (10 new). tsc --noEmit and oxlint report 0 errors, and prettier passes. The pre-push turbo lint, turbo build and commitlint pass.
    • git.test.ts (mocks execFile): silent for "not a git repository", "no commits yet" and ENOENT; no per-page spawn after a no-history batch; per-page lookups resume after a batch with history; an unexpected failure gives exactly one warning line.
    • hydrate-onwarn.test.ts (real Vite/Rolldown build): checks that Rolldown does raise MODULE_LEVEL_DIRECTIVE for "use client" and '', and that the filter drops it. If Rolldown changes the warning's code or wording, this test fails rather than passing silently. "use server" still surfaces, and unrelated warnings pass through unchanged.
  • Changeset: @docubook/flame patch.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Oct 26, 2026 3:20pm UTC

@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

Reviewed the full diff (standard mode). It quiets two sources of noise in the Node/Deno client build log and adds regression tests for both.

  • clientBuildOnWarn in hydrate.node.ts: Rolldown's MODULE_LEVEL_DIRECTIVE is now dropped only for "use client" and the empty '' statement, and everything else still passes through. I ran a probe against the bundled Vite: Rolldown normalizes quotes in the message, so 'use client' matches too. ANSI codes appear only in the [CODE] prefix, so the regex matches the same way with or without a TTY.
  • No-history handling in git.ts: when the batch fails with exit 128 or ENOENT, it now stays silent and sets historyUnavailable. That stops the per-page git log spawns, and the flag resets at the start of each batch. Any other failure prints one console.warn line. Both the Bun (build.ts) and Node (build.impl.ts) builds pick this up through mdx.ts. The dev server calls compileMdx without a batch, so the flag does not affect it.
  • Tests: git.test.ts and hydrate-onwarn.test.ts pass locally under Node (10/10) after building the workspace deps.
  • Changeset: @docubook/flame patch.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan gitfromwildan self-assigned this Oct 26, 2026
A template build outside a git repository, the usual CI setup, buried
its output under two kinds of noise:

- 19 multi-line Rolldown MODULE_LEVEL_DIRECTIVE diagnostics from the
  client bundle: 14 for "use client" in flame's and @docubook/ui-react's
  components, and 5 for the empty '' statements that JSDoc-only @import
  blocks leave in @mdx-js/mdx and hast-util-to-estree. Neither has any
  meaning in a browser-only bundle. hydrate.node.ts now passes
  clientBuildOnWarn as onwarn, which drops just those two. Other
  directives (for example "use server") and other warnings still show.
- A console.error from getGitLastModifiedBatch that printed every page
  path, the git stderr, and a stack trace when git had no history.
  git.ts now treats git exit 128 (not a repository, no commits yet,
  dubious ownership) and ENOENT (git not installed) as no history and
  says nothing, so dates fall back to file mtime as before. After such
  a batch, getGitLastModified returns null without starting one failing
  git log per page. Any other failure is a single warning line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gitfromwildan
gitfromwildan force-pushed the fix/flame-quiet-ci-build-log branch from 9e5e000 to 4d6032e Compare October 26, 2026 15:19
@gitfromwildan
gitfromwildan merged commit 06a0b63 into main Oct 26, 2026
27 checks passed
@gitfromwildan
gitfromwildan deleted the fix/flame-quiet-ci-build-log branch October 26, 2026 15:23
@github-actions github-actions Bot mentioned this pull request Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant