@theia/application-manager 1.48.0 → 1.48.1
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/README.md +25 -25
- package/lib/application-package-manager.d.ts +45 -45
- package/lib/application-package-manager.js +225 -225
- package/lib/application-process.d.ts +19 -19
- package/lib/application-process.js +72 -72
- package/lib/expose-loader.d.ts +8 -8
- package/lib/expose-loader.js +69 -69
- package/lib/generator/abstract-generator.d.ts +17 -17
- package/lib/generator/abstract-generator.js +57 -57
- package/lib/generator/backend-generator.d.ts +7 -7
- package/lib/generator/backend-generator.js +196 -196
- package/lib/generator/frontend-generator.d.ts +13 -13
- package/lib/generator/frontend-generator.js +212 -212
- package/lib/generator/index.d.ts +3 -3
- package/lib/generator/index.js +21 -21
- package/lib/generator/webpack-generator.d.ts +12 -12
- package/lib/generator/webpack-generator.js +493 -493
- package/lib/index.d.ts +3 -3
- package/lib/index.js +21 -21
- package/lib/package.spec.js +25 -25
- package/lib/rebuild.d.ts +24 -24
- package/lib/rebuild.js +309 -309
- package/package.json +6 -6
- package/src/application-package-manager.ts +263 -263
- package/src/application-process.ts +80 -80
- package/src/expose-loader.ts +80 -80
- package/src/generator/abstract-generator.ts +69 -69
- package/src/generator/backend-generator.ts +198 -198
- package/src/generator/frontend-generator.ts +222 -222
- package/src/generator/index.ts +19 -19
- package/src/generator/webpack-generator.ts +501 -501
- package/src/index.ts +19 -19
- package/src/package.spec.ts +28 -28
- package/src/rebuild.ts +345 -345
|
@@ -1,222 +1,222 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/* eslint-disable @typescript-eslint/indent */
|
|
18
|
-
|
|
19
|
-
import { EOL } from 'os';
|
|
20
|
-
import { AbstractGenerator, GeneratorOptions } from './abstract-generator';
|
|
21
|
-
import { existsSync, readFileSync } from 'fs';
|
|
22
|
-
|
|
23
|
-
export class FrontendGenerator extends AbstractGenerator {
|
|
24
|
-
|
|
25
|
-
async generate(options?: GeneratorOptions): Promise<void> {
|
|
26
|
-
await this.write(this.pck.frontend('index.html'), this.compileIndexHtml(this.pck.targetFrontendModules));
|
|
27
|
-
await this.write(this.pck.frontend('index.js'), this.compileIndexJs(this.pck.targetFrontendModules, this.pck.targetFrontendPreloadModules));
|
|
28
|
-
await this.write(this.pck.frontend('secondary-window.html'), this.compileSecondaryWindowHtml());
|
|
29
|
-
await this.write(this.pck.frontend('secondary-index.js'), this.compileSecondaryIndexJs(this.pck.secondaryWindowModules));
|
|
30
|
-
if (this.pck.isElectron()) {
|
|
31
|
-
await this.write(this.pck.frontend('preload.js'), this.compilePreloadJs());
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
protected compileIndexPreload(frontendModules: Map<string, string>): string {
|
|
36
|
-
const template = this.pck.props.generator.config.preloadTemplate;
|
|
37
|
-
if (!template) {
|
|
38
|
-
return '';
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// Support path to html file
|
|
42
|
-
if (existsSync(template)) {
|
|
43
|
-
return readFileSync(template).toString();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return template;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
protected compileIndexHtml(frontendModules: Map<string, string>): string {
|
|
50
|
-
return `<!DOCTYPE html>
|
|
51
|
-
<html lang="en">
|
|
52
|
-
|
|
53
|
-
<head>${this.compileIndexHead(frontendModules)}
|
|
54
|
-
</head>
|
|
55
|
-
|
|
56
|
-
<body>
|
|
57
|
-
<div class="theia-preload">${this.compileIndexPreload(frontendModules)}</div>
|
|
58
|
-
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
|
|
59
|
-
</body>
|
|
60
|
-
|
|
61
|
-
</html>`;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
protected compileIndexHead(frontendModules: Map<string, string>): string {
|
|
65
|
-
return `
|
|
66
|
-
<meta charset="UTF-8">
|
|
67
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
68
|
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
69
|
-
<title>${this.pck.props.frontend.config.applicationName}</title>`;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
protected compileIndexJs(frontendModules: Map<string, string>, frontendPreloadModules: Map<string, string>): string {
|
|
73
|
-
return `\
|
|
74
|
-
// @ts-check
|
|
75
|
-
${this.ifBrowser("require('es6-promise/auto');")}
|
|
76
|
-
require('reflect-metadata');
|
|
77
|
-
require('setimmediate');
|
|
78
|
-
const { Container } = require('inversify');
|
|
79
|
-
const { FrontendApplicationConfigProvider } = require('@theia/core/lib/browser/frontend-application-config-provider');
|
|
80
|
-
|
|
81
|
-
FrontendApplicationConfigProvider.set(${this.prettyStringify(this.pck.props.frontend.config)});
|
|
82
|
-
|
|
83
|
-
${this.ifMonaco(() => `
|
|
84
|
-
self.MonacoEnvironment = {
|
|
85
|
-
getWorkerUrl: function (moduleId, label) {
|
|
86
|
-
return './editor.worker.js';
|
|
87
|
-
}
|
|
88
|
-
}`)}
|
|
89
|
-
|
|
90
|
-
function load(container, jsModule) {
|
|
91
|
-
return Promise.resolve(jsModule)
|
|
92
|
-
.then(containerModule => container.load(containerModule.default));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async function preload(container) {
|
|
96
|
-
try {
|
|
97
|
-
${Array.from(frontendPreloadModules.values(), jsModulePath => `\
|
|
98
|
-
await load(container, ${this.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
|
|
99
|
-
const { Preloader } = require('@theia/core/lib/browser/preload/preloader');
|
|
100
|
-
const preloader = container.get(Preloader);
|
|
101
|
-
await preloader.initialize();
|
|
102
|
-
} catch (reason) {
|
|
103
|
-
console.error('Failed to run preload scripts.');
|
|
104
|
-
if (reason) {
|
|
105
|
-
console.error(reason);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
module.exports = (async () => {
|
|
111
|
-
const { messagingFrontendModule } = require('@theia/core/lib/${this.pck.isBrowser()
|
|
112
|
-
? 'browser/messaging/messaging-frontend-module'
|
|
113
|
-
: 'electron-browser/messaging/electron-messaging-frontend-module'}');
|
|
114
|
-
const container = new Container();
|
|
115
|
-
container.load(messagingFrontendModule);
|
|
116
|
-
${this.ifBrowserOnly(`const { messagingFrontendOnlyModule } = require('@theia/core/lib/browser-only/messaging/messaging-frontend-only-module');
|
|
117
|
-
container.load(messagingFrontendOnlyModule);`)}
|
|
118
|
-
|
|
119
|
-
await preload(container);
|
|
120
|
-
|
|
121
|
-
${this.ifMonaco(() => `
|
|
122
|
-
const { MonacoInit } = require('@theia/monaco/lib/browser/monaco-init');
|
|
123
|
-
`)};
|
|
124
|
-
|
|
125
|
-
const { FrontendApplication } = require('@theia/core/lib/browser');
|
|
126
|
-
const { frontendApplicationModule } = require('@theia/core/lib/browser/frontend-application-module');
|
|
127
|
-
const { loggerFrontendModule } = require('@theia/core/lib/browser/logger-frontend-module');
|
|
128
|
-
|
|
129
|
-
container.load(frontendApplicationModule);
|
|
130
|
-
${this.pck.ifBrowserOnly(`const { frontendOnlyApplicationModule } = require('@theia/core/lib/browser-only/frontend-only-application-module');
|
|
131
|
-
container.load(frontendOnlyApplicationModule);`)}
|
|
132
|
-
|
|
133
|
-
container.load(loggerFrontendModule);
|
|
134
|
-
${this.ifBrowserOnly(`const { loggerFrontendOnlyModule } = require('@theia/core/lib/browser-only/logger-frontend-only-module');
|
|
135
|
-
container.load(loggerFrontendOnlyModule);`)}
|
|
136
|
-
|
|
137
|
-
try {
|
|
138
|
-
${Array.from(frontendModules.values(), jsModulePath => `\
|
|
139
|
-
await load(container, ${this.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
|
|
140
|
-
${this.ifMonaco(() => `
|
|
141
|
-
MonacoInit.init(container);
|
|
142
|
-
`)};
|
|
143
|
-
await start();
|
|
144
|
-
} catch (reason) {
|
|
145
|
-
console.error('Failed to start the frontend application.');
|
|
146
|
-
if (reason) {
|
|
147
|
-
console.error(reason);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
function start() {
|
|
152
|
-
(window['theia'] = window['theia'] || {}).container = container;
|
|
153
|
-
return container.get(FrontendApplication).start();
|
|
154
|
-
}
|
|
155
|
-
})();
|
|
156
|
-
`;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
protected importOrRequire(): string {
|
|
160
|
-
return this.options.mode !== 'production' ? 'import' : 'require';
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/** HTML for secondary windows that contain an extracted widget. */
|
|
164
|
-
protected compileSecondaryWindowHtml(): string {
|
|
165
|
-
return `<!DOCTYPE html>
|
|
166
|
-
<html lang="en">
|
|
167
|
-
|
|
168
|
-
<head>
|
|
169
|
-
<meta charset="UTF-8">
|
|
170
|
-
<title>Theia — Secondary Window</title>
|
|
171
|
-
<style>
|
|
172
|
-
html, body {
|
|
173
|
-
overflow: hidden;
|
|
174
|
-
-ms-overflow-style: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
body {
|
|
178
|
-
margin: 0;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
html,
|
|
182
|
-
head,
|
|
183
|
-
body,
|
|
184
|
-
.secondary-widget-root,
|
|
185
|
-
#widget-host {
|
|
186
|
-
width: 100% !important;
|
|
187
|
-
height: 100% !important;
|
|
188
|
-
}
|
|
189
|
-
</style>
|
|
190
|
-
<link rel="stylesheet" href="./secondary-window.css">
|
|
191
|
-
</head>
|
|
192
|
-
|
|
193
|
-
<body>
|
|
194
|
-
<div id="widget-host"></div>
|
|
195
|
-
</body>
|
|
196
|
-
|
|
197
|
-
</html>`;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
protected compileSecondaryIndexJs(secondaryWindowModules: Map<string, string>): string {
|
|
201
|
-
return `\
|
|
202
|
-
// @ts-check
|
|
203
|
-
require('reflect-metadata');
|
|
204
|
-
const { Container } = require('inversify');
|
|
205
|
-
|
|
206
|
-
module.exports = Promise.resolve().then(() => {
|
|
207
|
-
const { frontendApplicationModule } = require('@theia/core/lib/browser/frontend-application-module');
|
|
208
|
-
const container = new Container();
|
|
209
|
-
container.load(frontendApplicationModule);
|
|
210
|
-
${Array.from(secondaryWindowModules.values(), jsModulePath => `\
|
|
211
|
-
container.load(require('${jsModulePath}').default);`).join(EOL)}
|
|
212
|
-
});
|
|
213
|
-
`;
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
compilePreloadJs(): string {
|
|
217
|
-
return `\
|
|
218
|
-
// @ts-check
|
|
219
|
-
${Array.from(this.pck.preloadModules.values(), path => `require('${path}').preload();`).join(EOL)}
|
|
220
|
-
`;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
18
|
+
|
|
19
|
+
import { EOL } from 'os';
|
|
20
|
+
import { AbstractGenerator, GeneratorOptions } from './abstract-generator';
|
|
21
|
+
import { existsSync, readFileSync } from 'fs';
|
|
22
|
+
|
|
23
|
+
export class FrontendGenerator extends AbstractGenerator {
|
|
24
|
+
|
|
25
|
+
async generate(options?: GeneratorOptions): Promise<void> {
|
|
26
|
+
await this.write(this.pck.frontend('index.html'), this.compileIndexHtml(this.pck.targetFrontendModules));
|
|
27
|
+
await this.write(this.pck.frontend('index.js'), this.compileIndexJs(this.pck.targetFrontendModules, this.pck.targetFrontendPreloadModules));
|
|
28
|
+
await this.write(this.pck.frontend('secondary-window.html'), this.compileSecondaryWindowHtml());
|
|
29
|
+
await this.write(this.pck.frontend('secondary-index.js'), this.compileSecondaryIndexJs(this.pck.secondaryWindowModules));
|
|
30
|
+
if (this.pck.isElectron()) {
|
|
31
|
+
await this.write(this.pck.frontend('preload.js'), this.compilePreloadJs());
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
protected compileIndexPreload(frontendModules: Map<string, string>): string {
|
|
36
|
+
const template = this.pck.props.generator.config.preloadTemplate;
|
|
37
|
+
if (!template) {
|
|
38
|
+
return '';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Support path to html file
|
|
42
|
+
if (existsSync(template)) {
|
|
43
|
+
return readFileSync(template).toString();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return template;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected compileIndexHtml(frontendModules: Map<string, string>): string {
|
|
50
|
+
return `<!DOCTYPE html>
|
|
51
|
+
<html lang="en">
|
|
52
|
+
|
|
53
|
+
<head>${this.compileIndexHead(frontendModules)}
|
|
54
|
+
</head>
|
|
55
|
+
|
|
56
|
+
<body>
|
|
57
|
+
<div class="theia-preload">${this.compileIndexPreload(frontendModules)}</div>
|
|
58
|
+
<script type="text/javascript" src="./bundle.js" charset="utf-8"></script>
|
|
59
|
+
</body>
|
|
60
|
+
|
|
61
|
+
</html>`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected compileIndexHead(frontendModules: Map<string, string>): string {
|
|
65
|
+
return `
|
|
66
|
+
<meta charset="UTF-8">
|
|
67
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
68
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
69
|
+
<title>${this.pck.props.frontend.config.applicationName}</title>`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
protected compileIndexJs(frontendModules: Map<string, string>, frontendPreloadModules: Map<string, string>): string {
|
|
73
|
+
return `\
|
|
74
|
+
// @ts-check
|
|
75
|
+
${this.ifBrowser("require('es6-promise/auto');")}
|
|
76
|
+
require('reflect-metadata');
|
|
77
|
+
require('setimmediate');
|
|
78
|
+
const { Container } = require('inversify');
|
|
79
|
+
const { FrontendApplicationConfigProvider } = require('@theia/core/lib/browser/frontend-application-config-provider');
|
|
80
|
+
|
|
81
|
+
FrontendApplicationConfigProvider.set(${this.prettyStringify(this.pck.props.frontend.config)});
|
|
82
|
+
|
|
83
|
+
${this.ifMonaco(() => `
|
|
84
|
+
self.MonacoEnvironment = {
|
|
85
|
+
getWorkerUrl: function (moduleId, label) {
|
|
86
|
+
return './editor.worker.js';
|
|
87
|
+
}
|
|
88
|
+
}`)}
|
|
89
|
+
|
|
90
|
+
function load(container, jsModule) {
|
|
91
|
+
return Promise.resolve(jsModule)
|
|
92
|
+
.then(containerModule => container.load(containerModule.default));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function preload(container) {
|
|
96
|
+
try {
|
|
97
|
+
${Array.from(frontendPreloadModules.values(), jsModulePath => `\
|
|
98
|
+
await load(container, ${this.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
|
|
99
|
+
const { Preloader } = require('@theia/core/lib/browser/preload/preloader');
|
|
100
|
+
const preloader = container.get(Preloader);
|
|
101
|
+
await preloader.initialize();
|
|
102
|
+
} catch (reason) {
|
|
103
|
+
console.error('Failed to run preload scripts.');
|
|
104
|
+
if (reason) {
|
|
105
|
+
console.error(reason);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
module.exports = (async () => {
|
|
111
|
+
const { messagingFrontendModule } = require('@theia/core/lib/${this.pck.isBrowser()
|
|
112
|
+
? 'browser/messaging/messaging-frontend-module'
|
|
113
|
+
: 'electron-browser/messaging/electron-messaging-frontend-module'}');
|
|
114
|
+
const container = new Container();
|
|
115
|
+
container.load(messagingFrontendModule);
|
|
116
|
+
${this.ifBrowserOnly(`const { messagingFrontendOnlyModule } = require('@theia/core/lib/browser-only/messaging/messaging-frontend-only-module');
|
|
117
|
+
container.load(messagingFrontendOnlyModule);`)}
|
|
118
|
+
|
|
119
|
+
await preload(container);
|
|
120
|
+
|
|
121
|
+
${this.ifMonaco(() => `
|
|
122
|
+
const { MonacoInit } = require('@theia/monaco/lib/browser/monaco-init');
|
|
123
|
+
`)};
|
|
124
|
+
|
|
125
|
+
const { FrontendApplication } = require('@theia/core/lib/browser');
|
|
126
|
+
const { frontendApplicationModule } = require('@theia/core/lib/browser/frontend-application-module');
|
|
127
|
+
const { loggerFrontendModule } = require('@theia/core/lib/browser/logger-frontend-module');
|
|
128
|
+
|
|
129
|
+
container.load(frontendApplicationModule);
|
|
130
|
+
${this.pck.ifBrowserOnly(`const { frontendOnlyApplicationModule } = require('@theia/core/lib/browser-only/frontend-only-application-module');
|
|
131
|
+
container.load(frontendOnlyApplicationModule);`)}
|
|
132
|
+
|
|
133
|
+
container.load(loggerFrontendModule);
|
|
134
|
+
${this.ifBrowserOnly(`const { loggerFrontendOnlyModule } = require('@theia/core/lib/browser-only/logger-frontend-only-module');
|
|
135
|
+
container.load(loggerFrontendOnlyModule);`)}
|
|
136
|
+
|
|
137
|
+
try {
|
|
138
|
+
${Array.from(frontendModules.values(), jsModulePath => `\
|
|
139
|
+
await load(container, ${this.importOrRequire()}('${jsModulePath}'));`).join(EOL)}
|
|
140
|
+
${this.ifMonaco(() => `
|
|
141
|
+
MonacoInit.init(container);
|
|
142
|
+
`)};
|
|
143
|
+
await start();
|
|
144
|
+
} catch (reason) {
|
|
145
|
+
console.error('Failed to start the frontend application.');
|
|
146
|
+
if (reason) {
|
|
147
|
+
console.error(reason);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function start() {
|
|
152
|
+
(window['theia'] = window['theia'] || {}).container = container;
|
|
153
|
+
return container.get(FrontendApplication).start();
|
|
154
|
+
}
|
|
155
|
+
})();
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
protected importOrRequire(): string {
|
|
160
|
+
return this.options.mode !== 'production' ? 'import' : 'require';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** HTML for secondary windows that contain an extracted widget. */
|
|
164
|
+
protected compileSecondaryWindowHtml(): string {
|
|
165
|
+
return `<!DOCTYPE html>
|
|
166
|
+
<html lang="en">
|
|
167
|
+
|
|
168
|
+
<head>
|
|
169
|
+
<meta charset="UTF-8">
|
|
170
|
+
<title>Theia — Secondary Window</title>
|
|
171
|
+
<style>
|
|
172
|
+
html, body {
|
|
173
|
+
overflow: hidden;
|
|
174
|
+
-ms-overflow-style: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
body {
|
|
178
|
+
margin: 0;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
html,
|
|
182
|
+
head,
|
|
183
|
+
body,
|
|
184
|
+
.secondary-widget-root,
|
|
185
|
+
#widget-host {
|
|
186
|
+
width: 100% !important;
|
|
187
|
+
height: 100% !important;
|
|
188
|
+
}
|
|
189
|
+
</style>
|
|
190
|
+
<link rel="stylesheet" href="./secondary-window.css">
|
|
191
|
+
</head>
|
|
192
|
+
|
|
193
|
+
<body>
|
|
194
|
+
<div id="widget-host"></div>
|
|
195
|
+
</body>
|
|
196
|
+
|
|
197
|
+
</html>`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
protected compileSecondaryIndexJs(secondaryWindowModules: Map<string, string>): string {
|
|
201
|
+
return `\
|
|
202
|
+
// @ts-check
|
|
203
|
+
require('reflect-metadata');
|
|
204
|
+
const { Container } = require('inversify');
|
|
205
|
+
|
|
206
|
+
module.exports = Promise.resolve().then(() => {
|
|
207
|
+
const { frontendApplicationModule } = require('@theia/core/lib/browser/frontend-application-module');
|
|
208
|
+
const container = new Container();
|
|
209
|
+
container.load(frontendApplicationModule);
|
|
210
|
+
${Array.from(secondaryWindowModules.values(), jsModulePath => `\
|
|
211
|
+
container.load(require('${jsModulePath}').default);`).join(EOL)}
|
|
212
|
+
});
|
|
213
|
+
`;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
compilePreloadJs(): string {
|
|
217
|
+
return `\
|
|
218
|
+
// @ts-check
|
|
219
|
+
${Array.from(this.pck.preloadModules.values(), path => `require('${path}').preload();`).join(EOL)}
|
|
220
|
+
`;
|
|
221
|
+
}
|
|
222
|
+
}
|
package/src/generator/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
export * from './webpack-generator';
|
|
18
|
-
export * from './frontend-generator';
|
|
19
|
-
export * from './backend-generator';
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
export * from './webpack-generator';
|
|
18
|
+
export * from './frontend-generator';
|
|
19
|
+
export * from './backend-generator';
|