electron-webapps / meteor-electron

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

Support for Meteor 1.1 #68

Open alanning opened 8 years ago

alanning commented 8 years ago

Just tried it with my production app and had a bit of trouble getting it to work since we still use Meteor 1.1.

Here's what I had to do to get it working:

Here's the git diff:

$ git diff
diff --git a/package.js b/package.js
index 57341a8..f274b78 100644
--- a/package.js
+++ b/package.js
@@ -20,8 +20,13 @@ Npm.depends({
 });

 Package.onUse(function (api) {
-  api.use(["mongo-livedata@1.0.9", "webapp@1.2.3", "ejson@1.0.7", "promise@0.5.1"], "server");
-  api.use("underscore@1.0.4", ["server", "client"]);
+  var both = ['client', 'server'];
+
+  api.versionsFrom("METEOR@1.1");
+
+  api.use(['underscore'], both);
+
+  api.use(["mongo-livedata", "webapp", "ejson", "promise"], "server");
   api.use(["iron:router@0.9.4||1.0.0"], {weak: true});

   api.addFiles([
@@ -35,14 +40,14 @@ Package.onUse(function (api) {
     'server/index.js'
   ], 'server');

-  api.addAssets([
+  api.addFiles([
     "app/autoUpdater.js",
     "app/main.js",
     "app/menu.js",
     "app/package.json",
     "app/preload.js",
     "app/proxyWindowEvents.js"
-  ], "server");
+  ], "server", {isAsset: true});

   api.addFiles(['client/index.js'], "client");

Should be able to support both without issue with some feature checking.

I'll put together a PR in a bit if you guys don't get to it first.