Skip to content

Mount Composer's prisma dev logs - #369

Closed
sneub wants to merge 1 commit into
mainfrom
feat/dev-logs
Closed

sneub wants to merge 1 commit into
mainfrom
feat/dev-logs

Conversation

@sneub

@sneub sneub commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Companion to prisma/composer#378, which adds prisma dev logs to Composer's command family (composer ADR-0056).

Draft — CI will fail until composer publishes. This mounts composerCommandFamily.commands["dev logs"], which the pinned @prisma/composer-cli@0.33.0 doesn't have. Once #378 merges and publishes, the product-published bump moves the pins, and this rebases onto it. Opened now so the team can see the whole change across both repos.

What this does

  • Mounts dev logs in packages/cli/src/cli.ts beside dev url and dev stop, and adds "read its logs" to the dev group brief.
  • Adds dev logs to the e2e EXCLUSIONS with LOCAL_EMULATOR_REASON, as dev url, dev stop and emulator list already are. It only touches local emulators, so there's no management API for an e2e test to call. Composer's local-dev-detach integration test runs it against real emulators.
  • tests/composer-mount.test.ts checks the mount, the labelled and bare stdout lines, and dev --help listing it. mount-coverage.test.ts adds the path.
  • Docs:
    • docs/product/command-principles.md: dev logs is the local counterpart of service logs, with the same --tail (default 100) and --follow.
    • docs/product/output-conventions.md: log lines go to stdout, prefixed [address] without an address; --json gives output frames with data: { service, line }.
    • docs/reference/error-reference.md: adds DEV.NO_LOGS and DEV.LOGS_UNSUPPORTED, and adds dev logs to the existing DEV codes it raises.

What the user sees

$ prisma dev module.ts --detach
dev: ready
app: http://localhost:3001
logs: prisma dev logs
$ prisma dev logs app --tail 20
DEVLOGS-PROOF: hello route handler ran

Verification

I checked this locally against the composer workspace build by temporarily swapping it in for the published @prisma/composer-cli. With that build:

  • pnpm --filter @prisma/cli test passes: 1040 tests, 1 skipped.
  • pnpm typecheck and pnpm lint pass.
  • On a fresh create-prisma Next app, a route handler's console.log shows up in prisma dev logs app --tail 20.

Against the published pin, the mount tests fail as expected.

Composer's family gains `dev logs [address]` (composer ADR-0056): what
the services of the app `prisma dev` runs from this directory write to
stdout and stderr, with `--tail` (default 100) and `--follow` like
`service logs`. Mount it beside `dev url` and `dev stop`, mention it in
the `dev` group brief, and document the two new codes (DEV.NO_LOGS,
DEV.LOGS_UNSUPPORTED) in the error reference.

Like `dev url`, it touches only local emulators, so it goes in the e2e
EXCLUSIONS with LOCAL_EMULATOR_REASON; Composer's local-dev-detach
integration test runs it against real emulators.

Needs the @prisma/composer-cli release that ships `dev logs`: until the
product-published bump lands, `composerCommandFamily.commands["dev logs"]`
is undefined and the mount tests fail. Verified locally against the
composer workspace build: cli tests, typecheck and lint pass.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@sneub

sneub commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing without merging for now, alongside prisma/composer#378. We'll come back to it later. The branch feat/dev-logs is kept.

@sneub sneub closed this Oct 23, 2026
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