electron-webapps / meteor-electron

Meteor Electron, the easiest way to create a desktop Meteor application
MIT License
325 stars 46 forks source link

move to electron-builder #104

Closed menelike closed 8 years ago

menelike commented 8 years ago

We needed some missing features and needed to build for win/lin/osx.

We ended up with a fork on https://github.com/risetechnologies/meteor-electron which also moved from electron-packager to electron-builder.

Why?

This project reinvents the wheel times too often, as a result it tries to solve all problems electron-builder and nuts already solved.

This is what we've done:

Still rough and not tested very well, but at least we could easily build from osx for win/lin/osx.

As a lot of breaking changes have been done, I'm not sure if a merge is applicable. What do you think?

markshust commented 8 years ago

@menelike this is crashing on start for me:

``` I20160914-16:38:41.838(-4)? Rebuilding app dependencies for arch x64 to /Users/markshust/Sites/myapp/src/.meteor-electron/app I20160914-16:38:41.838(-4)? => Meteor server restarted I20160914-16:38:42.770(-4)? Packaging for platform darwin x64 using electron 1.3.5 to output/mac I20160914-16:38:42.771(-4)? I20160914-16:38:45.982(-4)? Warning: Application icon is not set, default Electron icon will be used I20160914-16:38:46.289(-4)? Warning: App is not signed: CSC_LINK is not specified, and no valid identity in the keychain, see https://github.com/electron-userland/electron-builder/wiki/Code-Signing I20160914-16:38:46.294(-4)? Creating DMG I20160914-16:38:46.297(-4)? Creating MacOS zip W20160914-16:38:46.310(-4)? (STDERR) Warning: a promise was created in a handler at Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/macPackager.ts:79:16 but was not returned from it, see http://goo.gl/rRqMUw W20160914-16:38:46.311(-4)? (STDERR) at DmgTarget. (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/bluebird/js/release/generators.js:197:21) W20160914-16:38:46.312(-4)? (STDERR) at tsAwaiter (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/util/awaiter.ts:10:47) W20160914-16:38:46.312(-4)? (STDERR) at DmgTarget.build (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/targets/dmg.ts:33:32) W20160914-16:38:46.314(-4)? (STDERR) at MacPackager.packageInDistributableFormat (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/macPackager.ts:192:30) W20160914-16:38:46.314(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/macPackager.ts:79:16 W20160914-16:38:46.315(-4)? (STDERR) From previous event: W20160914-16:38:46.316(-4)? (STDERR) at MacPackager. (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/macPackager.ts:78:10) W20160914-16:38:46.316(-4)? (STDERR) at next (native) W20160914-16:38:46.316(-4)? (STDERR) From previous event: W20160914-16:38:46.317(-4)? (STDERR) at tsAwaiter (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/util/awaiter.ts:10:47) W20160914-16:38:46.318(-4)? (STDERR) at Object.build (/Users/markshust/Sites/myapp/src/.meteor/local/isopacks/risetechnologies_electron/npm/node_modules/electron-builder/src/builder.ts:179:52) W20160914-16:38:46.319(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/risetechnologies:electron/server/createBinaries.js:128:13 W20160914-16:38:46.319(-4)? (STDERR) at meteorInstall.node_modules.meteor.risetechnologies:electron.server.createBinaries.js (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/risetechnologies:electron/server/createBinaries.js:26:24) W20160914-16:38:46.320(-4)? (STDERR) at fileEvaluate (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1) W20160914-16:38:46.321(-4)? (STDERR) at Module.require (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) W20160914-16:38:46.321(-4)? (STDERR) at Module.Mp.import (/Users/markshust/.meteor/packages/modules/.0.7.6.zlzv9u++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16) W20160914-16:38:46.321(-4)? (STDERR) at meteorInstall.node_modules.meteor.risetechnologies:electron.server.index.js (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/risetechnologies_electron.js:31:188) W20160914-16:38:46.322(-4)? (STDERR) at fileEvaluate (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/modules-runtime/.npm/package/node_modules/install/install.js:153:1) W20160914-16:38:46.322(-4)? (STDERR) at require (/Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/packages/modules-runtime/.npm/package/node_modules/install/install.js:82:1) W20160914-16:38:46.322(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/node_modules/meteor/risetechnologies:electron/node_modules/lucy-dirsum/index.js:110:1 W20160914-16:38:46.322(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/packages/meteor:/💻app/node_modules/meteor/risetechnologies:electron/node_modules/lucy-dirsum/index.js:110:1 W20160914-16:38:46.323(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/boot.js:292:10 W20160914-16:38:46.323(-4)? (STDERR) at Array.forEach (native) W20160914-16:38:46.323(-4)? (STDERR) at Function._.each._.forEach (/Users/markshust/.meteor/packages/meteor-tool/.1.4.1_1.1czluqs++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11) W20160914-16:38:46.323(-4)? (STDERR) at /Users/markshust/Sites/myapp/src/.meteor/local/build/programs/server/boot.js:128:5 ```
menelike commented 8 years ago

@markoshust I'm getting the same error but it builds the osx packages just fine and meteor runs afterwards without any problems. Does it really crash?

markshust commented 8 years ago

@menelike yea, mine won't build at all.

there are also a lot of defaults missing which lead to a lot of headaches getting this to actually execute. in my opinion, it should work without any settings.json file at all. if a settings.json is defined, it should work with a minimally defined one:

{
  "electron": {
    "name": "My App",
    "version": "0.0.1"
  }
}

there needs to be sensible defaults in place, especially for the Meteor.settings.electronBuilder prop. i find it really odd that Meteor.settings.electronBuilder.devMetadata.build and Meteor.settings.electronBuilder.devMetadata.directories.buildResources both need to be defined in order for this to build. with the current package, I just meteor add it, and it all works flawlessly. that's probably how this new build should work as well.

good job refactoring the code though, appears to be a lot of improvements 👍

markshust commented 8 years ago

fyi also, the build is SOOO much different, I'd suggest to keep this in a separate builder/name and remove it from the fork so we can raise issues on your github. i don't think it would be appropriate to merge this into this project.

menelike commented 8 years ago

@markoshust thanks for sharing.

in my opinion, it should work without any settings.json file at all

We still have to make sure that the package runs out of the box, thanks for that!

fyi also, the build is SOOO much different, I'd suggest to keep this in a separate builder/name and remove it from the fork so we can raise issues on your github. i don't think it would be appropriate to merge this into this project.

We moved to https://github.com/risetechnologies/meteor-electron-builder , still some work todo until the first release.