diff --git a/.gitignore b/.gitignore index ee514ad..cc4cd17 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ .*/ !/.idea/ /.idea/workspace.xml -/build/ +/binding/build/ +/binding/prebuilds/ /lib/ -/prebuilds/ node_modules/ yarn-error.log* *.tgz diff --git a/.npmignore b/.npmignore index 4955add..b0772f4 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,5 @@ /.idea/ /.vs/ -/build/ +/binding/build/ /examples/ *.log diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cb66a6..b10a3e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- [#23](https://github.com/simonbuchan/native-reg/issues/23) Don't break electron-rebuild by avoiding a top-level + binding.gyp. + ## [v0.3.5] - 2021-03-18 ### Added diff --git a/binding.gyp b/binding/binding.gyp similarity index 100% rename from binding.gyp rename to binding/binding.gyp diff --git a/reg.cc b/binding/reg.cc similarity index 100% rename from reg.cc rename to binding/reg.cc diff --git a/package.json b/package.json index 3e3a9d1..f8474ae 100644 --- a/package.json +++ b/package.json @@ -18,8 +18,8 @@ "lib", "src", "test", - "prebuilds", - "binding.gyp", + "binding/prebuilds", + "binding/binding.gyp", "*.cc" ], "scripts": { @@ -29,8 +29,8 @@ "clean": "rimraf build lib prebuilds", "build": "yarn build:js && yarn build:ia32 && yarn build:x64", "build:js": "tsc -p src", - "build:ia32": "prebuildify --napi --target node@8.12.0 --arch ia32", - "build:x64": "prebuildify --napi --target node@8.12.0 --arch x64", + "build:ia32": "prebuildify --napi --target node@8.12.0 --cwd binding --arch ia32", + "build:x64": "prebuildify --napi --target node@8.12.0 --cwd binding --arch x64", "test": "mocha --ui tdd" }, "dependencies": { diff --git a/src/index.ts b/src/index.ts index dd96e3f..b61ebda 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ const types = require('util').types || { }; const isWindows = process.platform === 'win32'; -const native = isWindows && require('node-gyp-build')(__dirname + '/..'); +const native = isWindows && require('node-gyp-build')(__dirname + '/../binding'); // from winreg.h export enum HKEY {