Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: electron/rebuild
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5dadede1ba05e95cab752434b1ecd8b529bf0892
Choose a base ref
...
head repository: electron/rebuild
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6f94aaace0ea72a342e9249328293644caec5723
Choose a head ref
Loading
Showing with 9,531 additions and 12,034 deletions.
  1. +25 −21 .circleci/config.yml
  2. +5 −5 README.md
  3. +0 −11,227 package-lock.json
  4. +32 −22 package.json
  5. +0 −1 src/ambient.d.ts
  6. +37 −0 src/arch.ts
  7. +72 −4 src/cache.ts
  8. +8 −1 src/clang-fetcher.ts
  9. +33 −48 src/cli.ts
  10. +11 −5 src/electron-locator.ts
  11. +1 −1 src/fetcher.ts
  12. +2 −5 src/main.ts
  13. +54 −244 src/module-rebuilder.ts
  14. +72 −0 src/module-type/index.ts
  15. +161 −0 src/module-type/node-gyp.ts
  16. +83 −0 src/module-type/prebuild-install.ts
  17. +69 −0 src/module-type/prebuildify.ts
  18. +149 −0 src/module-walker.ts
  19. +38 −0 src/node-api.ts
  20. +52 −281 src/rebuild.ts
  21. +1 −1 src/sysroot-fetcher.ts
  22. +28 −0 src/types.ts
  23. +42 −0 test/arch.ts
  24. +33 −35 test/electron-locator.ts
  25. +1 −0 test/fixture/electron-locator/not-installed/package.json
  26. +1 −0 test/fixture/electron-locator/prebuilt-compile/node_modules/electron-prebuilt-compile/package.json
  27. +1 −0 test/fixture/electron-locator/single/node_modules/electron/package.json
  28. +1 −0 test/fixture/electron-locator/workspace/node_modules/electron/package.json
  29. +1 −0 test/fixture/electron-locator/workspace/packages/descendant/package.json
  30. +2 −1 test/fixture/native-app1/package.json
  31. 0 test/fixture/prebuildify/abi/prebuilds/linux-x64/electron.abi89.node
  32. +5 −0 test/fixture/prebuildify/has-prebuildify-devdep/package.json
  33. 0 test/fixture/prebuildify/napi/prebuilds/linux-arm/node.napi.armv7.node
  34. 0 test/fixture/prebuildify/napi/prebuilds/linux-arm64/electron.napi.armv8.node
  35. 0 test/fixture/prebuildify/napi/prebuilds/linux-x64/node.napi.node
  36. +1 −0 test/fixture/prebuildify/no-prebuildify-devdep/package.json
  37. 0 test/fixture/prebuildify/not-found/prebuilds/electron.abi0.node
  38. +0 −21 test/helpers/checksum.ts
  39. +33 −0 test/helpers/module-setup.ts
  40. +61 −0 test/module-type-node-gyp.ts
  41. +64 −0 test/module-type-prebuild-install.ts
  42. +116 −0 test/module-type-prebuildify.ts
  43. +77 −110 test/rebuild.ts
  44. +2 −1 tsconfig.json
  45. +8,157 −0 yarn.lock
46 changes: 25 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
step-restore-cache: &step-restore-cache
restore_cache:
keys:
- v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}

steps-test: &steps-test
steps:
@@ -15,45 +15,49 @@ steps-test: &steps-test
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 10
nvm alias default 10
nvm install 12
nvm alias default 12
echo 'export NVM_DIR=${HOME}/.nvm' >> $BASH_ENV
echo "[ -s '${NVM_DIR}/nvm.sh' ] && . '${NVM_DIR}/nvm.sh'" >> $BASH_ENV
;;
Windows*|CYGWIN*|MINGW*|MSYS*)
nvm install 10.22.0
nvm use 10.22.0
nvm install 12.22.4
nvm use 12.22.4
;;
esac
- run: npm install --engine-strict
- run: yarn install --frozen-lockfile
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ arch }}-{{ checksum "package-lock.json" }}
- run: npm run lint
- run: npm run coverage
- run: npm run codecov
key: v1-dependencies-{{ arch }}-{{ checksum "yarn.lock" }}
- run: yarn run lint
- run:
name: Tests with code coverage
command: yarn run coverage
environment:
DEBUG: electron-rebuild
- run: yarn run codecov


version: 2.1
orbs:
win: circleci/windows@1.0.0
jobs:
test-linux-10:
docker:
- image: circleci/node:10
<<: *steps-test
test-linux-12:
docker:
- image: circleci/node:12
- image: circleci/node:12-buster
<<: *steps-test
test-linux-14:
docker:
- image: circleci/node:14
- image: circleci/node:14-buster
<<: *steps-test
test-linux-16:
docker:
- image: circleci/node:16-buster
<<: *steps-test
test-mac:
macos:
xcode: "10.2.0"
xcode: "12.2.0"
<<: *steps-test
test-windows:
executor:
@@ -65,25 +69,25 @@ jobs:

release:
docker:
- image: circleci/node:10.22
- image: circleci/node:16
steps:
- checkout
- *step-restore-cache
- run: npm install
- run: yarn install --frozen-lockfile
- run: npx semantic-release
workflows:
version: 2
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- test-linux-10
- test-linux-16
- test-linux-12
- test-linux-14
- test-mac
- test-windows
- release:
requires:
- test-linux-10
- test-linux-16
- test-linux-12
- test-linux-14
- test-mac
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ npm run rebuild

### What are the requirements?

Node v10.12.0 or higher is required. Building the native modules from source uses
Node v12.13.0 or higher is required. Building native modules from source uses
[`node-gyp`](https://github.com/nodejs/node-gyp#installation), refer to the link for its
installation/runtime requirements.

@@ -62,10 +62,10 @@ Options:
other than your system's
-m, --module-dir The path to the app directory to rebuild
-w, --which-module A specific module to build, or comma separated
list of modules. Modules will only be rebuilt if they
list of modules. Modules will only be rebuilt if they
also match the types of dependencies being rebuilt
(see --types).
-e, --electron-prebuilt-dir The path to electron-prebuilt
-e, --electron-prebuilt-dir The path to the prebuilt electron module
-d, --dist-url Custom header tarball URL
-t, --types The types of dependencies to rebuild. Comma
separated list of "prod", "dev" and "optional".
@@ -87,9 +87,9 @@ Copyright 2016

This package is automatically used with Electron Forge when packaging an Electron app.

### How can I integrate this into [Electron Packager](https://github.com/electron-userland/electron-packager)?
### How can I integrate this into [Electron Packager](https://github.com/electron/electron-packager)?

electron-rebuild provides a function compatible with the [`afterCopy` hook](https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#aftercopy)
electron-rebuild provides a function compatible with the [`afterCopy` hook](https://electron.github.io/electron-packager/main/interfaces/electronpackager.options.html#aftercopy)
for Electron Packager. For example:

```javascript
Loading