Skip to content

Watch Mode Improvement for Monorepo Dependencies #1

@MarkShawn2020

Description

@MarkShawn2020

Watch Mode Improvement for Monorepo Dependencies

Problem

tsup's watch mode doesn't detect changes in workspace dependencies (specifically the shared package) in our monorepo setup. This affects development efficiency as developers need to manually rebuild when making changes to the shared package.

Current Behavior

  • Watch mode only monitors changes in the current package
  • Changes in @oh-my-commit/shared don't trigger rebuilds
  • Developers need to manually restart the build process

Expected Behavior

  • Watch mode should detect changes in workspace dependencies
  • Changes in @oh-my-commit/shared should trigger automatic rebuilds
  • Seamless development experience across the monorepo

Potential Solutions

  1. Use chokidar for file watching

    • Implement direct file system watching
    • Add chokidar as a development dependency
    • Configure to watch shared package files
  2. Integrate with turborepo's watch feature

    • Leverage native monorepo support
    • Configure workspace-aware watching
    • Integrate with existing turborepo setup
  3. Use nodemon for development

    • Simple implementation
    • Watch multiple directories
    • Handle rebuilds automatically

Technical Details

  • Current configuration in packages/cli/tsup.config.ts
  • Uses tsup's built-in watch mode
  • Workspace dependency: @oh-my-commit/shared

Related Issues

Additional Context

  • This is documented in our TODO.md
  • Current workaround is manual rebuilding
  • Affects local development workflow

Tasks

  • Research and evaluate solutions
  • Implement chosen solution
  • Add tests for watch mode
  • Update documentation
  • Add migration guide if needed

Labels

  • enhancement
  • development
  • build
  • monorepo

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions