Skip to content

fix(ops-harbor): fix publish config#44

Merged
masseater merged 2 commits intomasterfrom
fix/ops-harbor-publish
Apr 6, 2026
Merged

fix(ops-harbor): fix publish config#44
masseater merged 2 commits intomasterfrom
fix/ops-harbor-publish

Conversation

@masseater
Copy link
Copy Markdown
Owner

@masseater masseater commented Apr 6, 2026

Summary

  • private パッケージを @repo スコープにリネーム: @r_masseater/ops-harbor-core@repo/ops-harbor-core, @r_masseater/ops-harbor-control-plane@repo/ops-harbor-control-plane
  • ops-harbor-core を devDependencies に移動: bun build がインライン化するため runtime dependency は不要。publish 後の npm install で private パッケージを解決しようとする問題を解消
  • control-plane を dist にバンドル: dist/control-plane.js (122KB) として同梱。production CLI で自動起動するロジックを追加
  • knip 設定修正: build-only deps と .agents/ workspace ファイルを除外

Test plan

  • bun install — lockfile 再生成
  • bun run build — 全パッケージビルド成功、control-plane.js バンドル確認
  • bun run typecheck — 型エラーなし
  • bun run test — 全テストパス
  • bun knip — unused dependency/file なし
  • npm publish --dry-run — tarball に dist/control-plane.js 含む、dependencies に @repo/* なし
  • CI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • The CLI now automatically detects and spawns the control plane service when unavailable, with proper signal handling for graceful shutdown.
  • Chores

    • Updated package scopes from @r_masseater to @repo workspace-wide.
    • Adjusted build configuration and dependencies to reflect the new package names.
    • Updated documentation with revised package identifiers.

masseater and others added 2 commits April 6, 2026 10:53
…trol-plane

- Rename @r_masseater/ops-harbor-core → @repo/ops-harbor-core (private)
- Rename @r_masseater/ops-harbor-control-plane → @repo/ops-harbor-control-plane (private)
- Move ops-harbor-core from dependencies to devDependencies (bun build inlines it)
- Bundle control-plane into dist/control-plane.js via build:server
- Add localtunnel to ops-harbor dependencies (external in control-plane bundle)
- Add control-plane auto-start logic to production cli.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add localtunnel and @repo/ops-harbor-control-plane to ops-harbor ignoreDependencies (used in build:server script only)
- Exclude .agents/** from knip file scanning (workspace artifacts, not runtime code)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ed6503c1-ee8c-4b97-b070-4e405590516f

📥 Commits

Reviewing files that changed from the base of the PR and between 1ffedea and 5483c07.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (21)
  • AGENTS.md
  • apps/ops-harbor-control-plane/package.json
  • apps/ops-harbor-control-plane/src/cli.ts
  • apps/ops-harbor-control-plane/src/lib/db.ts
  • apps/ops-harbor-control-plane/src/lib/github.ts
  • apps/ops-harbor-control-plane/src/lib/sync.test.ts
  • apps/ops-harbor-control-plane/src/lib/sync.ts
  • apps/ops-harbor-control-plane/src/server.ts
  • apps/ops-harbor/package.json
  • apps/ops-harbor/src/cli.ts
  • apps/ops-harbor/src/client/pages/dashboard/ui/DashboardPage.tsx
  • apps/ops-harbor/src/dev.ts
  • apps/ops-harbor/src/lib/automation.ts
  • apps/ops-harbor/src/lib/config.ts
  • apps/ops-harbor/src/lib/control-plane-client.ts
  • apps/ops-harbor/src/lib/local-db.ts
  • apps/ops-harbor/src/lib/sync.ts
  • apps/ops-harbor/src/mcp-server.ts
  • apps/ops-harbor/src/server.ts
  • knip.json
  • packages/ops-harbor-core/package.json

📝 Walkthrough

Walkthrough

This PR renames package scopes across the monorepo from @r_masseater to @repo, updating package.json declarations and all corresponding imports. Additionally, the main CLI now spawns the control-plane service when its health endpoint is unreachable, with signal-based shutdown handling.

Changes

Cohort / File(s) Summary
Package name updates
packages/ops-harbor-core/package.json, apps/ops-harbor-control-plane/package.json
Scope renamed from @r_masseater to @repo in package identifiers; workspace dependency references updated accordingly.
Control-plane app imports
apps/ops-harbor-control-plane/src/cli.ts, apps/ops-harbor-control-plane/src/lib/db.ts, apps/ops-harbor-control-plane/src/lib/github.ts, apps/ops-harbor-control-plane/src/lib/sync.ts, apps/ops-harbor-control-plane/src/lib/sync.test.ts, apps/ops-harbor-control-plane/src/server.ts
All imports retargeted from @r_masseater/ops-harbor-core to @repo/ops-harbor-core.
Main app imports
apps/ops-harbor/src/cli.ts, apps/ops-harbor/src/dev.ts, apps/ops-harbor/src/lib/automation.ts, apps/ops-harbor/src/lib/config.ts, apps/ops-harbor/src/lib/control-plane-client.ts, apps/ops-harbor/src/lib/local-db.ts, apps/ops-harbor/src/lib/sync.ts, apps/ops-harbor/src/mcp-server.ts, apps/ops-harbor/src/server.ts, apps/ops-harbor/src/client/pages/dashboard/ui/DashboardPage.tsx
All imports retargeted from @r_masseater/ops-harbor-core to @repo/ops-harbor-core.
CLI control-plane spawning
apps/ops-harbor/src/cli.ts
Added logic to read control-plane port configuration from ~/.config/ops-harbor/control-plane.json, check /api/health endpoint reachability, and conditionally spawn control-plane.js from the distribution directory via bun if unreachable. Implemented signal handling for SIGINT/SIGTERM to cleanup spawned child process.
Build and dependency configuration
apps/ops-harbor/package.json
Updated build scripts to compile control-plane CLI; added localtunnel to dependencies; introduced workspace packages @repo/ops-harbor-core and @repo/ops-harbor-control-plane to devDependencies.
Tool configuration and documentation
knip.json, AGENTS.md
Added .agents/** to global ignore paths; extended ops-harbor dependency ignores for localtunnel and @repo/ops-harbor-control-plane; updated package and app listings in agent documentation.

Sequence Diagram

sequenceDiagram
    participant CLI as ops-harbor CLI
    participant Config as Config File<br/>(~/.config/...)
    participant Health as Control Plane<br/>Health Endpoint
    participant Spawn as Process Spawn
    participant CP as Control Plane<br/>Service
    participant Signals as Signal Handler

    CLI->>Config: Read control-plane.json
    Config-->>CLI: Port (or default 4130)
    
    CLI->>Health: GET /api/health<br/>(700ms timeout)
    
    alt Control Plane Reachable
        Health-->>CLI: 200 OK
        CLI->>Signals: Register SIGINT/SIGTERM handlers
    else Control Plane Unreachable
        Health-->>CLI: Timeout/Error
        CLI->>Spawn: Spawn control-plane.js via bun
        Spawn-->>CP: Process started
        CP-->>CLI: Service running
        CLI->>Signals: Register SIGINT/SIGTERM handlers
    end
    
    Signals->>CP: kill(15) on signal
    CP-->>Signals: Process terminated
    Signals->>CLI: Exit code 0
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 From @r_masseater we now call thee @repo,
A rename so grand, watch the imports now flow!
Control-plane spawns when health checks grow cold,
Signals and processes, gracefully told. ✨

✨ 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 fix/ops-harbor-publish

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.

@masseater masseater merged commit 6bba5ad into master Apr 6, 2026
5 of 6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Apr 6, 2026
16 tasks
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