Skip to content

feat(cli)!: distribute the cli through pnpm - #135

Merged
Simon Liang (AgentWings) merged 3 commits into
scalar-nextfrom
fix/macos-arm64-signature
Nov 25, 2026
Merged

Simon Liang (AgentWings) merged 3 commits into
scalar-nextfrom
fix/macos-arm64-signature

Conversation

@AgentWings

@AgentWings Simon Liang (AgentWings) commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

The installer could fail before the CLI starts because the standalone executable has an invalid macOS signature. Distribute the existing Node CLI through pnpm instead of compiling native executables.

  • Use pnpm for dependency installation, building, packing, and publishing. Attach the Node package to GitHub releases and preserve immutable published assets on retries.
  • Make the existing shell installer use pnpm, with prerequisite checks and a forwarding launcher for older updaters that request their original command path.
  • Install the same package through Homebrew with Node as a runtime dependency, and keep Homebrew in charge of upgrades. Only the configured formula’s Cellar/Caskroom directory establishes ownership; npm and pnpm installations under the shared Homebrew prefix retain their package manager.
  • Use the existing Linux build/test runner and GitHub-hosted Ubuntu for npm trusted publishing. Remove Bun, native compilation, signing, and macOS runner requirements from the workflows. pnpm 10 delegates registry publishing to the npm client, so the npm 11 bootstrap remains for trusted publishing.

Breaking installation change: new releases require Node.js 20 or newer and no longer publish native executable archives. pnpm is the primary installation method; Homebrew supplies Node. Existing direct-download users must migrate to the package installation. A new release is required; previous release assets remain unchanged.

Validation: all 115 tests pass against an installed pnpm-built package. Type checking, generated workflow checks, actionlint, ShellCheck, and the Homebrew formula's Ruby syntax check pass. Real pnpm global and Homebrew-style installs launch on Apple Silicon. The compatibility installer installs the published Node package and preserves an older command path. The pnpm registry publish dry run succeeds without publishing. Three ownership regressions fail before the fix and pass afterward, covering npm under the shared Homebrew prefix, npm under the Node formula, and pnpm global installs.

@AgentWings
Simon Liang (AgentWings) changed the base branch from main to scalar-next November 25, 2026 01:23
@AgentWings Simon Liang (AgentWings) changed the title fix(release): validate signed macos binaries feat(cli)!: distribute the cli through pnpm Nov 25, 2026
@AgentWings
Simon Liang (AgentWings) marked this pull request as ready for review November 25, 2026 02:05

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes for the installation-ownership regression described inline: npm global installations under Homebrew's prefix are now classified as Homebrew-owned, so upgrade and uninstall select the wrong manager.

Validation: build, all 112 installed-package tests, workflow generation, and a Homebrew-style package installation passed. The actual Homebrew sandbox and live publishing were not tested.

Comment thread src/cli/upgrade.ts

const path = resolvedPath(executable);
const compiled = runsCompiled(executable, binaryName);
const path = resolvedPath(compiled ? executable : process.argv[1] ?? '');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[P2] Preserve npm ownership under Homebrew's prefix

Applying the existing Homebrew path check to the Node script also matches npm global installations at /opt/homebrew/lib/node_modules/dedalus-cli/dist/esm/bin.js, a standard location when Node is installed through Homebrew. That path contains /homebrew/ but is not owned by the Dedalus formula. I reproduced dedalus upgrade printing brew update && brew upgrade dedalus without updating the npm package, and dedalus uninstall recommending brew uninstall dedalus. For Node packages, require a formula-owned Cellar/Caskroom path before classifying the installation as Homebrew; otherwise retain package-manager detection. Please add a regression case for an npm installation under /opt/homebrew/lib/node_modules alongside the new Cellar test.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@AgentWings
Simon Liang (AgentWings) merged commit 8cd8956 into scalar-next Nov 25, 2026
10 checks passed
@scalar-docs scalar-docs Bot mentioned this pull request Nov 25, 2026
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