@kumologica/sdk 3.3.0-beta9 → 3.4.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/open.js +6 -7
- package/cli/commands/test-commands/TestSuiteRunner.js +75 -0
- package/cli/commands/test-commands/lib/TestCaseRunner.js +105 -0
- package/cli/commands/test-commands/lib/index.js +12 -0
- package/cli/commands/test-commands/lib/reporters/index.js +120 -0
- package/cli/commands/test.js +92 -120
- package/package.json +4 -5
- package/src/app/lib/stores/store.js +15 -1
- package/src/app/lib/stores/user-preference-store.js +2 -0
- package/src/app/lib/stores/workspace-preference-store.js +42 -0
- package/src/app/main-process/editor-manager.js +11 -51
- package/src/app/main-process/main-window.js +10 -0
- package/src/app/main-process/menu.js +4 -2
- package/src/app/main-process/modal-home.js +5 -7
- package/src/app/main-process/modal-newproject.js +4 -6
- package/src/app/main-process/modal-newtab.js +4 -6
- package/src/app/main-process/modal-nodelibrary.js +4 -6
- package/src/app/main-process/modal-welcome.js +5 -8
- package/src/app/main.js +3 -1
- package/src/app/preload.js +28 -4
- package/src/app/ui/editor-api/lib/index.js +6 -9
- package/src/app/ui/editor-client/public/red/red.js +434 -176
- package/src/app/ui/editor-client/public/red/red.min.js +3 -3
- package/src/app/ui/editor-client/public/red/style.min.css +1 -1
- package/src/app/ui/editor-client/public/vendor/vendor.css +21 -1
- package/src/app/ui/editor-client/src/js/red.js +1 -1
- package/src/app/ui/editor-client/src/js/ui/clipboard.js +8 -0
- package/src/app/ui/editor-client/src/js/ui/header.js +2 -40
- package/src/app/ui/editor-client/src/js/ui/palette-explorer.js +328 -0
- package/src/app/ui/editor-client/src/js/ui/palette.js +10 -8
- package/src/app/ui/editor-client/src/js/ui/project-info.js +10 -8
- package/src/app/ui/editor-client/src/js/ui/search.js +147 -44
- package/src/app/ui/editor-client/src/js/ui/ui-settings.js +1 -1
- package/src/app/ui/editor-client/src/js/ui/view.js +2 -5
- package/src/app/ui/editor-client/src/js/validators.js +2 -2
- package/src/app/ui/editor-client/src/sass/dropdownMenu.scss +1 -1
- package/src/app/ui/editor-client/src/sass/editor.scss +1 -0
- package/src/app/ui/editor-client/src/sass/header.scss +16 -7
- package/src/app/ui/editor-client/src/sass/palette.scss +46 -5
- package/src/app/ui/editor-client/src/sass/project-info.scss +4 -3
- package/src/app/ui/editor-client/src/sass/search.scss +49 -21
- package/src/app/ui/editor-client/src/sass/style.scss +1 -0
- package/src/app/ui/editor-client/src/sass/ui/common/editableList.scss +3 -3
- package/src/app/ui/editor-client/src/sass/ui/common/searchBox.scss +1 -2
- package/src/app/ui/editor-client/src/sass/ui-settings.scss +5 -3
- package/src/app/ui/editor-client/src/vendor/jqtree/jqtree.css +21 -1
- package/src/app/ui/editor-client/templates/index.mst +89 -79
- package/src/server/DesignerServer.js +161 -0
- package/src/server/certificate.pem +23 -0
- package/src/server/private-key.pem +28 -0
- package/cli/commands/test-utils/TestSuiteController.js +0 -363
- package/cli/commands/test-utils/TestSuiteController.test.js +0 -171
- package/cli/commands/test-utils/util/output.js +0 -14
- package/cli/commands/test-utils/util/updates/index.js +0 -17
- package/cli/commands/test-utils/util/updates/pkg.js +0 -13
- package/cli/commands/test-utils/util/updates/templates/default-settings.js +0 -209
- package/src/app/ui/editor-client/src/js/ui/palette-navigator.js +0 -144
- /package/cli/commands/{test-utils → test-commands/lib}/fixtures/example3-flow.json +0 -0
- /package/cli/commands/{test-utils → test-commands/lib}/fixtures/package.json +0 -0
- /package/cli/commands/{test-utils → test-commands/lib}/fixtures/s3-event.js +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// properties
|
|
2
|
+
const defaultKeys = {
|
|
3
|
+
workspaceProjects: 'workspaceProjects',
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
const MAX_NUM_WORKSPACE_PROJECTS = 100;
|
|
8
|
+
|
|
9
|
+
const Store = require('./store');
|
|
10
|
+
class WorkspacePreferenceStore extends Store {
|
|
11
|
+
constructor(defaults) {
|
|
12
|
+
super({defaults: {}, configName: 'workspace-preferences' });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
addProjectToWorkspace(projectDir) {
|
|
16
|
+
// make sure we dont include the untitled project to the list of
|
|
17
|
+
// recent projects
|
|
18
|
+
if (projectDir.startsWith(super.getUserDataPath())) {
|
|
19
|
+
console.log('[workspace-preference-store] skipping saving')
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
super.addUnique(
|
|
23
|
+
defaultKeys.workspaceProjects,
|
|
24
|
+
projectDir,
|
|
25
|
+
MAX_NUM_WORKSPACE_PROJECTS
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
removeProjectFromWorkspace(projectDir) {
|
|
30
|
+
super.remove(defaultKeys.workspaceProjects, projectDir);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getWorkspaceProjects() {
|
|
34
|
+
return super.get(defaultKeys.workspaceProjects);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
WorkspacePreferenceStore,
|
|
41
|
+
defaultKeys
|
|
42
|
+
};
|
|
@@ -1,36 +1,21 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const fs = require('fs-extra');
|
|
3
3
|
const { dialog } = require('electron');
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
const { findAllFlowFiles } = require('../lib/utils/editor');
|
|
6
6
|
|
|
7
7
|
const editorApi = require('../ui/editor-api/lib');
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async function allocatePort(port) {
|
|
12
|
-
let inUse = await tcpPortUsed.check(port);
|
|
13
|
-
if (inUse){
|
|
14
|
-
let newPort = port + 1;
|
|
15
|
-
console.log(`> Port: ${port} in use. Trying with port: ${newPort}...`);
|
|
16
|
-
return await allocatePort(newPort);
|
|
17
|
-
} else{
|
|
18
|
-
return port;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
8
|
+
const { DesignerServer } = require('../../server/DesignerServer');
|
|
22
9
|
|
|
23
10
|
class EditorManagerClass {
|
|
24
11
|
currentUserProjectDir = null;
|
|
25
12
|
previousUserProjectDir = null;
|
|
26
13
|
appServer = null;
|
|
27
|
-
port = 1880;
|
|
28
14
|
|
|
29
15
|
constructor() {
|
|
30
16
|
this.start = this.start.bind(this);
|
|
31
17
|
this.readEnv = this.readEnv.bind(this);
|
|
32
18
|
this.getPort = this.getPort.bind(this);
|
|
33
|
-
this.setPort = this.setPort.bind(this);
|
|
34
19
|
this.stop = this.stop.bind(this);
|
|
35
20
|
|
|
36
21
|
}
|
|
@@ -47,7 +32,6 @@ class EditorManagerClass {
|
|
|
47
32
|
// Update state of the object
|
|
48
33
|
this.previousUserProjectDir = this.currentUserProjectDir;
|
|
49
34
|
this.currentUserProjectDir = userProjectDir;
|
|
50
|
-
|
|
51
35
|
|
|
52
36
|
try{
|
|
53
37
|
let flowFilePath = await this._findFlowFile(userProjectDir);
|
|
@@ -56,35 +40,15 @@ class EditorManagerClass {
|
|
|
56
40
|
if (this.appServer !== null) {
|
|
57
41
|
await this.appServer.stop();
|
|
58
42
|
}
|
|
59
|
-
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (constParams === 6) {
|
|
67
|
-
// Runtime <= 2.0.11
|
|
68
|
-
this.appServer = new AppServer(
|
|
69
|
-
flowFilePath, // full path of the flow.json file
|
|
70
|
-
this.getPort(), // port
|
|
71
|
-
AppServer.mode.KUMOLOGICA_DESIGNER,
|
|
72
|
-
undefined, //loglevel
|
|
73
|
-
editorApi,
|
|
74
|
-
startupEmitter);
|
|
75
|
-
} else if (constParams === 1) {
|
|
76
|
-
this.appServer = new AppServer({
|
|
77
|
-
projectDir: this.currentUserProjectDir,
|
|
78
|
-
flowFilePath: flowFilePath,
|
|
79
|
-
port: this.getPort(),
|
|
80
|
-
serverMode: AppServer.mode.KUMOLOGICA_DESIGNER,
|
|
81
|
-
logLevel: undefined,
|
|
82
|
-
editorApi: editorApi,
|
|
83
|
-
startupEmitter: startupEmitter
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
-
throw new Error('Runtime version is incompatible with this designer');
|
|
43
|
+
|
|
44
|
+
let options = {
|
|
45
|
+
flowPath: flowFilePath,
|
|
46
|
+
safe: false,
|
|
47
|
+
cliParams: {},
|
|
48
|
+
editorApi: editorApi,
|
|
49
|
+
startupEmitter: startupEmitter
|
|
87
50
|
}
|
|
51
|
+
this.appServer = new DesignerServer(options);
|
|
88
52
|
|
|
89
53
|
// Persist the server settings in the window global scope for the ui to access.
|
|
90
54
|
await this.appServer.start();
|
|
@@ -111,11 +75,7 @@ class EditorManagerClass {
|
|
|
111
75
|
}
|
|
112
76
|
|
|
113
77
|
getPort() {
|
|
114
|
-
return this.
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
setPort(newPort) {
|
|
118
|
-
this.port = newPort;
|
|
78
|
+
return this.appServer.getListeningPort();
|
|
119
79
|
}
|
|
120
80
|
|
|
121
81
|
/**
|
|
@@ -53,9 +53,12 @@ class MainWindow {
|
|
|
53
53
|
icon: path.join(__dirname, '../ui/editor-client/src/kumologica-app.png'),
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
+
|
|
56
57
|
this.window = new BrowserWindow(windowOptions);
|
|
57
58
|
this.window.maximize();
|
|
58
59
|
|
|
60
|
+
require('@electron/remote/main').enable(this.window.webContents);
|
|
61
|
+
|
|
59
62
|
this.window.on('focus', () => this.window.webContents.send('focus'));
|
|
60
63
|
this.window.on('blur', () => this.window.webContents.send('blur'));
|
|
61
64
|
this.window.on('resize', () => {
|
|
@@ -86,6 +89,8 @@ class MainWindow {
|
|
|
86
89
|
this.window.webContents.on('did-finish-load', () => {
|
|
87
90
|
// this.checkForUpdates();
|
|
88
91
|
this.updateProjectInfo(this.lastUserProjectDir, this.lastFlowfile || "__untitled__");
|
|
92
|
+
this.sendUserPreferencesToRenderer(this.store);
|
|
93
|
+
|
|
89
94
|
this.emitter.emit('did-load', null);
|
|
90
95
|
|
|
91
96
|
if (this.startupErrorEvent) {
|
|
@@ -144,6 +149,11 @@ class MainWindow {
|
|
|
144
149
|
autoUpdater.checkForUpdates().catch(console.error);
|
|
145
150
|
}
|
|
146
151
|
|
|
152
|
+
sendUserPreferencesToRenderer(store){
|
|
153
|
+
// Pass the userPreference store to the renderer to handle the workspace projects.
|
|
154
|
+
this.window.webContents.send('user-preferences:set', store);
|
|
155
|
+
}
|
|
156
|
+
|
|
147
157
|
// TODO: #javier - show error if flow file is not found
|
|
148
158
|
updateProjectInfo(newProjectDir, flowFilePath) {
|
|
149
159
|
this.lastUserProjectDir = newProjectDir;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
let { Menu, app, ipcMain } = require('electron');
|
|
2
2
|
|
|
3
3
|
const isMac = process.platform === 'darwin';
|
|
4
|
+
const isWindows = process.platform === 'win32';
|
|
5
|
+
const isLinux = process.platform === 'linux';
|
|
4
6
|
|
|
5
7
|
let dockTemplate = [
|
|
6
8
|
{
|
|
@@ -104,7 +106,7 @@ let productionTemplate = [
|
|
|
104
106
|
},
|
|
105
107
|
{ type: 'separator' },
|
|
106
108
|
{
|
|
107
|
-
label: '
|
|
109
|
+
label: 'Search Node...',
|
|
108
110
|
accelerator: 'CmdOrCtrl+F',
|
|
109
111
|
click() {
|
|
110
112
|
ipcMain.emit('core:search');
|
|
@@ -296,7 +298,7 @@ let devTemplate = [
|
|
|
296
298
|
},
|
|
297
299
|
{ type: 'separator' },
|
|
298
300
|
{
|
|
299
|
-
label: '
|
|
301
|
+
label: 'Search Node...',
|
|
300
302
|
accelerator: 'CmdOrCtrl+F',
|
|
301
303
|
click() {
|
|
302
304
|
ipcMain.emit('core:search');
|
|
@@ -2,20 +2,18 @@ const electron = require('electron');
|
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const url = require('url');
|
|
4
4
|
const EventEmitter = require('events');
|
|
5
|
+
|
|
5
6
|
const dependencies = require('../lib/dependencies.js');
|
|
6
7
|
const editorManager = require('./editor-manager');
|
|
7
|
-
const PORT = editorManager.getPort();
|
|
8
8
|
|
|
9
|
-
const { BrowserWindow } = electron;
|
|
9
|
+
const { BrowserWindow, app } = electron;
|
|
10
10
|
const preloadJsPath = path.join(__dirname, '..', 'preload.js');
|
|
11
|
-
const {app} = require('electron');
|
|
12
11
|
|
|
13
12
|
class ModalHome {
|
|
14
|
-
// Properties
|
|
15
13
|
window = null;
|
|
16
14
|
|
|
17
|
-
// Methods
|
|
18
15
|
constructor(listRecentProjects) {
|
|
16
|
+
this.port = editorManager.getPort();
|
|
19
17
|
this.headless = false;
|
|
20
18
|
this.listRecentProjects = listRecentProjects;
|
|
21
19
|
this.emitter = new EventEmitter();
|
|
@@ -34,7 +32,7 @@ class ModalHome {
|
|
|
34
32
|
preload: preloadJsPath,
|
|
35
33
|
contextIsolation: false,
|
|
36
34
|
enableRemoteModule: true,
|
|
37
|
-
additionalArguments: [`--port=${
|
|
35
|
+
additionalArguments: [`--port=${this.port}`]
|
|
38
36
|
},
|
|
39
37
|
show: false
|
|
40
38
|
};
|
|
@@ -83,7 +81,7 @@ class ModalHome {
|
|
|
83
81
|
load() {
|
|
84
82
|
this.window.loadURL(
|
|
85
83
|
url.format({
|
|
86
|
-
pathname: `127.0.0.1:${
|
|
84
|
+
pathname: `127.0.0.1:${this.port}/__home`,
|
|
87
85
|
protocol: 'http:',
|
|
88
86
|
slashes: true
|
|
89
87
|
}),
|
|
@@ -4,14 +4,12 @@ const url = require('url');
|
|
|
4
4
|
const { BrowserWindow } = electron;
|
|
5
5
|
const preloadJsPath = path.join(__dirname, '..', 'preload.js');
|
|
6
6
|
const editorManager = require('./editor-manager');
|
|
7
|
-
const PORT = editorManager.getPort();
|
|
8
7
|
|
|
9
8
|
class ModalNewProject {
|
|
10
|
-
// Properties
|
|
11
9
|
window = null;
|
|
12
|
-
|
|
13
|
-
// Methods
|
|
10
|
+
|
|
14
11
|
constructor(parentWindow, cancellable) {
|
|
12
|
+
this.port = editorManager.getPort();
|
|
15
13
|
this.cancellable = cancellable;
|
|
16
14
|
let windowOptions = {
|
|
17
15
|
parent: parentWindow,
|
|
@@ -29,7 +27,7 @@ class ModalNewProject {
|
|
|
29
27
|
preload: preloadJsPath,
|
|
30
28
|
enableRemoteModule: true,
|
|
31
29
|
contextIsolation: false,
|
|
32
|
-
additionalArguments: [`--port=${
|
|
30
|
+
additionalArguments: [`--port=${this.port}`]
|
|
33
31
|
},
|
|
34
32
|
show: false,
|
|
35
33
|
};
|
|
@@ -60,7 +58,7 @@ class ModalNewProject {
|
|
|
60
58
|
load() {
|
|
61
59
|
this.window.loadURL(
|
|
62
60
|
url.format({
|
|
63
|
-
pathname: `127.0.0.1:${
|
|
61
|
+
pathname: `127.0.0.1:${this.port}/__newProject`,
|
|
64
62
|
protocol: 'http:',
|
|
65
63
|
slashes: true,
|
|
66
64
|
}),
|
|
@@ -5,14 +5,12 @@ const { BrowserWindow } = electron;
|
|
|
5
5
|
const { isMac, isWin } = require('../util');
|
|
6
6
|
const preloadJsPath = path.join(__dirname, '..', 'preload.js');
|
|
7
7
|
const editorManager = require('./editor-manager');
|
|
8
|
-
const PORT = editorManager.getPort();
|
|
9
8
|
|
|
10
9
|
class ModalNewTab {
|
|
11
|
-
// Properties
|
|
12
10
|
window = null;
|
|
13
|
-
|
|
14
|
-
// Methods
|
|
11
|
+
|
|
15
12
|
constructor(parentWindow, cancellable) {
|
|
13
|
+
this.port = editorManager.getPort();
|
|
16
14
|
this.cancellable = cancellable;
|
|
17
15
|
let windowOptions = {
|
|
18
16
|
parent: parentWindow,
|
|
@@ -30,7 +28,7 @@ class ModalNewTab {
|
|
|
30
28
|
preload: preloadJsPath,
|
|
31
29
|
enableRemoteModule: true,
|
|
32
30
|
contextIsolation: false,
|
|
33
|
-
additionalArguments: [`--port=${
|
|
31
|
+
additionalArguments: [`--port=${this.port}`]
|
|
34
32
|
},
|
|
35
33
|
show: false,
|
|
36
34
|
};
|
|
@@ -65,7 +63,7 @@ class ModalNewTab {
|
|
|
65
63
|
load() {
|
|
66
64
|
this.window.loadURL(
|
|
67
65
|
url.format({
|
|
68
|
-
pathname: `127.0.0.1:${
|
|
66
|
+
pathname: `127.0.0.1:${this.port}/__newTab`,
|
|
69
67
|
protocol: 'http:',
|
|
70
68
|
slashes: true,
|
|
71
69
|
}),
|
|
@@ -4,16 +4,14 @@ const url = require('url');
|
|
|
4
4
|
const { BrowserWindow } = electron;
|
|
5
5
|
const preloadJsPath = path.join(__dirname, '..', 'preload.js');
|
|
6
6
|
const editorManager = require('./editor-manager');
|
|
7
|
-
const PORT = editorManager.getPort();
|
|
8
7
|
|
|
9
8
|
class ModalNodeLibrary {
|
|
10
|
-
// Properties
|
|
11
9
|
window = null;
|
|
12
10
|
|
|
13
|
-
// Methods
|
|
14
11
|
constructor(parentWindow, cancellable) {
|
|
12
|
+
this.port = editorManager.getPort();
|
|
15
13
|
let iconPath = path.join(__dirname, 'favicon.ico');
|
|
16
|
-
|
|
14
|
+
|
|
17
15
|
this.cancellable = cancellable;
|
|
18
16
|
let windowOptions = {
|
|
19
17
|
parent: parentWindow,
|
|
@@ -32,7 +30,7 @@ class ModalNodeLibrary {
|
|
|
32
30
|
preload: preloadJsPath,
|
|
33
31
|
contextIsolation: false,
|
|
34
32
|
enableRemoteModule: true,
|
|
35
|
-
additionalArguments: [`--port=${
|
|
33
|
+
additionalArguments: [`--port=${this.port}`]
|
|
36
34
|
},
|
|
37
35
|
show: false
|
|
38
36
|
};
|
|
@@ -63,7 +61,7 @@ class ModalNodeLibrary {
|
|
|
63
61
|
load() {
|
|
64
62
|
this.window.loadURL(
|
|
65
63
|
url.format({
|
|
66
|
-
pathname: `127.0.0.1:${
|
|
64
|
+
pathname: `127.0.0.1:${this.port}/__nodeLibrary`,
|
|
67
65
|
protocol: 'http:',
|
|
68
66
|
slashes: true
|
|
69
67
|
}),
|
|
@@ -4,19 +4,16 @@ const url = require('url');
|
|
|
4
4
|
const EventEmitter = require('events');
|
|
5
5
|
const dependencies = require('../lib/dependencies.js');
|
|
6
6
|
|
|
7
|
-
const { BrowserWindow } = electron;
|
|
7
|
+
const { BrowserWindow, app } = electron;
|
|
8
8
|
const preloadJsPath = path.join(__dirname, '..', 'preload.js');
|
|
9
9
|
const editorManager = require('./editor-manager');
|
|
10
|
-
const PORT = editorManager.getPort();
|
|
11
|
-
|
|
12
|
-
const { app } = require('electron');
|
|
13
10
|
|
|
14
11
|
class ModalWelcome {
|
|
15
|
-
// Properties
|
|
16
12
|
window = null;
|
|
17
|
-
|
|
13
|
+
|
|
18
14
|
// Methods
|
|
19
15
|
constructor() {
|
|
16
|
+
this.port = editorManager.getPort();
|
|
20
17
|
this.emitter = new EventEmitter();
|
|
21
18
|
let windowOptions = {
|
|
22
19
|
modal: true,
|
|
@@ -33,7 +30,7 @@ class ModalWelcome {
|
|
|
33
30
|
preload: preloadJsPath,
|
|
34
31
|
contextIsolation: false,
|
|
35
32
|
enableRemoteModule: true,
|
|
36
|
-
additionalArguments: [`--port=${
|
|
33
|
+
additionalArguments: [`--port=${this.port}`]
|
|
37
34
|
},
|
|
38
35
|
show: false
|
|
39
36
|
};
|
|
@@ -80,7 +77,7 @@ class ModalWelcome {
|
|
|
80
77
|
load() {
|
|
81
78
|
this.window.loadURL(
|
|
82
79
|
url.format({
|
|
83
|
-
pathname: `127.0.0.1:${
|
|
80
|
+
pathname: `127.0.0.1:${this.port}/__welcome`,
|
|
84
81
|
protocol: 'http:',
|
|
85
82
|
slashes: true
|
|
86
83
|
}),
|
package/src/app/main.js
CHANGED
|
@@ -120,7 +120,8 @@ ipcMain.on('modal-home:show-dialog-openproject', () => {
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
ipcMain.on('modal-home:open-project-in-editor', async (event, msg) => {
|
|
123
|
-
|
|
123
|
+
console.log('[main] msg requested to open project:', msg);
|
|
124
|
+
if (currentModalWindow) currentModalWindow.close();
|
|
124
125
|
await openProjectEditor(msg.payload.projectLocation);
|
|
125
126
|
});
|
|
126
127
|
|
|
@@ -399,6 +400,7 @@ function runtimeEventListener(event) {
|
|
|
399
400
|
}
|
|
400
401
|
|
|
401
402
|
async function openProjectEditor(projectDir, onDidLoad) {
|
|
403
|
+
console.log('[main] openProjectDir:', projectDir)
|
|
402
404
|
try {
|
|
403
405
|
let startupErrorEvent;
|
|
404
406
|
startupEmitter = new EventEmitter();
|
package/src/app/preload.js
CHANGED
|
@@ -6,7 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
const { AppServer, lambdify } = require('./lib/runtime-loader');
|
|
9
|
+
// const { AppServer, lambdify } = require('./lib/runtime-loader');
|
|
10
|
+
const { lambdify } = require('@kumologica/runtime');
|
|
11
|
+
const { codegen } = require('@kumologica/builder');
|
|
12
|
+
|
|
13
|
+
const { DesignerServer } = require('../server/DesignerServer')
|
|
10
14
|
|
|
11
15
|
const { Terminal } = require('xterm');
|
|
12
16
|
const { FitAddon } = require('xterm-addon-fit');
|
|
@@ -39,6 +43,8 @@ const AWSDeployer = require('./lib/aws');
|
|
|
39
43
|
const ServerlessDeployer = require('./lib/serverless');
|
|
40
44
|
const GithubDeployer = require('./lib/github');
|
|
41
45
|
|
|
46
|
+
const { WorkspacePreferenceStore } = require('./lib/stores/workspace-preference-store');
|
|
47
|
+
|
|
42
48
|
const Kumohub = require('./lib/kumohub');
|
|
43
49
|
const deployCli = require('@kumologica/builder');
|
|
44
50
|
const Azure = require('./lib/azure');
|
|
@@ -552,12 +558,12 @@ function dispatch(type, payload) {
|
|
|
552
558
|
ipcRenderer.send(type, payload);
|
|
553
559
|
}
|
|
554
560
|
|
|
561
|
+
|
|
555
562
|
window.__kumologica = {};
|
|
556
563
|
window.__kumologica.electron = electron;
|
|
557
564
|
window.__kumologica.electron.remote = remote;
|
|
558
565
|
|
|
559
566
|
|
|
560
|
-
|
|
561
567
|
// Present a contract to interact with main process
|
|
562
568
|
window.__kumologica.main = {};
|
|
563
569
|
window.__kumologica.main.dispatch = dispatch;
|
|
@@ -583,11 +589,18 @@ window.__kumologica.settings.loadConfigs = loadConfigs;
|
|
|
583
589
|
|
|
584
590
|
window.__kumologica.settings.cloudConfigStore = cloudConfigStore;
|
|
585
591
|
window.__kumologica.settings.networkConfigStore = networkConfigStore;
|
|
592
|
+
window.__kumologica.settings.workspacePreferenceStore = new WorkspacePreferenceStore();
|
|
593
|
+
|
|
594
|
+
window.__kumologica.settings.platform = {};
|
|
595
|
+
window.__kumologica.settings.platform.isMac = process.platform === 'darwin';
|
|
596
|
+
window.__kumologica.settings.platform.isWindows = process.platform === 'win32';
|
|
597
|
+
window.__kumologica.settings.platform.isLinux = process.platform === 'linux';
|
|
598
|
+
|
|
586
599
|
|
|
587
600
|
// Present a contract to interact with runtime project
|
|
588
601
|
window.__kumologica.runtime = {};
|
|
589
|
-
window.__kumologica.runtime.version =
|
|
590
|
-
window.__kumologica.runtime.RED =
|
|
602
|
+
window.__kumologica.runtime.version = DesignerServer.version();
|
|
603
|
+
window.__kumologica.runtime.RED = DesignerServer;
|
|
591
604
|
window.__kumologica.runtime.port = port;
|
|
592
605
|
|
|
593
606
|
// cloud capability
|
|
@@ -632,6 +645,17 @@ window.__kumologica.libs.openFolder = openFolder;
|
|
|
632
645
|
window.__kumologica.libs.dagre = dagre;
|
|
633
646
|
window.__kumologica.libs.simpleGit = simpleGit;
|
|
634
647
|
|
|
648
|
+
/**
|
|
649
|
+
* Return the name of the valid kumologica flow or undefined otherwise.
|
|
650
|
+
* @param {} projectDir
|
|
651
|
+
* @returns
|
|
652
|
+
*/
|
|
653
|
+
function findValidKumologicaFlowInDir(projectDir) {
|
|
654
|
+
return codegen.findFlowFile(projectDir);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
window.__kumologica.libs.findKumologicaFlowInDir = findValidKumologicaFlowInDir;
|
|
658
|
+
|
|
635
659
|
// Node Library
|
|
636
660
|
window.__kumologica.nodeLibrary = {};
|
|
637
661
|
window.__kumologica.nodeLibrary.baseURL = KUMOLOGICA_NODE_LIB_BASEURL;
|
|
@@ -76,16 +76,13 @@ function init(userSettings, _server, storage, runtimeAPI) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
// Editor
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
79
|
+
|
|
80
|
+
editor = require('./editor');
|
|
81
|
+
var editorApp = editor.init(server, settings, runtimeAPI);
|
|
82
|
+
adminApp.use(editorApp);
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
adminApp.use(corsHandler);
|
|
88
|
-
}
|
|
84
|
+
// var corsHandler = cors(settings.httpAdminCors);
|
|
85
|
+
// adminApp.use(corsHandler);
|
|
89
86
|
|
|
90
87
|
var adminApiApp = require('./admin').init(runtimeAPI);
|
|
91
88
|
adminApp.use(adminApiApp);
|