Skip to content

refactor: migrate generate-verified-behaviors to Bun-native APIs; remove stale @deprecated#390

Merged
brianmhunt merged 1 commit into
mainfrom
claude/inspiring-fermat-4GW77
May 28, 2026
Merged

refactor: migrate generate-verified-behaviors to Bun-native APIs; remove stale @deprecated#390
brianmhunt merged 1 commit into
mainfrom
claude/inspiring-fermat-4GW77

Conversation

@brianmhunt
Copy link
Copy Markdown
Member

@brianmhunt brianmhunt commented May 28, 2026

Summary

  • Tooling modernization: tko.io/scripts/generate-verified-behaviors.mjs imported node:fs/promises for all file I/O. Replaced with Bun-native Bun.file().text(), .json(), .exists(), and Bun.write() per the AGENTS.md directive ("prefer native Bun APIs over node:fs"). readdir and mkdir retain named imports — no simpler Bun equivalent for directory listing with withFileTypes.
  • Dead-code cleanup: Removed incorrect @deprecated Function is unused JSDoc from clonePlainObjectDeep in packages/utils/src/object.ts. The function is actively used at packages/utils.parser/src/Parser.ts:822 and is part of the public @tko/utils API via export * from './object'.

Test plan

  • bun run build in tko.io/ — exercises the script as part of prebuild
  • bunx tsc — verify no type regressions from the JSDoc removal

https://claude.ai/code/session_01VXbxD98AzZ8pLfN2JmBeuE


Generated by Claude Code

Summary by CodeRabbit

  • Chores
    • Updated internal build and package discovery scripts for improved performance.
    • Removed deprecated documentation comments.

Review Change Stack

…APIs

Replace node:fs/promises file I/O with Bun.file().text(), .json(),
.exists(), and Bun.write() per AGENTS.md guidance. Retain named imports
for readdir/mkdir which have no simpler Bun equivalent.

https://claude.ai/code/session_01VXbxD98AzZ8pLfN2JmBeuE
Copilot AI review requested due to automatic review settings May 28, 2026 12:33
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 254a21e6-0899-4484-9f70-8b4d8c812075

📥 Commits

Reviewing files that changed from the base of the PR and between f77d244 and c6f876c.

📒 Files selected for processing (2)
  • packages/utils/src/object.ts
  • tko.io/scripts/generate-verified-behaviors.mjs
💤 Files with no reviewable changes (1)
  • packages/utils/src/object.ts

📝 Walkthrough

Walkthrough

This PR removes a deprecated JSDoc comment from utilities and migrates a build script from Node's fs/promises to Bun's filesystem APIs for file operations, without changing generated content or core logic.

Changes

Cleanup

Layer / File(s) Summary
JSDoc deprecation cleanup
packages/utils/src/object.ts
Removes an unused JSDoc comment block; no runtime logic changed.

Bun Filesystem API Migration

Layer / File(s) Summary
Import and API setup
tko.io/scripts/generate-verified-behaviors.mjs
Import statement switches from Node's fs/promises default to named readdir and mkdir imports.
File read operations
tko.io/scripts/generate-verified-behaviors.mjs
Package JSON, curated JSON, and directory scanning replace Node's fs.readFile and fs.readdir with Bun's .json(), .text(), and readdir equivalents.
Spec existence validation
tko.io/scripts/generate-verified-behaviors.mjs
Spec path validation replaces fs.access checks with Bun.file(specPath).exists().
Output file generation
tko.io/scripts/generate-verified-behaviors.mjs
Markdown output switches from fs.mkdir/fs.writeFile to mkdir and Bun.write() for per-package files and index.md.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • knockout/tko#349: Both PRs modify the behavior generation script, with this PR migrating to Bun APIs while the retrieved PR refactors markdown output helpers.

Poem

🐰 Hop! Comment cleaned, and Bun takes the lead,
Filesystem calls run at runtime speed,
From Node's old paths to Bun's swift way,
The scripts now fly without delay!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both main changes: migrating to Bun-native APIs and removing a stale @deprecated JSDoc comment, matching the PR's objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/inspiring-fermat-4GW77

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

Actionable comments posted: 0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the verified-behaviors generation script to use Bun-native file APIs where practical and removes an inaccurate deprecation marker from a public utility that is still in use.

Changes:

  • Replaced several node:fs/promises file operations with Bun.file() and Bun.write().
  • Kept readdir/mkdir imports where there is no simpler Bun-native equivalent.
  • Removed stale @deprecated Function is unused JSDoc from clonePlainObjectDeep.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tko.io/scripts/generate-verified-behaviors.mjs Migrates file reads, existence checks, and writes to Bun-native APIs while preserving directory operations.
packages/utils/src/object.ts Removes incorrect deprecation documentation from an exported, used utility function.

@brianmhunt brianmhunt merged commit 32c7e0c into main May 28, 2026
11 checks passed
@brianmhunt brianmhunt deleted the claude/inspiring-fermat-4GW77 branch May 28, 2026 13:15
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.

3 participants