Skip to content

Commit

Permalink
chore(app): make multi-repo and build using electron-builder
Browse files Browse the repository at this point in the history
Related to #787
  • Loading branch information
nikku committed May 23, 2018
1 parent e783c77 commit 51b07f3
Show file tree
Hide file tree
Showing 17 changed files with 5,449 additions and 2,850 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
app/node_modules/
client/node_modules/
distro/
docs/
Expand Down
124 changes: 0 additions & 124 deletions Gruntfile.js

This file was deleted.

34 changes: 34 additions & 0 deletions app/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';

var getAppVersion = require('./util/get-version');

var app = require('./lib');

app.developmentMode = true;

app.version = getAppVersion(require('./package'), {
nightly: 'dev'
});


if (!global.metaData) {
global.metaData = {};
}

global.metaData.version = app.version;

// make sure the app quits and does not hang
app.on('before-quit', function() {
app.exit(0);
});

app.on('app:window-created', function() {
app.menu.rebuild();
});

try {
require('electron-reloader')(module);
} catch (err) {
console.log(err);
// ignore it
}
40 changes: 0 additions & 40 deletions app/develop/index.js

This file was deleted.

14 changes: 10 additions & 4 deletions app/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Platform.create(process.platform, app, config);
// variable for developing (reloading and devtools toggling)
app.developmentMode = false;

app.version = require('../../package').version;
app.version = require('../package').version;
app.name = 'Camunda Modeler';

// this is shared variable between main and renderer processes
Expand Down Expand Up @@ -349,14 +349,20 @@ app.on('web-contents-created', (event, webContents) => {
*/
app.createEditorWindow = function() {

var mainWindow = app.mainWindow = new BrowserWindow({
var windowOptions = {
resizable: true,
title: 'Camunda Modeler'
});
};

if (process.platform === 'linux') {
windowOptions.icon = path.join(__dirname + '/../resources/favicon.png');
}

var mainWindow = app.mainWindow = new BrowserWindow(windowOptions);

mainWindow.maximize();

mainWindow.loadURL('file://' + path.resolve(__dirname + '/../../public/index.html'));
mainWindow.loadURL('file://' + path.resolve(__dirname + '/../public/index.html'));

// handling case when user clicks on window close button
mainWindow.on('close', function(e) {
Expand Down
28 changes: 28 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "camunda-modeler",
"version": "1.14.0",
"description": "Camunda Modeler for BPMN, DMN and CMMN, based on bpmn.io",
"private": true,
"main": "lib/index.js",
"author": {
"name": "camunda Services GmbH",
"email": "info@camunda.com",
"url": "https://camunda.com"
},
"devDependencies": {
"electron-reload": "^1.2.2"
},
"dependencies": {
"form-data": "^2.3.1",
"glob": "^7.0.3",
"got": "^8.0.3",
"inherits": "^2.0.1",
"min-dash": "^3.0.0",
"parents": "^1.0.1"
},
"homepage": "https://github.com/camunda/camunda-modeler",
"repository": {
"type": "git",
"url": "https://github.com/camunda/camunda-modeler"
}
}
22 changes: 0 additions & 22 deletions app/util/patch-pkg-version.js

This file was deleted.

16 changes: 8 additions & 8 deletions client/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function(grunt) {
browserify: {
client: {
src: 'lib/index.js',
target: '../public/index.js'
target: '../app/public/index.js'
}
},

Expand All @@ -33,15 +33,15 @@ module.exports = function(grunt) {
files: [
{
src: 'lib/index.html',
dest: '../public/index.html'
dest: '../app/public/index.html'
}
]
},
app_fonts: {
files: [
{
src: 'fonts/app.*',
dest: '../public/fonts/',
dest: '../app/public/fonts/',
expand: true,
flatten: true
}
Expand All @@ -52,7 +52,7 @@ module.exports = function(grunt) {
{
cwd: 'node_modules/cmmn-js/dist/',
src: [ '**/*', '!**/*.js' ],
dest: '../public/vendor/cmmn-js/',
dest: '../app/public/vendor/cmmn-js/',
expand: true
}
]
Expand All @@ -62,7 +62,7 @@ module.exports = function(grunt) {
{
cwd: 'node_modules/dmn-js/dist/',
src: [ '**/*', '!**/*.js' ],
dest: '../public/vendor/dmn-js/',
dest: '../app/public/vendor/dmn-js/',
expand: true
}
]
Expand All @@ -72,7 +72,7 @@ module.exports = function(grunt) {
{
cwd: 'node_modules/bpmn-js/dist/',
src: [ '**/*', '!**/*.js' ],
dest: '../public/vendor/bpmn-js/',
dest: '../app/public/vendor/bpmn-js/',
expand: true
}
]
Expand All @@ -82,7 +82,7 @@ module.exports = function(grunt) {
{
cwd: 'node_modules/diagram-js/',
src: [ '!**/*.js', 'assets/**/*' ],
dest: '../public/vendor/diagram-js/',
dest: '../app/public/vendor/diagram-js/',
expand: true
}
]
Expand All @@ -99,7 +99,7 @@ module.exports = function(grunt) {
]
},
files: {
'../public/css/style.css': 'styles/app.less'
'../app/public/css/style.css': 'styles/app.less'
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "camunda-modeler-client",
"version": "0.0.0",
"version": "1.14.0",
"description": "Camunda Modeler client application",
"private": true,
"scripts": {
"test": "cross-env NODE_ENV=test grunt test",
"auto-test": "cross-env NODE_ENV=test grunt auto-test",
Expand Down
Loading

0 comments on commit 51b07f3

Please sign in to comment.