electron / electron/rebuild

Follow OS conventions for storing cache

Open
#1,097 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
181
Avg merge
6h 44m
Merged PRs (30d)
3

Description

Hi, currently, `.electron-gyp` is stored in the `home` directory. I think it would be much nicer if the default could be changed so that it is stored in the expected cache directory for the OS as `node-gyp` did [here](https://github.com/nodejs/node-gyp/commit/8a83972743).

I skimmed through the codebase and I think the only thing that would have to be done is to change [this line](https://github.com/electron/rebuild/blob/07c426138e356ad129bf6c758d38b451c945c78d/src/constants.ts#L4) to use [env-paths](https://www.npmjs.com/package/env-paths) to get the system cache directory (as `node-gyp` did in the referenced commit) and add it to the package.json.

I'm not familiar with typescript or this codebase, so I may be missing something. If I have time I might create a pull request for this.

Contributor guide

Open the contributing guide

Research direction

Start with src/constants.ts at the linked line and inspect package.json for dependency declarations. Compare the referenced node-gyp change and env-paths usage, then verify that .electron-gyp resolves to the expected OS cache directory and that the package still builds and tests successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, node.js, typescript
Domain
tooling
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.