Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #80 from mazehall/development
Browse files Browse the repository at this point in the history
more fixes for 1.3.1
  • Loading branch information
marcelkilian committed May 19, 2016
2 parents 8e78941 + e09215a commit 1b31877
Show file tree
Hide file tree
Showing 19 changed files with 159 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; electron build options - build packages against electrons node
disturl = "https://atom.io/download/atom-shell";
runtime = "electron";
target = "0.36.9";
target = "0.36.12";
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ Changed:

- closes project detail popup when clicking an action
- redirects to project page after successful project edit save
- Improved online check to try 3 times before actually setting offline state
- improved online check to try 3 times before actually setting offline state
- electron version 0.36.12

Fixed:

- fixed config issues -> replaced custom config implementation with a more native solution
- project cloning/installation and removing not finishing when custom.json does not exist
- removing and reinstalling a running project shows wrong state in project listing
- not showing configured design after clone when there was already a customization with that id
- redundancy in apps frontend stream initialization
- fixed deprecated electron initialization

## 1.3

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ npm start
```
### Npm package building

All npm packages are build against the electron node version. This is configured in the .npmrc file.
All npm packages are build against the electron node version. This is configured in the .npmrc file. If you use a newer electron version change it in .npmrc (target = ... ) as well.
Look [(here)](https://github.com/atom/electron/blob/master/docs/tutorial/using-native-node-modules.md) for more info.

### Making a release
Expand Down
6 changes: 2 additions & 4 deletions config/test.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"registry": {
"url": "",
"public": "",
"private": [],
"refreshInterval": "900000"
},
"test": {
"key": "value"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ansi-to-html-umd": "^0.4.2",
"asar": "^0.8.0",
"coffee-script": "1.9.3",
"config": "^1.15.0",
"config": "^1.20.2",
"docker-events": "0.0.2",
"dockerode": "^2.2.9",
"fs-jetpack": "^0.7.0",
Expand All @@ -34,7 +34,7 @@
"tmp": "0.0.28"
},
"devDependencies": {
"electron-prebuilt": "^0.37.5",
"electron-prebuilt": "^0.36.12",
"gulp": "^3.9.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.5.2",
Expand Down
3 changes: 3 additions & 0 deletions src/app.coffee
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
utilsModel = require './models/util'
utilsModel.initConfig()

eventHandler = require './handler/events.coffee'
setupModel = require './models/setup/setup.coffee'
projectsModel = require './models/projects/list.coffee'
Expand Down
2 changes: 1 addition & 1 deletion src/handler/runtimeStreams.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _r = require 'kefir'
ks = require 'kefir-storage'
isOnline = require 'is-online'

config = require '../models/stores/config'
config = require 'config'
utilModel = require '../models/util'
dockerProxyModel = require '../models/docker/proxy.coffee'
dockerListModel = require '../models/docker/list.coffee'
Expand Down
8 changes: 5 additions & 3 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
require('coffee-script/register');
var app = require('app');
var shell = require('shell');
var BrowserWindow = require('browser-window');
const electron = require('electron');

const app = electron.app;
const shell = electron.shell;
const BrowserWindow = electron.BrowserWindow;
var windowStateKeeper = require('./utils/window_state');
var windowMenu = require('./utils/window_menu');

Expand Down
2 changes: 1 addition & 1 deletion src/models/docker/proxy.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_r = require 'kefir'
config = require 'config'

config = require '../stores/config.coffee'
dockerModel = require '.'

proxyConfig = config.get 'proxy'
Expand Down
2 changes: 1 addition & 1 deletion src/models/registry/index.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
_r = require 'kefir'
ks = require 'kefir-storage'
crypto = require "crypto"
config = require 'config'

config = require '../stores/config.coffee'
utils = require '../util/index.coffee'
remote = require './remote.coffee'
local = require './local.coffee'
Expand Down
2 changes: 1 addition & 1 deletion src/models/setup/setup.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_r = require 'kefir'
ks = require 'kefir-storage'
config = require 'config'

config = require '../stores/config'
vagrantFsModel = require '../vagrant/fs.coffee'
vagrantRunModel = require '../vagrant/run.coffee'
virtualBoxModel = require '../vagrant/virtualbox.coffee'
Expand Down
28 changes: 0 additions & 28 deletions src/models/stores/config.coffee

This file was deleted.

33 changes: 14 additions & 19 deletions src/models/util/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ convert = new Convert();

model = {}

# use original config first and let it overwrite later with the custom config
model.setConfig = (newConfig) ->
return false if ! newConfig || typeof newConfig != "object"
config = newConfig
return true
# sync - extends default config with user config.
# Changes to require('config') can only be made before the first .get call. After that it gets immutable
model.initConfig = () ->
return false if ! (configModulePath = @getConfigModulePath())
configPath = jetpack.cwd(configModulePath).path('config.json')

#@todo improve error handling -> show config errors on eintopf startup
try
userConfig = jetpack.read configPath, 'json'
config.util.extendDeep config, userConfig
catch err
if process.env.NODE_ENV == 'development'
console.log 'Failed to load user config in ' + configPath
console.log 'Error message: ' + err.message

# resolves relative paths
model.resolvePath = (path) ->
Expand Down Expand Up @@ -46,20 +55,6 @@ model.getConfigModulePath = () ->
return null if ! (configPath = @getConfigPath())? || ! config?.app?.defaultNamespace
return jetpack.cwd(configPath).path config.app.defaultNamespace

model.loadUserConfig = (callback) ->
return callback new Error 'Failed to get config module path' if ! (configModulePath = @getConfigModulePath())
@loadJson jetpack.cwd(configModulePath).path('config.json'), callback

model.loadJson = (path, callback) ->
return callback new Error 'Invalid path' if ! path

try
userConfig = jetpack.read path, 'json'
catch err
return callback err

return callback null, userConfig

model.loadJsonAsync = (path, callback) ->
return callback new Error 'Invalid path' if ! path

Expand Down
2 changes: 1 addition & 1 deletion src/models/vagrant/fs.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_r = require 'kefir'
jetpack = require 'fs-jetpack'
config = require 'config'

config = require '../stores/config'
utilModel = require '../util/'

appConfig = config.get 'app'
Expand Down
8 changes: 4 additions & 4 deletions src/utils/window_menu.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var app = require('app');
var Menu = require('menu');
var shell = require('shell');

var electron = require('electron');
var app = electron.app;
var Menu = electron.Menu;
var shell = electron.shell;

var template = [
{
Expand Down
5 changes: 3 additions & 2 deletions src/utils/window_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

'use strict';

var app = require('app');
var electron = require('electron');
var app = electron.app;
var jetpack = require('fs-jetpack');

module.exports = function (name, defaults) {

var userDataDir = jetpack.cwd(app.getPath('userData'));
var stateStoreFile = 'window-state-' + name +'.json'
var stateStoreFile = 'window-state-' + name +'.json';

var state = userDataDir.read(stateStoreFile, 'json') || {
width: defaults.width,
Expand Down
1 change: 1 addition & 0 deletions tasks/postinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if (process.platform === 'win32') {
var params = ['install', 'pty.js'];

var install = childProcess.spawn(installCommand, params, {
cwd: process.cwd(),
env: process.env,
stdio: 'inherit'
});
27 changes: 0 additions & 27 deletions tests/specs/models/stores/config-spec.coffee

This file was deleted.

Loading

0 comments on commit 1b31877

Please sign in to comment.