Skip to content

fix(cli): move pkg dependency to devDependencies#2342

Merged
dividedmind merged 2 commits into
mainfrom
fix/pkg-dev-dependency
Nov 25, 2025
Merged

fix(cli): move pkg dependency to devDependencies#2342
dividedmind merged 2 commits into
mainfrom
fix/pkg-dev-dependency

Conversation

@dividedmind

@dividedmind dividedmind commented Nov 24, 2025

Copy link
Copy Markdown
Collaborator

The pkg dependency is a build tool used to create native binaries for the CLI. It is not a runtime dependency and thus belongs in devDependencies to accurately reflect its role in the project and resolve potential dependency conflicts during installation.

This PR also includes a workaround for an error running CLI tests in node 25 due to nodejs/node#60303

The `pkg` dependency is a build tool used to create native binaries
for the CLI, as confirmed by its usage in `bin/build-native`. It is
not a runtime dependency and thus belongs in `devDependencies` to
accurately reflect its role in the project and resolve potential
dependency conflicts during installation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR corrects the categorization of the pkg dependency by moving it from dependencies to devDependencies. The pkg tool is exclusively used for creating native binaries during the build process (via bin/build-native script and test setup), not at runtime. This change accurately reflects the tool's role as a build-time dependency and helps reduce unnecessary dependencies in production installations.

Key changes:

  • Moved pkg (version 5.8.1-patched) from dependencies to devDependencies

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

A workaround has been added to `packages/cli/tests/setup.js` to address
an incompatibility with Node.js versions (e.g., Node 25) that introduce
`localStorage` as an empty proxy. This behavior caused jest-environment-node
to throw errors during Jest test runs because `localStorage.getItem` was
missing.

The workaround explicitly sets `globalThis.localStorage = undefined` if
`localStorage.localStorage.getItem` is not present, preventing the error
and allowing tests to execute successfully. This is a temporary measure
to be removed once the upstream Node.js bug is resolved.
@dividedmind dividedmind force-pushed the fix/pkg-dev-dependency branch from 0d0c073 to a7e6513 Compare November 24, 2025 18:37
@dividedmind dividedmind merged commit 74b5d49 into main Nov 25, 2025
29 checks passed
@dividedmind dividedmind deleted the fix/pkg-dev-dependency branch November 25, 2025 15:41
@appland-release

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version @appland/appmap-v3.196.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants