Skip to content

fix: create dist directory before writing client.js#77

Merged
11gather11 merged 1 commit intomainfrom
fix/generate-client-mkdir
Dec 20, 2025
Merged

fix: create dist directory before writing client.js#77
11gather11 merged 1 commit intomainfrom
fix/generate-client-mkdir

Conversation

@11gather11
Copy link
Copy Markdown
Contributor

@11gather11 11gather11 commented Dec 20, 2025

Summary

  • CIでのbun run build実行時にdistディレクトリが存在しない場合にエラーになる問題を修正

Changes

  • scripts/generate-client.ts: dist/client.jsを書き込む前にmkdirSync('dist', { recursive: true })でディレクトリを作成

Test plan

  • bun run build がクリーンな状態から正常に実行される

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed build process to ensure output directory is created before writing client files
    • Improved type accuracy for client wrapper implementation to enhance type safety

✏️ Tip: You can customize this high-level summary in your review settings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 20, 2025

⚠️ No Changeset found

Latest commit: 317292e

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 20, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Two files modified: directory creation logic added to build script to ensure dist directory exists before writing generated client, and return type signature of hcWithType function updated to properly reflect AppType-driven typing.

Changes

Cohort / File(s) Summary
Build script directory initialization
scripts/generate-client.ts
Added mkdirSync import from 'node:fs' and invoked mkdirSync('dist', { recursive: true }) to ensure the dist directory exists before writing output.
Client type signature
src/client.ts
Updated hcWithType function return type from ReturnType<typeof hc> to ReturnType<typeof hc<AppType>> to align wrapper type with AppType-driven OpenAPIHono instance.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A script ensures its home awaits,
While types now dance through proper gates,
No more lost files in the void—
Each compile path perfectly deployed! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/generate-client-mkdir

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 92d3a4b and 317292e.

📒 Files selected for processing (1)
  • scripts/generate-client.ts (2 hunks)

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.

@11gather11 11gather11 merged commit b6d82fa into main Dec 20, 2025
2 of 3 checks passed
@11gather11 11gather11 deleted the fix/generate-client-mkdir branch December 20, 2025 06:56
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