Reproduction
On Node 20.20.2 with command-stream@0.17.0, any terminal capture with
artifactDirectory fails while writing the newly added GIF:
import { captureTerminal } from 'command-stream';
await captureTerminal({
file: process.execPath,
args: ['-e', 'console.log("hello")'],
artifactDirectory: '/tmp/terminal-artifacts',
});
TypeError: GIFEncoder is not a function
at renderGif (.../node_modules/command-stream/src/terminal-artifacts.mjs:429:15)
at async writeTerminalArtifacts (.../terminal-artifacts.mjs:502:15)
The dynamic import only exposes default on Node:
Object.keys(await import('gifenc')) = [ 'default' ]
Object.keys((await import('gifenc')).default) includes GIFEncoder, applyPalette, quantize
The current destructuring assumes synthetic named exports. Normalizing the
module first (const gifenc = module.default ?? module) should preserve Bun
behavior and support the package's declared Node >=20 engine.
This blocks link-assistant/agent-commander#46 from consuming 0.17.0 and
verifying default SVG+GIF replay bundles on its Node CI matrix.
Reproduction
On Node 20.20.2 with
command-stream@0.17.0, any terminal capture withartifactDirectoryfails while writing the newly added GIF:The dynamic import only exposes
defaulton Node:The current destructuring assumes synthetic named exports. Normalizing the
module first (
const gifenc = module.default ?? module) should preserve Bunbehavior and support the package's declared Node >=20 engine.
This blocks link-assistant/agent-commander#46 from consuming 0.17.0 and
verifying default SVG+GIF replay bundles on its Node CI matrix.