Skip to content

feat(js): expose lightweight ProcessRunner entry - #194

Merged
konard merged 5 commits into
mainfrom
issue-192-3752acabac90
Aug 11, 2026
Merged

feat(js): expose lightweight ProcessRunner entry#194
konard merged 5 commits into
mainfrom
issue-192-3752acabac90

Conversation

@konard

@konard konard commented Aug 11, 2026

Copy link
Copy Markdown
Member

Fixes #192

Reproduction

Bundling the package root pulls the terminal renderer into the graph and fails on its native binaries:

bunx esbuild 'src/$.mjs' --bundle --platform=node --format=esm
No loader is configured for ".node" files:
@resvg/resvg-js-linux-x64-gnu/resvgjs.linux-x64-gnu.node

The new public entry bundles successfully:

import { ProcessRunner } from 'command-stream/process-runner';

Root cause

The only package export targeted src/$.mjs, which unconditionally imports terminal-capture.mjs. Bundlers therefore traversed the optional PTY, xterm, SVG, and GIF feature graph even when a consumer only imported ProcessRunner.

Changes

  • Add command-stream/process-runner as a supported package export.
  • Move ProcessRunner mixin initialization into that terminal-free entry and reuse it from the package root.
  • Document direct lightweight ProcessRunner construction.
  • Add a patch changeset.
  • Add a regression test that executes the exported runner and recursively verifies its module graph excludes terminal modules, @resvg/resvg-js, @xterm/headless, gifenc, and node-pty.

Verification

  • Red test before the implementation: 0 passed, 2 failed because the subpath was not exported.
  • bun test js/tests/process-runner-entry.test.mjs --timeout 10000: 2 passed.
  • Full bun run test: 797 passed, 5 skipped, 0 failed (802 total).
  • bun run lint: passed with one pre-existing prefer-template warning.
  • bun run format:check: passed.
  • bun run check:duplication: passed.
  • bun scripts/validate-changeset.mjs: passed.
  • Node 20 package-root/subpath imports and terminal artifact test: passed.
  • npm pack --dry-run --json: confirmed src/process-runner.mjs is included.
  • esbuild root reproduction: fails on two resvg .node files as reported.
  • esbuild ProcessRunner entry: succeeds (129.3 KB); its metafile contains no terminal/native dependency inputs.

Language parity

This changes only the JavaScript npm package export graph; the Rust crate has no corresponding npm subpath or eager JavaScript terminal dependency. The PR is marked parity-exempt.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #192
@konard konard self-assigned this Aug 11, 2026
@konard konard changed the title [WIP] Expose ProcessRunner without eager native terminal dependencies feat(js): expose lightweight ProcessRunner entry Aug 11, 2026
@konard konard added the parity-exempt Change is intentionally single-language; skip JS/Rust parity check label Aug 11, 2026
@konard
konard marked this pull request as ready for review August 11, 2026 10:21
@konard

konard commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented and finalized PR #194.

  • Added command-stream/process-runner, excluding PTY/rendering dependencies from its module graph.
  • Added functional and dependency-graph regression tests.
  • Documented usage and added a patch changeset.
  • Verified esbuild bundles the lightweight entry successfully.
  • Full suite: 797 passed, 5 skipped, 0 failed.
  • CI passed on Bun across Linux/macOS/Windows and Node 20/22/24.
  • PR is ready for review; branch is clean and current with main.

Final SHA: 8bad68c2b0ed6f52e40c4507eb348725f4d76838.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $10.351603

📊 Context and tokens usage:

  • 177.8K / 200K (89%) input tokens, 24.8K / 128K (19%) output tokens

Total: (177.8K + 7.5M cached) input tokens, 24.8K output tokens, $10.351603 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (2886KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit e43ba26 into main Aug 11, 2026
12 checks passed
@konard

konard commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

konard added a commit that referenced this pull request Aug 11, 2026
Resolves three conflicts against main at 0.18.2:

- js/package.json: combine the new "require"/"import" export conditions
  for "." with the "./process-runner" subpath added upstream in #194.
  The subpath needs no CommonJS wrapper - it exposes only the named
  export ProcessRunner, which require(esm) already returns directly.
- js/README.md: keep both additions - the upstream "Lightweight
  ProcessRunner entry point" subsection and the new "Module Formats
  (ESM and CommonJS)" section.
- .gitkeep: accept the upstream deletion from 100be07.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-exempt Change is intentionally single-language; skip JS/Rust parity check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose ProcessRunner without eager native terminal dependencies

1 participant