Skip to content

Update init script to include type: module and zod dependency - #19

Merged
ajmcquilkin merged 1 commit into
mainfrom
fix/init-script-module-and-zod
Nov 23, 2025
Merged

ajmcquilkin merged 1 commit into
mainfrom
fix/init-script-module-and-zod

Conversation

@pkiv

@pkiv pkiv commented Nov 23, 2025

Copy link
Copy Markdown
Contributor

Summary

Updates the bb init command to configure new projects with ES module support and include zod as a dependency.

Changes

  1. Add "type": "module" to package.json

    • New projects will now have "type": "module" set automatically
    • This enables ES module syntax (import/export) by default
    • Aligns with modern Node.js best practices
  2. Install zod as a dependency

    • Zod is now automatically installed when creating a new project
    • This is essential since most Browserbase Functions use zod for parameter validation
    • Users won't need to manually install it after initialization

Testing

The changes were made to:

  • updatePackageManager(): Now sets packageJson.type = "module"
  • installDependencies(): Now includes zod in the dependency installation

Benefits

  • New projects work out of the box with ES modules
  • No additional manual setup required for zod
  • Better developer experience for first-time users

🤖 Generated with Claude Code

The init script now properly configures new projects with:
- "type": "module" in package.json for ES module support
- zod as a dependency (commonly needed for parameter validation)

Changes:
- Added packageJson.type = "module" in updatePackageManager function
- Added zod to the list of installed dependencies in installDependencies function

This ensures new projects are set up with the correct module system and have access to zod for schema validation, which is commonly used with Browserbase Functions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
@ajmcquilkin
ajmcquilkin force-pushed the fix/init-script-module-and-zod branch from 05629e3 to 499e3a2 Compare November 23, 2025 17:55
@ajmcquilkin
ajmcquilkin self-requested a review November 23, 2025 17:55
@ajmcquilkin
ajmcquilkin merged commit 117e1a2 into main Nov 23, 2025
3 checks passed
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.

2 participants