Skip to content

Make npm link the default install method, add --native flag#458

Merged
shannah merged 3 commits intomasterfrom
claude/investigate-6.1.4-failure-4qzGI
Apr 30, 2026
Merged

Make npm link the default install method, add --native flag#458
shannah merged 3 commits intomasterfrom
claude/investigate-6.1.4-failure-4qzGI

Conversation

@shannah
Copy link
Copy Markdown
Owner

@shannah shannah commented Apr 30, 2026

Summary

This PR inverts the default installation behavior: jdeploy install now uses npm link by default (the fastest way to test CLI commands locally), while full native installation (with native launchers, GUI integration, services, etc.) is now opt-in via the --native flag. This aligns with the typical npm package workflow where developers test locally before publishing.

Key Changes

  • Inverted install defaults: jdeploy install now defaults to npm link; use --native for full native installation

  • Updated CLI flags:

    • Kept --npm flag for backward compatibility (now documents the default behavior)
    • Added new --native flag to explicitly request full native installation
    • Updated help text to reflect new defaults
  • Updated install scripts: Modified install-and-launch.sh and dev-install-and-launch.sh to use --native flag since they require the native launcher layout for jdeploy run

  • Updated E2E tests: Modified existing local tests to use --native flag to exercise the full headless install flow

  • Added npm link E2E tests: New comprehensive end-to-end test suite (e2e-npm-link-test.sh) that validates the default npm link installation flow on Linux and macOS via GitHub Actions

  • Added NpmPackageUtils helper: New utility class to handle npm scoped package names (e.g., @scope/name) by stripping the scope prefix for use in file/directory names

  • Improved title resolution: Updated title derivation logic across multiple services to use priority: jdeploy.title > displayName > name (with npm scope stripped), ensuring scoped packages generate valid titles

Implementation Details

  • The run and debug commands continue to use native installation internally (via install(context, false, aiTools)) since they depend on the native launcher layout provided by LocalRunService
  • E2E tests properly configure npm's global prefix to a user-writable directory to avoid permission issues in CI environments
  • Test cleanup properly unlinks npm packages and optionally preserves test projects for debugging

https://claude.ai/code/session_01UTq5nFdqXBStHfYDBhYdgg

claude added 3 commits April 30, 2026 13:35
Scoped npm packages (e.g. @crowdin/cli) caused install failures because
the title defaulted to the full package name including the @scope/
prefix. The bundlers used that title as a file/directory name, so the
slash was interpreted as a path separator and the launcher write failed
with FileNotFoundException at e.g. linux-x64/@crowdin/cli.

Default the title to the unscoped name segment when no explicit title
or displayName is provided, fixing local install (jdeploy install) and
published install for scoped packages.
`jdeploy install` was switched to the new headless installer flow in
533764a (the local-install command). That broke npm-distributed CLIs
like crowdin-cli that relied on the prior behavior of `jdeploy install`
== `npm link`, since the headless flow uses the title as a file name and
breaks on scoped packages, and more fundamentally was never the right
default for those projects.

- `jdeploy install` now defaults to npm link again.
- `jdeploy install --native` opts into the headless installer (the flow
  used for local GUI testing).
- `--npm` is kept as a no-op alias for back-compat.
- `jdeploy run --install` and `jdeploy debug --install` always use the
  native install flow, since LocalRunService requires its on-disk layout.
- Updates internal scripts (install-and-launch.sh, dev-install-and-launch.sh,
  e2e-local-test.sh, e2e-local-test.ps1) to pass --native explicitly.
- Adds e2e-npm-link-test.sh + workflow exercising the default flow:
  generate picocli project, build, `jdeploy install`, verify the bin
  command is on $PATH and runnable.
…-link e2e

The first CI run failed at the '--help' step with no diagnostic output —
the output was redirected to the log file only, and any non-zero exit
was treated as failure. picocli templates can legitimately return
non-zero for --help (e.g. exit 2). Only fail on 126/127 (couldn't exec)
and always echo what the bin actually printed so we can see what
happened on future failures.
@shannah shannah merged commit 382bbd2 into master Apr 30, 2026
19 checks passed
@shannah shannah deleted the claude/investigate-6.1.4-failure-4qzGI branch April 30, 2026 15:34
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.

2 participants