Skip to content

Commit

Permalink
Merge pull request #1 from codehangar/develop
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
grailian authored Mar 9, 2017
2 parents 34ec4e6 + 534b9dd commit 390f665
Show file tree
Hide file tree
Showing 118 changed files with 7,198 additions and 2,891 deletions.
8 changes: 7 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{
"presets": ["es2015", "react"]
"presets": ["es2015", "react", "stage-0"],
"plugins": [
["transform-runtime", {
"polyfill": false,
"regenerator": true
}]
]
}
13 changes: 10 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
node_modules
npm-debug.log
dev
build
ReQLPro-darwin-x64
dist
builds
apps

# WebStorm Settings
.idea/**
!.idea/codeStyleSettings.xml

# Generated Coverage Report
coverage/
36 changes: 36 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .istanbul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
instrumentation:
extension: .js
root: ./public
include-all-sources: true
verbose: true
save-baseline: true
excludes: ["**/*.spec.js" ]
reporting:
dir: "coverage"
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# RethinkDB Client
# ReQLPro

## Test Status

`develop`
- [![CircleCI](https://circleci.com/gh/codehangar/reqlpro/tree/develop.svg?style=shield&circle-token=1e39f63fbc10770fa2ae80e841f43faf5f39f59b)](https://circleci.com/gh/codehangar/reqlpro/tree/develop)

`master`
- [![CircleCI](https://circleci.com/gh/codehangar/reqlpro/tree/master.svg?style=shield&circle-token=1e39f63fbc10770fa2ae80e841f43faf5f39f59b)](https://circleci.com/gh/codehangar/reqlpro/tree/master)

## Setup

- npm install
- npm start

You have to stop and start the process on code changes, until we get a live reload type solution setup.

## Code Structure

The main.js file at root is similar to a server.js file for a node web server. It handles spawning the main window process.
Expand All @@ -23,5 +29,13 @@ The rethinkdb.client.js file is the the source of the truth for all the applicat
- npm run package (makes an archive of the app folder)
- delete Appfolder/AppName.app/Contents/Resources/app (this is so people cant see the source code of the app)

## Installing Wine for building Windows distributions on Mac
https://www.davidbaumgold.com/tutorials/wine-mac/#part-2:-install-homebrew-cask
## Mac Packaging
- You will need to install this npm package locally. We cannot add to this package.json because it fails in linux npm installs (i.e. our CI server)
- https://www.npmjs.com/package/appdmg

## Testing and Code Coverage
- npm test
- npm run test-coverage

To see the results of the test coverage, view the `coverage/lcov-report/index.html` file in your browser

36 changes: 0 additions & 36 deletions build.json

This file was deleted.

37 changes: 37 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## Customize the test machine
machine:

# Version of node to use
node:
version: 6.9.2

# Override /etc/hosts
hosts:
circlehost: 127.0.0.1
dev.mycompany.com: 127.0.0.1

# Add some environment variables
environment:
CIRCLE_ENV: test

## Customize general stuff
general:
artifacts:
- "artifacts/$CIRCLE_PROJECT_REPONAME-$CIRCLE_BRANCH-$CIRCLE_BUILD_NUM.tar" # relative to the build directory

## Customize test commands
test:
override:
- npm run test-circle:
environment:
MOCHA_FILE: $CIRCLE_TEST_REPORTS/junit/test-results.xml
post:
- npm run test-coverage
# Move the coverage report to the artifacts folder
- mv coverage/ $CIRCLE_ARTIFACTS/coverage

## Custom notifications
notify:
webhooks:
# A list of hashes representing hooks. Only the url field is supported.
# - url: https://someurl.com/hooks/circle
68 changes: 68 additions & 0 deletions main.electron-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
'use strict';

const { BrowserWindow } = require('electron');

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;

function getMainWindow() {
return mainWindow;
}

function createWindow() {
// Create the browser window.
mainWindow = new BrowserWindow({
width: 1600,
height: 1200,
'min-width': 600,
'min-height': 400
});

// and load the index.html of the app.
if (process.env.NODE_ENV === 'development') {
mainWindow.loadURL('http://localhost:3001/index.html');
mainWindow.webContents.openDevTools();
} else {
mainWindow.loadURL('file://' + __dirname + '/dist/index.html');
}

// Emitted when the window is closed.
mainWindow.on('closed', function() {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null;
});
}

// Create new window instances
function createNewWindow(event, config) {
let win = new BrowserWindow({
width: config.width || 1000,
height: config.height || 700,
show: true
});

if (process.env.NODE_ENV === 'development') {
win.loadURL('http://localhost:3001' + (config.path || '/index.html'));
win.webContents.openDevTools();
} else {
win.loadURL('file://' + __dirname + '/dist' + (config.path || '/index.html'));
}

win.on('closed', function() {
win = null;
});
}

function launchFeedbackPopup() {
mainWindow.webContents.send('launchFeedbackPopup');
}

module.exports = {
createWindow,
createNewWindow,
getMainWindow,
launchFeedbackPopup
};
Loading

0 comments on commit 390f665

Please sign in to comment.