Skip to content

build(cli): compile a runnable dist so the braid binary works without tsx #79

Description

@mroops0111

Problem

The braid binary only runs through tsx inside the monorepo. The compiled-binary path is broken:

  • packages/cli/bin/braid.mjs imports dist/main.js.
  • dist/main.js imports @braidhq/server, which the workspace resolves to packages/server/src/index.ts, whose ESM specifiers point at ./app.js (compiled output that is never emitted).
  • node packages/cli/dist/main.js --help therefore fails with ERR_MODULE_NOT_FOUND: .../packages/server/src/app.js.

The only working invocation is pnpm --filter @braidhq/cli exec tsx src/main.ts <command>, so braid cannot go on PATH via pnpm link --global, and the package cannot be published as a working CLI.

Deliverable

A build step that compiles the CLI's runtime dependency graph to dist so bin/braid.mjs -> dist/main.js runs under plain node:

  • braid init, serve, dev, and workspace list all run from the compiled dist.
  • pnpm link --global (and an eventual publish) yield a working braid on PATH.

Notes

  • bin/braid.mjs already anticipates this: "Until the build pipeline emits dist/ (next phase)".
  • Standalone braid dev still has no bundled Studio dist and only runs the server; that is a separate concern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions