atom / watcher

Atom Filesystem Watcher
MIT License
200 stars 36 forks source link

Prebuild binaries #204

Open fabiospampinato opened 5 years ago

fabiospampinato commented 5 years ago

I'd like to use Atom's watcher in an Electron app of mine, but it seems that using a native dependency in a cross platform app can be tricky, I see there's been some discussion about publishing prebuild binaries already here https://github.com/atom/watcher/pull/135 but I wasn't quite able to integrate @atom/watcher successfully in my project, could you guys perhaps share some steps on how to integrate this in a cross-platform electron app?

Thank you!

smashwilson commented 5 years ago

It took me some time but I did get prebuilds working properly by v1.3.0. You should be installing the prebuilt binaries automatically when you npm install @atom/watcher.

[..] I wasn't quite able to integrate @atom/watcher successfully in my project, [..]

Can you elaborate on the specific difficulties you're having?

fabiospampinato commented 5 years ago

Can you elaborate on the specific difficulties you're having?

Sure, first of all I'm trying to make cross-platform bundles from a single platform, which is something that is supposed to be working only when prebuilt binaries are available, I think.

Here there's a branch that uses @atom/watcher, and here there's the code that uses it, for now it just shows an alert with the number of events received. If you'd like to build the app yourself check this.

  1. I did a npm install @atom/watcher, then restarted the app with a npm run dev, and got the following error in the console:
screen shot 2019-01-22 at 17 23 13
  1. Which seems to say that the required binary has not been found. So I ran npx electron-builder install-app-deps and again npm run dev, now the app works on macOS.

  2. I wanted to check if cross-platform builds worked too, so I did a npm run build:all to make all those builds, but the Windows build just doesn't work, I see no errors in the console but no events being triggered either.

I'm not sure what I'm doing wrong, the app is packaged via electron-builder.

fabiospampinato commented 5 years ago

@smashwilson Hey Ash, sorry to bother you, but can you give me any pointers on how I could get this to work properly?