Skip to content

Derive print IPC channels from typed registry#281

Open
kilbot wants to merge 1 commit into
nextfrom
feat/ipc-channel-registry
Open

Derive print IPC channels from typed registry#281
kilbot wants to merge 1 commit into
nextfrom
feat/ipc-channel-registry

Conversation

@kilbot

@kilbot kilbot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces Stage 1 print/discovery IPC handler registrations with a typed handleIpc helper.
  • Derives the preload send/on/invoke allowlists, dynamic print event patterns, and RxDB prefix from @wcpos/printer/ipc-channels.
  • Re-exports moved IPC payload types from their existing Electron modules so existing imports keep working.
  • Updates the Electron webpack TS rule so the Option A .cts registry subpath bundles correctly from the monorepo workspace.

Design decisions (preserve through rebases)

  • Option A registry import — preload imports runtime constants from @wcpos/printer/ipc-channels; test:preload verifies ts-node can require the .cts subpath.
  • Removed rxStorage from the preload invoke allowlist — the live RxDB bridge uses dynamic rxdb-ipc-renderer-storage|<key> channels; the only rxStorage handler is in a .bak file.
  • Stage 1 only — typed helper migration is limited to print/discovery handlers; sqlite/axios/auth/send-channel handlers remain Stage 2 follow-up.

Companion PRs / cross-repo

Test plan

  • Run pnpm --filter @wcpos/app-electron ts:check from the monorepo worktree.
  • Run pnpm --filter @wcpos/app-electron lint and confirm there are 0 errors (warnings are pre-existing require/no-unused warnings).
  • Run pnpm --filter @wcpos/app-electron test.
  • Run the targeted preload/print scripts: test:preload, test:printer-discovery, test:serial-printer, test:winspool-printer.
  • In the companion monorepo PR, run pnpm --filter @wcpos/printer exec tsc --noEmit -p tsconfig.json and pnpm --filter @wcpos/printer exec vitest run.

Known blockers

  • This Electron branch depends on the companion monorepo PR for the workspace @wcpos/printer/ipc-channels subpath.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@kilbot, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 53 minutes and 37 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: wcpos/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f4394082-e1e2-4baf-a471-6689fab7e43d

📥 Commits

Reviewing files that changed from the base of the PR and between 5851f72 and b7274d5.

📒 Files selected for processing (10)
  • package.json
  • src/main/auth-handler.ts
  • src/main/ipc.ts
  • src/main/print-raw-tcp.ts
  • src/main/printer-discovery.ts
  • src/main/serial-printer.ts
  • src/main/usb-printer.ts
  • src/preload.ts
  • src/types.d.ts
  • webpack.rules.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ipc-channel-registry

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7274d5b6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"test:serial-printer": "ts-node src/main/serial-printer.test.ts"
},
"dependencies": {
"@wcpos/printer": "workspace:*",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use an installable dependency for standalone workflows

The dependency is added with the workspace protocol, but this repository’s CI/release jobs install after checking out only wcpos/electron: .github/workflows/test.yml runs pnpm install at line 43, and the publish jobs in .github/workflows/tag-and-release.yml run npm install (for example lines 88, 132, 172, and 244). I verified the CLI behavior in a temp package: npm install fails with EUNSUPPORTEDPROTOCOL: Unsupported URL Type "workspace:", while pnpm install fails with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND when the workspace package is absent. This blocks the standalone Electron test/release workflows unless they are changed to check out the monorepo or this dependency is made installable in this repo.

Useful? React with 👍 / 👎.

@kilbot kilbot changed the base branch from main to next June 17, 2026 22:01
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