This repository has been archived by the owner on Oct 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.json
55 lines (55 loc) · 10.1 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"name": "universe-desktop-app",
"version": "0.5.0",
"main": "lib/index.js",
"bin": {
"desktop-app": "bin/cli.js"
},
"engines": {
"node": ">=0.10.36"
},
"private": true,
"description": "Package your Meteor apps with Electron, and butter.",
"author": {
"name": "Cristo Rabani",
"email": "[email protected]"
},
"license": "MIT",
"dependencies": {
"commander": "^2.8.1",
"electron-packager": "5.2.1",
"electron-prebuilt": "0.37.2",
"lodash": "^4.12.0",
"server-destroy": "^1.0.1",
"shelljs": "^0.7.0"
},
"devDependencies": {
"codeclimate-test-reporter": "^0.1.1",
"istanbul": "^0.4.1",
"mocha": "^2.3.4",
"npm-check": "^4.1.3",
"should": "^8.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/vazco/universe-desktop-app.git"
},
"keywords": [
"electron",
"meteor",
"packager",
"desktop",
"app"
],
"bugs": {
"url": "https://github.com/vazco/desktop/issues"
},
"homepage": "https://github.com/vazco/universe-desktop-app",
"gitHead": "dcced2b70ba765f8d8327d4a27262de3220a225d",
"readme": "# Universe Desktop App\n\nEasily package your Meteor apps with Electron.\n\n## Installation locally\n\n````shell\ncd /your/meteor/app\nmeteor npm install --save-dev universe-desktop-app\n````\n\n## Installation globally\n\nNow, You should add to your package.json on the end of section `scripts` following line:\n```\n\"desktop\": \"desktop-app\"\n```\n\nSo, everything should look like this example: \n```json\n...\n\"scripts\": {\n \"start\": \"meteor --settings=settings.json\"\n \"desktop\": \"desktop-app --settings=settings.json\"\n },\n...\n```\n\n> For invoking Electron methods from Meteor, you'll also need to install the\n> `universe:desktop-app` meteor package.\n> For more info check [Meteor x Electron integration](#meteor-x-electron-integration).\n\n\n## Compatibility\n\nWorks on all Meteor's supported [platforms](https://github.com/meteor/meteor/wiki/Supported-Platforms).\n\n## Help\n\n````bash\n$ meteor npm run desktop -- --help\n\n Usage: desktop-app [command] [options]\n\n Commands:\n\n run (default) start meteor app within desktop context\n bundle bundle meteor app at `.desktop` dir\n package bundle and package app to `--output` dir\n\n Options:\n\n -h, --help output usage information\n -V, --version output the version number\n -i, --input <path> meteor app dir | default = .\n -o, --output <path> output dir | default = .desktop/.dist\n -s, --settings <path> meteor settings file | default = null (optional)\n\n Examples:\n\n # cd into meteor dir first\n cd /your/meteor/app\n\n desktop-app\n desktop-app run\n desktop-app package\n desktop-app package -o /dist/dir\n desktop-app package -o /dist/dir -s file.json\n desktop-app package -i /app/dir -o /dist/dir -s dev.json\n desktop-app package -- <electron-packager-options>\n\n # more info about electron packager options:\n # ~> https://www.npmjs.com/package/electron-packager\n````\n\n## Running app\n\n````shell\ncd /your/meteor/app\nmeteor npm run desktop\n````\n\n## Packaging\n\n````shell\ncd /your/meteor/app\ndesktop-app package\n````\n\nThe packaging process is done under the hood using `electron-packager`\nnpm package. The following variables are automatically set:\n\n * `--out` -- *comes from cli option [-o, --out]*\n * `--arch` -- *comes from system [current arch]*\n * `--platform` -- *comes from system [current platform]*\n * `--version` -- *comes from .desktop/package.json [current app version]*\n\nYou can overwrite these default values and also set others by passing custom\narguments directly to `electron-packager` after `--`, i.e:\n\n````shell\ncd /your/meteor/app\ndesktop-app package -- --icon=/folder/x/img/icon.png --version=x.y.z\n````\n\nAll the available options for `electron-packager` can be found here:\nhttps://www.npmjs.com/package/electron-packager\n\n### Notes\n\nThe output app will match your current operational system and arch type.\n\n * To get an **OSX** app, run it from a **Osx** machine.\n * To get an **Linux 32bit** app, run it from a **32bit Linux** machine.\n * To get an **Linux 64bit** app, run it from a **64bit Linux** machine.\n * To get an **Windows 32bit** app, run it from a **32bit Windows** machine.\n * To get an **Windows 64bit** app, run it from a **64bit Windows** machine.\n\nDue to NodeJS native bindings of such libraries such as Fibers -- *which are\nmandatory for Meteor*, you'll need to have your Meteor app fully working on the\ndesired platform before installing this plugin and packaging your app.\n\nSo, at this time, you cannot package your app in a cross-platform fashion from\none single OS.\n\nPerhaps you can live with it? :)\n\n> **DO NOT** use options to output for multiple arch/platforms at once, such as\n`--arch=all`. It won't work, Desktop can bundle Meteor apps only for the\nplatform you're running on.\n\n\n## Options\n\n1. `-i, --input` - Meteor app folder, default is current directory (`process.cwd()`).\n1. `-o, --output` - Sets output folder for your packaged app, default is\n`/your/meteor/app/.dist`\n1. `-s, --settings` Sets path for Meteor\n[settings](http://docs.meteor.com/#/full/meteor_settings) file, this will be\navailable inside your Meteor code both in development and after being packaged.\n\n## Structure\n\nYou'll notice a new folder called `.desktop` in your meteor app dir, its\nstructure will be like this:\n\n````\n/your/meteor/app\n├── .desktop\n│ ├── .gitignore\n│ ├── desktop.json\n│ ├── index.js\n│ └── package.json\n├── .meteor\n└── ...\n````\n\nThis is a pure Electron project, so you can use the whole Electron API from JS\nfiles in this folder. Also, you can install electron dependencies and store them\nin the `package.json` file. Note that the `desktop` package is itself a\ndependency.\n\nSee this folder as the `desktop layer` for your Meteor app. Remember to check\nout the `index.js` file, it constains the desktop start/stop usage.\n\nThe `desktop.json` file will hold specific preferences for Desktop, such as\nplugins and so on. It's still a WIP, but you can get around it.\n\n### Config (`desktop.json`)\n\nFor now there's only one option here: `preserve_db`.\n\nSet it to true to preserve database between installs. It works by saving the\nmongo data dir inside user's data folder, instead of being self contained within\nthe app folder (which gets deleted when new version is installed).\n\n# Customizing\n\nLet's see how one would be able to do a simple SplashScreen:\n\n````javascript\nvar app = require('app');\nvar browser = require('browser-window');\nvar desktop = require('desktop')(__dirname);\n\nvar window = null;\nvar splash = null; // splash variable\n\napp.on('ready', function() {\n splash = new browser({ // starts splash window\n // >>> your configs here\n });\n splash.loadUrl('./splash.html'); // create the \".desktop/splash.html\" file\n \n // then move along and start desktop\n desktop.start(function(meteor_root_url) {\n\n // before opening a new window with your app, destroy the splash window\n splash.close(); // >>> or .destroy(), check what works for you\n\n\n // from here on, well, nothing changes..\n\n\n window = new browser({\n width: 1200, height: 900,\n 'node-integration': false // node integration must to be off\n });\n window.loadUrl(meteor_root_url);\n });\n});\n\n\n// ....\n\n````\n\n## Meteor x Electron integration\n\nYou can seamlessly call Electron methods from your Meteor's client/server code.\n\nDefine your Electron methods inside the `.desktop` folder:\n\n````javascript\n// `.desktop/index.js` file\ndesktop.methods({\n 'hello.world': function(firstname, lastname, done) {\n // do things with electron api, and then call the `done` callback\n // as ~> done(err, res);\n done(null, 'Hello '+ firstname +' '+ lastname +'!');\n }\n});\n````\n\nThen, in your Meteor code (client and server), you can call this method like:\n\n````javascript\n// Desktop.call(method_name, args, done_callback);\nDesktop.call('hello.world', ['anderson', 'universe'], function(err, msg) {\n console.log(msg); // Hello anderson universe!\n});\n````\n\n> **IMPORTANT**\n> \n> You can only call methods after the connection is made between Meteor and\n> Electron, to make sure it's ready you can wrap your code in a startup block:\n> \n> ````javascript\n> Desktop.startup(function(){\n> Desktop.call(...);\n> });\n> ````\n\n## Upgrading\n\nWhen upgrading to newer versions, it's **important** to know that:\n\n### ~> templates\n\nOnce these files exists on disk, they *will not* be overwritten.\n * `.desktop/index.js`\n * `.desktop/package.json`\n * `.desktop/desktop.json`\n * `.desktop/.gitignore.json`\n\n### ~> api\n\nAs these files above is never overwritten, in case of any API change that needs\nadjustments, these will have to be made manually.\n\n### ~> version matching\n\nAlways keep the same desktop version in your Meteor, and inside the\n`.desktop` folder, *as per specified in `.desktop/package.json` file*.\n\n## Questions?\n\nDo not open issues, use the chat channel instead.\n\n[](https://gitter.im/universe/desktop)\n\n## Problems?\n\nThis is very young and active software, so make sure your are always up to date\nbefore opening an issue. Follow the released fixes through the\n[HISTORY.md](HISTORY.md) file.\n\nIf you find any problem, please open a meaningful issue describing in detail how\nto reproduce the problem, which platform/os/arch type you're using, as well as\nthe version of Meteor and Desktop, and any other info you may find usefull.\n\n## License\n\nThe MIT License (MIT)\nThis package is forked from desktop package by Anderson Arboleya, (provided under MIT)\n",
"readmeFilename": "README.md",
"_id": "[email protected]",
"_shasum": "3d945784b4b8df2ff1a76509643af2f75c2a9d34",
"_from": "git+ssh://[email protected]/vazco/universe-desktop-app.git",
"_resolved": "git+ssh://[email protected]/vazco/universe-desktop-app.git#dcced2b70ba765f8d8327d4a27262de3220a225d"
}