Skip to content

Commit

Permalink
basic electron setup
Browse files Browse the repository at this point in the history
  • Loading branch information
srtucker22 committed May 13, 2017
1 parent 75bef06 commit 3b7975a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ settings.json

node_modules
config.push.json
public/downloads/darwin-x64/*
public/downloads/win32-ia32/*
public/downloads/mac/*
public/downloads/windows/*
5 changes: 2 additions & 3 deletions client/components/download-button.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,18 @@ const DownloadButtonComponent = (props) => {
const platforms = {
mac: {
icon: '/images/apple.svg',
// link: `/downloads/darwin-x64/${APP_NAME}.zip`,
title: 'Mac OS X',
},
win: {
icon: '/images/windows.svg',
// link: `/downloads/win-x64/${APP_NAME}.zip`,
title: 'Windows',
},
};

const platform = platforms[props.platform];

return (
<a href={platform.link} download>
<a href={props.link} download>
<RaisedButton
secondary
labelPosition="after"
Expand All @@ -90,6 +88,7 @@ const DownloadButtonComponent = (props) => {
};

DownloadButtonComponent.propTypes = {
link: PropTypes.string,
platform: PropTypes.string.isRequired,
};

Expand Down
4 changes: 2 additions & 2 deletions client/components/home.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import Radium from 'radium';
import RaisedButton from 'material-ui/RaisedButton';
import React from 'react';
import { APP_NAME, COMPANY, GITHUB_URL } from '../../lib/config';
import { APP_NAME, COMPANY, GITHUB_URL, DOWNLOAD_URLS } from '../../lib/config';
import * as Actions from '../actions/actions';
import DownloadButtonComponent from './download-button.component';
import FooterComponent from './footer.component';
Expand Down Expand Up @@ -74,7 +74,7 @@ export class HomeComponent extends React.Component {
/>
<br />
{(Browser.mac && !Browser.electron) ?
<DownloadButtonComponent platform="mac" /> : ''}
<DownloadButtonComponent platform="mac" link={DOWNLOAD_URLS.mac} /> : ''}
</div>
</div>
</div>
Expand Down
10 changes: 10 additions & 0 deletions lib/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { Meteor } from 'meteor/meteor';

if (Meteor.isServer) {
const pjson = require('../package.json');
Meteor.settings.public.version = pjson.version;
}

export const ICE_CONFIG = { iceServers: [{ url: 'stun:stun.l.google.com:19302' }] };

// consistent constraints for getUserMedia
Expand All @@ -18,9 +23,14 @@ export const GUM_CONSTRAINTS = {
},
};

export const VERSION = Meteor.settings.public.version;
export const APP_NAME = Meteor.settings.public.name;
export const APP_EMAIL = 'support@glipchat.herokuapp.com';
export const APP_ICON = '/android-icon-192x192.png';
export const DOWNLOAD_URLS = {
mac: `/downloads/mac/${APP_NAME}-${VERSION}-mac.zip`,
windows: `/downloads/mac/${APP_NAME}-${VERSION}-windows.zip`,
};

export const COMPANY = {
name: 'Glipcode',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "glipchat",
"version": "0.0.1",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "meteor --settings settings.json",
Expand Down
9 changes: 7 additions & 2 deletions private/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ const path = require('path');
const proxyWindowEvents = require('./proxy-window-events');
const updater = require('electron-simple-updater');

let settings = {};

if (process.env.NODE_ENV !== 'development') {
settings = require('./settings.json');
}

updater.init({
checkUpdateOnStart: false,
autoDownload: false,
Expand All @@ -12,8 +18,7 @@ updater.init({
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;

const settings = process.env.SETTINGS || {};
const rootUrl = settings.url || 'http://localhost:3000';
const rootUrl = settings.rootUrl || 'http://localhost:3000';

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
Expand Down
2 changes: 1 addition & 1 deletion private/electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"url": "https://raw.githubusercontent.com/srtucker22/glipchat/master/private/electron/updates.json"
},
"scripts": {
"start": "electron .",
"start": "NODE_ENV='development' electron .",
"pack": "build --dir",
"dist": "build",
"publish": "publish",
Expand Down
4 changes: 2 additions & 2 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
- BUG: rtc.actions.js:306 DOMException: Failed to set remote answer sdp: Called in wrong state: STATE_INPROGRESS
- BUG: sometimes first notification isn't received, probably due to new subscriptionid
- missing a notification leads to being 1 behind in the chain
- ENHANCEMENT: electron settings for file locations
- ENHANCEMENT: Streamline build/publish process for Electron
- FEATURE: electron download buttons
- TEST: electron auto-updater/builder test
- ENHANCEMENT: clear non-active rooms with chron job
- ENHANCEMENT: clicking notification with open window should redirect without reloading page
- ENHANCEMENT: handle all error messages
Expand All @@ -17,6 +16,7 @@
- FEATURE: firefox notifications
- FEATURE: mobile calling overlay
- FEATURE: UI for mobile notifications
- TEST: electron auto-updater test

**med**
- ENHANCEMENT: Add TURN server support to make it more useful for real-world deployment
Expand Down

0 comments on commit 3b7975a

Please sign in to comment.