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