@sap-ux/ui5-application-writer 0.14.6 → 0.16.0
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/dist/data/ui5Libs.d.ts +42 -0
- package/dist/data/ui5Libs.js +40 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +11 -2
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
- package/templates/core/webapp/index.html +1 -1
- package/templates/optional/loadReuseLibs/webapp/utils/locate-reuse-libs.js +143 -148
- package/templates/optional/typescript/.babelrc.json +4 -0
- package/templates/optional/typescript/.eslintrc +23 -0
- package/templates/optional/typescript/package.json +19 -0
- package/templates/optional/typescript/tsconfig.json +26 -0
- package/templates/optional/typescript/webapp/Component.ts +24 -0
package/dist/data/ui5Libs.d.ts
CHANGED
|
@@ -5,4 +5,46 @@
|
|
|
5
5
|
* @returns UI5 libs with defaults
|
|
6
6
|
*/
|
|
7
7
|
export declare const getUI5Libs: (ui5Libs?: string | string[] | undefined) => string[];
|
|
8
|
+
/**
|
|
9
|
+
* UI5 tasks configurations required for TypeScript projects
|
|
10
|
+
*/
|
|
11
|
+
export declare const ui5TsTasks: ({
|
|
12
|
+
name: string;
|
|
13
|
+
afterTask: string;
|
|
14
|
+
configuration: {
|
|
15
|
+
debug?: undefined;
|
|
16
|
+
removeConsoleStatements?: undefined;
|
|
17
|
+
transpileAsync?: undefined;
|
|
18
|
+
transpileTypeScript?: undefined;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
afterTask: string;
|
|
23
|
+
configuration: {
|
|
24
|
+
debug: boolean;
|
|
25
|
+
removeConsoleStatements: boolean;
|
|
26
|
+
transpileAsync: boolean;
|
|
27
|
+
transpileTypeScript: boolean;
|
|
28
|
+
};
|
|
29
|
+
})[];
|
|
30
|
+
/**
|
|
31
|
+
* UI5 middleware configurations required for TypeScript projects
|
|
32
|
+
*/
|
|
33
|
+
export declare const ui5TsMiddlewares: ({
|
|
34
|
+
name: string;
|
|
35
|
+
afterMiddleware: string;
|
|
36
|
+
configuration: {
|
|
37
|
+
debug?: undefined;
|
|
38
|
+
transpileAsync?: undefined;
|
|
39
|
+
transpileTypeScript?: undefined;
|
|
40
|
+
};
|
|
41
|
+
} | {
|
|
42
|
+
name: string;
|
|
43
|
+
afterMiddleware: string;
|
|
44
|
+
configuration: {
|
|
45
|
+
debug: boolean;
|
|
46
|
+
transpileAsync: boolean;
|
|
47
|
+
transpileTypeScript: boolean;
|
|
48
|
+
};
|
|
49
|
+
})[];
|
|
8
50
|
//# sourceMappingURL=ui5Libs.d.ts.map
|
package/dist/data/ui5Libs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getUI5Libs = void 0;
|
|
3
|
+
exports.ui5TsMiddlewares = exports.ui5TsTasks = exports.getUI5Libs = void 0;
|
|
4
4
|
const defaults_1 = require("./defaults");
|
|
5
5
|
/**
|
|
6
6
|
* Merges the specified ui5 libs with the defaults.
|
|
@@ -14,4 +14,43 @@ exports.getUI5Libs = (ui5Libs) => {
|
|
|
14
14
|
return self.indexOf(value) === index;
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* UI5 tasks configurations required for TypeScript projects
|
|
19
|
+
*/
|
|
20
|
+
exports.ui5TsTasks = [
|
|
21
|
+
{
|
|
22
|
+
name: 'ui5-tooling-modules-task',
|
|
23
|
+
afterTask: 'replaceVersion',
|
|
24
|
+
configuration: {}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'ui5-tooling-transpile-task',
|
|
28
|
+
afterTask: 'replaceVersion',
|
|
29
|
+
configuration: {
|
|
30
|
+
debug: true,
|
|
31
|
+
removeConsoleStatements: true,
|
|
32
|
+
transpileAsync: true,
|
|
33
|
+
transpileTypeScript: true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* UI5 middleware configurations required for TypeScript projects
|
|
39
|
+
*/
|
|
40
|
+
exports.ui5TsMiddlewares = [
|
|
41
|
+
{
|
|
42
|
+
name: 'ui5-tooling-modules-middleware',
|
|
43
|
+
afterMiddleware: 'compression',
|
|
44
|
+
configuration: {}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'ui5-tooling-transpile-middleware',
|
|
48
|
+
afterMiddleware: 'compression',
|
|
49
|
+
configuration: {
|
|
50
|
+
debug: true,
|
|
51
|
+
transpileAsync: true,
|
|
52
|
+
transpileTypeScript: true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
];
|
|
17
56
|
//# sourceMappingURL=ui5Libs.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Editor } from 'mem-fs-editor';
|
|
2
|
+
import type { App, AppOptions, Package, UI5 } from './types';
|
|
2
3
|
import { Ui5App } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Writes the template to the memfs editor instance.
|
|
@@ -10,5 +11,5 @@ import { Ui5App } from './types';
|
|
|
10
11
|
*/
|
|
11
12
|
declare function generate(basePath: string, ui5AppConfig: Ui5App, fs?: Editor): Promise<Editor>;
|
|
12
13
|
export { Ui5App, generate };
|
|
13
|
-
export { App, Package, UI5 }
|
|
14
|
+
export { App, Package, UI5, AppOptions };
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ const json_merger_1 = require("json-merger");
|
|
|
18
18
|
const ejs_1 = require("ejs");
|
|
19
19
|
const files_1 = require("./files");
|
|
20
20
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
21
|
+
const ui5Libs_1 = require("./data/ui5Libs");
|
|
21
22
|
/**
|
|
22
23
|
* Writes the template to the memfs editor instance.
|
|
23
24
|
*
|
|
@@ -47,13 +48,11 @@ function generate(basePath, ui5AppConfig, fs) {
|
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
ui5Config.addFioriToolsAppReloadMiddleware();
|
|
50
|
-
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
51
51
|
// ui5-local.yaml
|
|
52
52
|
const ui5LocalConfigPath = path_1.join(basePath, 'ui5-local.yaml');
|
|
53
53
|
const ui5LocalConfig = yield ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
|
|
54
54
|
ui5LocalConfig.addUI5Framework(ui5App.ui5.framework, ui5App.ui5.localVersion, ui5App.ui5.ui5Libs, ui5App.ui5.ui5Theme);
|
|
55
55
|
ui5LocalConfig.addFioriToolsAppReloadMiddleware();
|
|
56
|
-
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
57
56
|
// Add optional features
|
|
58
57
|
if (ui5App.appOptions) {
|
|
59
58
|
Object.entries(ui5App.appOptions).forEach(([key, value]) => {
|
|
@@ -78,7 +77,17 @@ function generate(basePath, ui5AppConfig, fs) {
|
|
|
78
77
|
});
|
|
79
78
|
}
|
|
80
79
|
});
|
|
80
|
+
if (ui5App.appOptions.typescript) {
|
|
81
|
+
fs.delete(path_1.join(basePath, 'webapp/Component.js'));
|
|
82
|
+
ui5Config.addCustomMiddleware(ui5Libs_1.ui5TsMiddlewares);
|
|
83
|
+
ui5Config.addCustomTasks(ui5Libs_1.ui5TsTasks);
|
|
84
|
+
ui5LocalConfig.addCustomMiddleware(ui5Libs_1.ui5TsMiddlewares);
|
|
85
|
+
ui5LocalConfig.addCustomTasks(ui5Libs_1.ui5TsTasks);
|
|
86
|
+
}
|
|
81
87
|
}
|
|
88
|
+
// write ui5 yamls
|
|
89
|
+
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
90
|
+
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
82
91
|
return fs;
|
|
83
92
|
});
|
|
84
93
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -51,7 +51,14 @@ export interface AppOptions {
|
|
|
51
51
|
codeAssist: boolean;
|
|
52
52
|
eslint: boolean;
|
|
53
53
|
sapux: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Enables loading of re-use libs
|
|
56
|
+
*/
|
|
54
57
|
loadReuseLibs: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Enable Typescript support and generate all files in Typescript instead of Javascript
|
|
60
|
+
*/
|
|
61
|
+
typescript: boolean;
|
|
55
62
|
}
|
|
56
63
|
export interface Ui5App {
|
|
57
64
|
app: App;
|
package/package.json
CHANGED
|
@@ -1,173 +1,168 @@
|
|
|
1
1
|
/*eslint-disable semi, no-console*/
|
|
2
2
|
(function (sap) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function getKeys(libOrComp,libOrCompKeysString) {
|
|
32
|
-
Object.keys(libOrComp).forEach(function (libOrCompKey) {
|
|
33
|
-
// ignore libs or Components that start with SAPUI5 delivered namespaces
|
|
34
|
-
if (!ui5Libs.some(function (substring) { return libOrCompKey === substring || libOrCompKey.startsWith(substring + "."); })) {
|
|
35
|
-
if (libOrCompKeysString.length > 0) {
|
|
36
|
-
libOrCompKeysString = libOrCompKeysString + "," + libOrCompKey;
|
|
37
|
-
} else {
|
|
38
|
-
libOrCompKeysString = libOrCompKey;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return libOrCompKeysString;
|
|
43
|
-
}
|
|
44
|
-
return new Promise(function (resolve, reject) {
|
|
45
|
-
$.ajax(url)
|
|
46
|
-
.done(function (manifest) {
|
|
47
|
-
if (manifest) {
|
|
48
|
-
if (
|
|
49
|
-
manifest["sap.ui5"] &&
|
|
50
|
-
manifest["sap.ui5"].dependencies
|
|
51
|
-
) {
|
|
52
|
-
if (manifest["sap.ui5"].dependencies.libs){
|
|
53
|
-
result = getKeys(manifest["sap.ui5"].dependencies.libs, result)
|
|
54
|
-
}
|
|
55
|
-
if (manifest["sap.ui5"].dependencies.components){
|
|
56
|
-
result = getKeys(manifest["sap.ui5"].dependencies.components, result)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
3
|
+
var getKeys = function (libOrComp, libOrCompKeysString) {
|
|
4
|
+
// SAPUI5 delivered namespaces from https://ui5.sap.com/#/api/sap
|
|
5
|
+
var ui5Libs = [
|
|
6
|
+
"sap.apf",
|
|
7
|
+
"sap.base",
|
|
8
|
+
"sap.chart",
|
|
9
|
+
"sap.collaboration",
|
|
10
|
+
"sap.f",
|
|
11
|
+
"sap.fe",
|
|
12
|
+
"sap.fileviewer",
|
|
13
|
+
"sap.gantt",
|
|
14
|
+
"sap.landvisz",
|
|
15
|
+
"sap.m",
|
|
16
|
+
"sap.ndc",
|
|
17
|
+
"sap.ovp",
|
|
18
|
+
"sap.rules",
|
|
19
|
+
"sap.suite",
|
|
20
|
+
"sap.tnt",
|
|
21
|
+
"sap.ui",
|
|
22
|
+
"sap.uiext",
|
|
23
|
+
"sap.ushell",
|
|
24
|
+
"sap.uxap",
|
|
25
|
+
"sap.viz",
|
|
26
|
+
"sap.webanalytics",
|
|
27
|
+
"sap.zen"
|
|
28
|
+
];
|
|
29
|
+
Object.keys(libOrComp).forEach(function (libOrCompKey) {
|
|
30
|
+
// ignore libs or Components that start with SAPUI5 delivered namespaces
|
|
59
31
|
if (
|
|
60
|
-
|
|
61
|
-
|
|
32
|
+
!ui5Libs.some(function (substring) {
|
|
33
|
+
return libOrCompKey === substring || libOrCompKey.startsWith(substring + ".");
|
|
34
|
+
})
|
|
62
35
|
) {
|
|
63
|
-
|
|
36
|
+
if (libOrCompKeysString.length > 0) {
|
|
37
|
+
libOrCompKeysString = libOrCompKeysString + "," + libOrCompKey;
|
|
38
|
+
} else {
|
|
39
|
+
libOrCompKeysString = libOrCompKey;
|
|
40
|
+
}
|
|
64
41
|
}
|
|
65
|
-
}
|
|
66
|
-
resolve(result);
|
|
67
|
-
})
|
|
68
|
-
.fail(function (error) {
|
|
69
|
-
reject(new Error("Could not fetch manifest at '" + manifestPath));
|
|
70
42
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
43
|
+
return libOrCompKeysString;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var updateManifest = function (manifest) {
|
|
47
|
+
var result = "";
|
|
48
|
+
if (manifest) {
|
|
49
|
+
if (manifest["sap.ui5"] && manifest["sap.ui5"].dependencies) {
|
|
50
|
+
if (manifest["sap.ui5"].dependencies.libs) {
|
|
51
|
+
result = getKeys(manifest["sap.ui5"].dependencies.libs, result);
|
|
52
|
+
}
|
|
53
|
+
if (manifest["sap.ui5"].dependencies.components) {
|
|
54
|
+
result = getKeys(manifest["sap.ui5"].dependencies.components, result);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (manifest["sap.ui5"] && manifest["sap.ui5"].componentUsages) {
|
|
58
|
+
result = getKeys(manifest["sap.ui5"].componentUsages, result);
|
|
59
|
+
}
|
|
88
60
|
}
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
);
|
|
102
|
-
jQuery.sap.registerModulePath(dependency.componentId, dependency.url);
|
|
103
|
-
}
|
|
61
|
+
return result;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var fioriToolsGetManifestLibs = function (manifestPath) {
|
|
65
|
+
var url = manifestPath;
|
|
66
|
+
return new Promise(function (resolve, reject) {
|
|
67
|
+
$.ajax(url)
|
|
68
|
+
.done(function (manifest) {
|
|
69
|
+
resolve(updateManifest(manifest));
|
|
70
|
+
})
|
|
71
|
+
.fail(function () {
|
|
72
|
+
reject(new Error("Could not fetch manifest at '" + manifestPath));
|
|
104
73
|
});
|
|
105
|
-
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
var updateModuleDefinition = function (data) {
|
|
78
|
+
if (data) {
|
|
79
|
+
Object.keys(data).forEach(function (moduleDefinitionKey) {
|
|
80
|
+
var moduleDefinition = data[moduleDefinitionKey];
|
|
81
|
+
if (moduleDefinition && moduleDefinition.dependencies) {
|
|
82
|
+
moduleDefinition.dependencies.forEach(function (dependency) {
|
|
83
|
+
if (dependency.url && dependency.url.length > 0 && dependency.type === "UI5LIB") {
|
|
84
|
+
jQuery.sap.log.info(
|
|
85
|
+
"Registering Library " + dependency.componentId + " from server " + dependency.url
|
|
86
|
+
);
|
|
87
|
+
jQuery.sap.registerModulePath(dependency.componentId, dependency.url);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
106
91
|
});
|
|
107
|
-
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Registers the module paths for dependencies of the given component.
|
|
97
|
+
* @param {string} manifestPath The the path to the app manifest path
|
|
98
|
+
* for which the dependencies should be registered.
|
|
99
|
+
* @returns {Promise} A promise which is resolved when the ajax request for
|
|
100
|
+
* the app-index was successful and the module paths were registered.
|
|
101
|
+
*/
|
|
102
|
+
sap.registerComponentDependencyPaths = function (manifestPath) {
|
|
103
|
+
/*eslint-disable semi, consistent-return*/
|
|
104
|
+
return fioriToolsGetManifestLibs(manifestPath).then(function (libs) {
|
|
105
|
+
if (libs && libs.length > 0) {
|
|
106
|
+
var url = "/sap/bc/ui2/app_index/ui5_app_info?id=" + libs;
|
|
107
|
+
var sapClient = jQuery.sap.getUriParameters().get("sap-client");
|
|
108
|
+
if (sapClient && sapClient.length === 3) {
|
|
109
|
+
url = url + "&sap-client=" + sapClient;
|
|
110
|
+
}
|
|
111
|
+
return $.ajax(url).done(updateModuleDefinition);
|
|
112
|
+
}
|
|
108
113
|
});
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
};
|
|
114
|
+
};
|
|
112
115
|
})(sap);
|
|
113
116
|
|
|
114
117
|
/*eslint-disable sap-browser-api-warning, sap-no-dom-access*/
|
|
115
118
|
var scripts = document.getElementsByTagName("script");
|
|
116
|
-
var currentScript = document.getElementById(
|
|
117
|
-
if(!currentScript){
|
|
119
|
+
var currentScript = document.getElementById("locate-reuse-libs");
|
|
120
|
+
if (!currentScript) {
|
|
118
121
|
currentScript = document.currentScript;
|
|
119
|
-
}
|
|
122
|
+
}
|
|
120
123
|
var manifestUri = currentScript.getAttribute("data-sap-ui-manifest-uri");
|
|
121
124
|
var componentName = currentScript.getAttribute("data-sap-ui-componentName");
|
|
122
125
|
var useMockserver = currentScript.getAttribute("data-sap-ui-use-mockserver");
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
.finally(function () {
|
|
128
|
-
|
|
129
|
-
// setting the app title with internationalization
|
|
130
|
-
sap.ui.getCore().attachInit(function () {
|
|
131
|
-
jQuery.sap.require("jquery.sap.resources");
|
|
132
|
-
var sLocale = sap.ui.getCore().getConfiguration().getLanguage();
|
|
133
|
-
var oBundle = jQuery.sap.resources({
|
|
126
|
+
var bundleResources = function () {
|
|
127
|
+
jQuery.sap.require("jquery.sap.resources");
|
|
128
|
+
var sLocale = sap.ui.getCore().getConfiguration().getLanguage();
|
|
129
|
+
var oBundle = jQuery.sap.resources({
|
|
134
130
|
url: "i18n/i18n.properties",
|
|
135
131
|
locale: sLocale
|
|
136
|
-
});
|
|
137
|
-
document.title = oBundle.getText("appTitle");
|
|
138
132
|
});
|
|
133
|
+
document.title = oBundle.getText("appTitle");
|
|
134
|
+
};
|
|
135
|
+
sap.registerComponentDependencyPaths(manifestUri)
|
|
136
|
+
.catch(function (error) {
|
|
137
|
+
jQuery.sap.log.error(error);
|
|
138
|
+
})
|
|
139
|
+
.finally(function () {
|
|
140
|
+
// setting the app title with internationalization
|
|
141
|
+
sap.ui.getCore().attachInit(bundleResources);
|
|
139
142
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
143
|
+
if (componentName && componentName.length > 0) {
|
|
144
|
+
if (useMockserver && useMockserver === "true") {
|
|
145
|
+
sap.ui.getCore().attachInit(function () {
|
|
146
|
+
sap.ui.require([componentName.replace(/\./g, "/") + "/localService/mockserver"], function (server) {
|
|
147
|
+
// set up test service for local testing
|
|
148
|
+
server.init();
|
|
149
|
+
// initialize the ushell sandbox component
|
|
150
|
+
sap.ushell.Container.createRenderer().placeAt("content");
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
} else {
|
|
154
|
+
// Requiring the ComponentSupport module automatically executes the component initialisation for all declaratively defined components
|
|
155
|
+
sap.ui.require(["sap/ui/core/ComponentSupport"]);
|
|
153
156
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
} else {
|
|
166
|
-
sap.ui.getCore().attachInit(function () {
|
|
167
|
-
// initialize the ushell sandbox component
|
|
168
|
-
sap.ushell.Container.createRenderer().placeAt("content");
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
});
|
|
157
|
+
// setting the app title with the i18n text
|
|
158
|
+
sap.ui.getCore().attachInit(bundleResources);
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
sap.ui.getCore().attachInit(function () {
|
|
162
|
+
// initialize the ushell sandbox component
|
|
163
|
+
sap.ushell.Container.createRenderer().placeAt("content");
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
});
|
|
172
167
|
|
|
173
168
|
sap.registerComponentDependencyPaths(manifestUri);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": true,
|
|
5
|
+
"es6": true,
|
|
6
|
+
"node": true
|
|
7
|
+
},
|
|
8
|
+
"extends": [
|
|
9
|
+
"eslint:recommended",
|
|
10
|
+
"plugin:@typescript-eslint/recommended",
|
|
11
|
+
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
12
|
+
],
|
|
13
|
+
"ignorePatterns": [".eslintignore.js"],
|
|
14
|
+
"parser": "@typescript-eslint/parser",
|
|
15
|
+
"parserOptions": {
|
|
16
|
+
"project": ["./tsconfig.json"],
|
|
17
|
+
"tsconfigRootDir": ".",
|
|
18
|
+
"sourceType": "module"
|
|
19
|
+
},
|
|
20
|
+
"plugins": [
|
|
21
|
+
"@typescript-eslint"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"scripts": {
|
|
3
|
+
"ts-typecheck": "tsc --noEmit"
|
|
4
|
+
},
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@sapui5/ts-types-esm": "latest",
|
|
7
|
+
"ui5-tooling-modules": "^0.6.0",
|
|
8
|
+
"ui5-tooling-transpile": "^0.2.0",
|
|
9
|
+
"typescript": "^4.6.3",
|
|
10
|
+
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
|
11
|
+
"@typescript-eslint/parser": "^5.17.0"
|
|
12
|
+
},
|
|
13
|
+
"ui5": {
|
|
14
|
+
"dependencies": [
|
|
15
|
+
"ui5-tooling-modules",
|
|
16
|
+
"ui5-tooling-transpile"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2015",
|
|
4
|
+
"module": "es2015",
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"preserveConstEnums": true,
|
|
7
|
+
"inlineSourceMap": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"strictNullChecks": true,
|
|
11
|
+
"strictPropertyInitialization": false,
|
|
12
|
+
"moduleResolution": "node",
|
|
13
|
+
"rootDir": "webapp",
|
|
14
|
+
"outDir": "./dist",
|
|
15
|
+
"baseUrl": "./",
|
|
16
|
+
"paths": {
|
|
17
|
+
"<%- app.id %>/*": [
|
|
18
|
+
"webapp/*"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"types": [ "@sapui5/ts-types-esm" ]
|
|
22
|
+
},
|
|
23
|
+
"include": [
|
|
24
|
+
"webapp/**/*"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import UIComponent from "<%- app.baseComponent %>";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @namespace <%- app.id %>
|
|
5
|
+
*/
|
|
6
|
+
export default class Component extends UIComponent {
|
|
7
|
+
|
|
8
|
+
public static metadata = {
|
|
9
|
+
manifest: "json"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
|
|
14
|
+
* @public
|
|
15
|
+
* @override
|
|
16
|
+
*/
|
|
17
|
+
public init() : void {
|
|
18
|
+
// call the base component's init function
|
|
19
|
+
super.init();
|
|
20
|
+
|
|
21
|
+
// enable routing
|
|
22
|
+
this.getRouter().initialize();
|
|
23
|
+
}
|
|
24
|
+
}
|