Move @electron/rebuild into optionalDependencies

Open Beginner friendly
#4,134 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
node.js
Domain
build-system

Research direction

Start by inspecting the package manifest and the dependency declarations for @electron/rebuild and node-gyp. Move @electron/rebuild to optionalDependencies, then verify that installation no longer requires node-gyp while projects that need native module building retain the dependency.

Written by the indexing model from the issue text.

Description

Pre-flight checklist
  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem description

Many firms disallow installation of node-gyp. This module is dragged in through @electron/rebuild, thus preventing @electron/forge from being installed without hacky workarounds.

I believe this problem can be solved by moving @electron/rebuild into optionalDependencies. Only a small percentage of electron projects require native module building, and those projects almost by definition won't have restrictions on node-gyp. Anyone else will be able to install the library without getting stuck at this point.

Proposed solution

Move @electron/rebuild into optionalDependencies.

Alternatives considered

To get around this problem, we've been using a resolution that points node-gyp to a fake library. But this requires some manual hand-holding with our customers.

Additional information

No response

Dominant language
TypeScript
Stars
7.1k
Forks
642
Avg merge
2d 8h
Merged PRs (30d)
35

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from electron/forge

All issues in electron/forge

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.