Skip to content

cli: match diff2html 3.5.0 Node runtime support - #184

Draft
rtfpessoa wants to merge 4 commits into
rodrigo/upgrade-cli-cifrom
rodrigo/upgrade-cli-runtime
Draft

rtfpessoa wants to merge 4 commits into
rodrigo/upgrade-cli-cifrom
rodrigo/upgrade-cli-runtime

Conversation

@rtfpessoa

Copy link
Copy Markdown
Owner

This is 2 of 4, stacked on the CI draft. Review this before the ESLint and tooling drafts. The installed CLI follows diff2html@3.5.0's Node >=12 requirement; the contributor matrix stays modern.

  • Load: Build a CommonJS/ES2019 CLI and remove main and types entries that pointed to files the package did not ship. The launcher remains executable, and this PR does not create a library entry point.
  • Resolve: Upgrade diff2html to 3.5.0 and use compatible pins for yargs 17.7.3, clipboardy 2.3.0, open 8.4.2, and node-fetch 2.7.0. Newer majors require a higher Node floor, ESM, or both; they are not compatible with exact 12.0.0. Keep the existing CLI options and Diffy endpoint.
  • Dispatch: Load Clipboardy only for pbcopy, so everyday commands do not require its desktop setup. In Podman, use Linux helpers even on a WSL2 host; if the bundled opener is not executable, use system xdg-open. Tests stub subprocesses, browser and clipboard helpers. HTTP transport is exercised over loopback, not against real Diffy.

Verified: 27 tests passed on each modern contributor version. The reviewed runtime tarball installed in fresh, engine-strict production consumers on exact Node 12.0.0 and 24.22.3. Smoke checks covered help/version, Git/file/stdin, HTML/JSON, shipped templates/assets, desktop dispatch stubs and error exits. npm 6 warns about the optional node-fetch encoding peer, but install and smoke pass.

Reviewer focus: the CommonJS package boundary and Podman fallbacks. The local tests do not clear live desktop integration or publication. This stacked base does not trigger the repository's master-only PR workflow. Authored delta: +371/-106; generated Yarn lockfile: +314/-194.

Linux opener selection · Dispatch tests

Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Keep preview and clipboard dispatch inside Podman on WSL2.

Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>
Choose an executable Linux opener and isolate desktop helpers in tests; clarify where pbcopy needs getconf.

Signed-off-by: Rodrigo Fernandes <rodrigo.fernandes@datadoghq.com>

This branch has not been deployed

No deployments
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