atom / watcher

Atom Filesystem Watcher

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prebuild binaries

fabiospampinato opened this issue · comments

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 #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!

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?

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.

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