@sap-ux/ui5-application-writer 0.18.6 → 0.18.7
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/defaults.js +22 -22
- package/dist/data/index.js +5 -5
- package/dist/data/ui5Libs.d.ts +1 -1
- package/dist/data/validators.js +3 -3
- package/dist/files.js +3 -3
- package/dist/index.js +15 -15
- package/dist/options.js +7 -7
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/data/defaults.js
CHANGED
|
@@ -44,7 +44,7 @@ exports.packageDefaults = packageDefaults;
|
|
|
44
44
|
* @returns - a merged package defintion
|
|
45
45
|
*/
|
|
46
46
|
function mergeObjects(base, extension) {
|
|
47
|
-
return mergeWith_1.default({}, base, extension, (objValue, srcValue) => {
|
|
47
|
+
return (0, mergeWith_1.default)({}, base, extension, (objValue, srcValue) => {
|
|
48
48
|
// merge and de-dup arrays
|
|
49
49
|
if (objValue instanceof Array && srcValue instanceof Array) {
|
|
50
50
|
return [...new Set([...objValue, ...srcValue])];
|
|
@@ -63,11 +63,11 @@ exports.mergeObjects = mergeObjects;
|
|
|
63
63
|
*/
|
|
64
64
|
function mergeApp(app) {
|
|
65
65
|
var _a, _b, _c, _d, _e;
|
|
66
|
-
return mergeWith_1.default({
|
|
66
|
+
return (0, mergeWith_1.default)({
|
|
67
67
|
version: '0.0.1',
|
|
68
|
-
title: i18n_1.t('text.defaultAppTitle', { id: app.id }),
|
|
69
|
-
description: i18n_1.t('text.defaultAppDescription', { id: app.id }),
|
|
70
|
-
baseComponent: "sap/ui/core/UIComponent" /* BASE_COMPONENT */,
|
|
68
|
+
title: (0, i18n_1.t)('text.defaultAppTitle', { id: app.id }),
|
|
69
|
+
description: (0, i18n_1.t)('text.defaultAppDescription', { id: app.id }),
|
|
70
|
+
baseComponent: "sap/ui/core/UIComponent" /* UI5_DEFAULT.BASE_COMPONENT */,
|
|
71
71
|
sourceTemplate: {
|
|
72
72
|
id: (_b = (_a = app.sourceTemplate) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : '',
|
|
73
73
|
version: (_d = (_c = app.sourceTemplate) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : '',
|
|
@@ -88,9 +88,9 @@ exports.defaultUI5Libs = ['sap.m', 'sap.ui.core'];
|
|
|
88
88
|
*/
|
|
89
89
|
function mergeUi5(ui5, options) {
|
|
90
90
|
var _a, _b, _c, _d, _e;
|
|
91
|
-
const version = (_a = ui5.version) !== null && _a !== void 0 ? _a : "" /* DEFAULT_UI5_VERSION */; // Undefined or null indicates the latest available should be used
|
|
91
|
+
const version = (_a = ui5.version) !== null && _a !== void 0 ? _a : "" /* UI5_DEFAULT.DEFAULT_UI5_VERSION */; // Undefined or null indicates the latest available should be used
|
|
92
92
|
const framework = (_b = ui5.framework) !== null && _b !== void 0 ? _b : 'SAPUI5';
|
|
93
|
-
const defaultFrameworkUrl = framework === 'SAPUI5' ? "https://ui5.sap.com" /* SAPUI5_CDN */ : "https://openui5.hana.ondemand.com" /* OPENUI5_CDN */;
|
|
93
|
+
const defaultFrameworkUrl = framework === 'SAPUI5' ? "https://ui5.sap.com" /* UI5_DEFAULT.SAPUI5_CDN */ : "https://openui5.hana.ondemand.com" /* UI5_DEFAULT.OPENUI5_CDN */;
|
|
94
94
|
const merged = {
|
|
95
95
|
minUI5Version: getMinUI5Version(version, ui5.minUI5Version),
|
|
96
96
|
localVersion: getLocalVersion({ framework, version, localVersion: ui5.localVersion }),
|
|
@@ -102,7 +102,7 @@ function mergeUi5(ui5, options) {
|
|
|
102
102
|
merged.typesVersion =
|
|
103
103
|
(_d = ui5.typesVersion) !== null && _d !== void 0 ? _d : ((options === null || options === void 0 ? void 0 : options.typescript) ? getEsmTypesVersion : getTypesVersion)(merged.minUI5Version);
|
|
104
104
|
merged.ui5Theme = (_e = ui5.ui5Theme) !== null && _e !== void 0 ? _e : 'sap_fiori_3';
|
|
105
|
-
merged.ui5Libs = ui5Libs_1.getUI5Libs(ui5.ui5Libs);
|
|
105
|
+
merged.ui5Libs = (0, ui5Libs_1.getUI5Libs)(ui5.ui5Libs);
|
|
106
106
|
return Object.assign({}, ui5, merged);
|
|
107
107
|
}
|
|
108
108
|
exports.mergeUi5 = mergeUi5;
|
|
@@ -115,15 +115,15 @@ exports.mergeUi5 = mergeUi5;
|
|
|
115
115
|
function getTypesVersion(minUI5Version) {
|
|
116
116
|
const version = semver_1.default.coerce(minUI5Version);
|
|
117
117
|
if (!version) {
|
|
118
|
-
return `~${"1.108.0" /* TYPES_VERSION_BEST */}`;
|
|
118
|
+
return `~${"1.108.0" /* UI5_DEFAULT.TYPES_VERSION_BEST */}`;
|
|
119
119
|
}
|
|
120
|
-
else if (semver_1.default.gte(version, "1.108.0" /* TYPES_VERSION_BEST */)) {
|
|
121
|
-
return `~${"1.108.0" /* TYPES_VERSION_BEST */}`;
|
|
120
|
+
else if (semver_1.default.gte(version, "1.108.0" /* UI5_DEFAULT.TYPES_VERSION_BEST */)) {
|
|
121
|
+
return `~${"1.108.0" /* UI5_DEFAULT.TYPES_VERSION_BEST */}`;
|
|
122
122
|
}
|
|
123
123
|
else {
|
|
124
|
-
return semver_1.default.gte(version, "1.76.0" /* TYPES_VERSION_SINCE */)
|
|
124
|
+
return semver_1.default.gte(version, "1.76.0" /* UI5_DEFAULT.TYPES_VERSION_SINCE */)
|
|
125
125
|
? `~${semver_1.default.major(version)}.${semver_1.default.minor(version)}.${semver_1.default.patch(version)}`
|
|
126
|
-
: "1.71.15" /* TYPES_VERSION_PREVIOUS */;
|
|
126
|
+
: "1.71.15" /* UI5_DEFAULT.TYPES_VERSION_PREVIOUS */;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
exports.getTypesVersion = getTypesVersion;
|
|
@@ -136,13 +136,13 @@ exports.getTypesVersion = getTypesVersion;
|
|
|
136
136
|
*/
|
|
137
137
|
function getEsmTypesVersion(minUI5Version) {
|
|
138
138
|
const version = semver_1.default.coerce(minUI5Version);
|
|
139
|
-
if (!version || semver_1.default.gte(version, "1.108.0" /* TYPES_VERSION_BEST */)) {
|
|
140
|
-
return `~${"1.108.0" /* TYPES_VERSION_BEST */}`;
|
|
139
|
+
if (!version || semver_1.default.gte(version, "1.108.0" /* UI5_DEFAULT.TYPES_VERSION_BEST */)) {
|
|
140
|
+
return `~${"1.108.0" /* UI5_DEFAULT.TYPES_VERSION_BEST */}`;
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
|
-
return semver_1.default.gte(version, "1.94.0" /* ESM_TYPES_VERSION_SINCE */)
|
|
143
|
+
return semver_1.default.gte(version, "1.94.0" /* UI5_DEFAULT.ESM_TYPES_VERSION_SINCE */)
|
|
144
144
|
? `~${semver_1.default.major(version)}.${semver_1.default.minor(version)}.0`
|
|
145
|
-
: `~${"1.94.0" /* ESM_TYPES_VERSION_SINCE */}`;
|
|
145
|
+
: `~${"1.94.0" /* UI5_DEFAULT.ESM_TYPES_VERSION_SINCE */}`;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
exports.getEsmTypesVersion = getEsmTypesVersion;
|
|
@@ -154,7 +154,7 @@ exports.getEsmTypesVersion = getEsmTypesVersion;
|
|
|
154
154
|
* @returns minimum UI5 version for manifest
|
|
155
155
|
*/
|
|
156
156
|
function getMinUI5Version(ui5Version, minUI5Version) {
|
|
157
|
-
return minUI5Version !== null && minUI5Version !== void 0 ? minUI5Version : (ui5Version ? ui5Version : "1.60.0" /* MIN_UI5_VERSION */);
|
|
157
|
+
return minUI5Version !== null && minUI5Version !== void 0 ? minUI5Version : (ui5Version ? ui5Version : "1.60.0" /* UI5_DEFAULT.MIN_UI5_VERSION */);
|
|
158
158
|
}
|
|
159
159
|
/**
|
|
160
160
|
* Get the manifest descriptor version from the specified UI5 version.
|
|
@@ -208,7 +208,7 @@ function getManifestVersion(ui5Version, manifestVersion) {
|
|
|
208
208
|
}
|
|
209
209
|
return matchVersion;
|
|
210
210
|
};
|
|
211
|
-
return (_a = manifestVersion !== null && manifestVersion !== void 0 ? manifestVersion : (ui5SemVer && getClosestManifestVersion(ui5SemVer))) !== null && _a !== void 0 ? _a : "1.12.0" /* MANIFEST_VERSION */;
|
|
211
|
+
return (_a = manifestVersion !== null && manifestVersion !== void 0 ? manifestVersion : (ui5SemVer && getClosestManifestVersion(ui5SemVer))) !== null && _a !== void 0 ? _a : "1.12.0" /* UI5_DEFAULT.MANIFEST_VERSION */;
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
214
|
* If a specific local version is provided, use it, otherwise, sync with version but keep minimum versions in mind.
|
|
@@ -224,11 +224,11 @@ function getLocalVersion({ framework, version, localVersion }) {
|
|
|
224
224
|
if (localVersion) {
|
|
225
225
|
return localVersion;
|
|
226
226
|
}
|
|
227
|
-
else if (version === "" /* DEFAULT_UI5_VERSION */) {
|
|
228
|
-
return "1.95.0" /* DEFAULT_LOCAL_UI5_VERSION */;
|
|
227
|
+
else if (version === "" /* UI5_DEFAULT.DEFAULT_UI5_VERSION */) {
|
|
228
|
+
return "1.95.0" /* UI5_DEFAULT.DEFAULT_LOCAL_UI5_VERSION */;
|
|
229
229
|
}
|
|
230
230
|
// minimum version available as local libs
|
|
231
|
-
const minVersion = framework === 'SAPUI5' ? "1.76.0" /* MIN_LOCAL_SAPUI5_VERSION */ : "1.52.5" /* MIN_LOCAL_OPENUI5_VERSION */;
|
|
231
|
+
const minVersion = framework === 'SAPUI5' ? "1.76.0" /* UI5_DEFAULT.MIN_LOCAL_SAPUI5_VERSION */ : "1.52.5" /* UI5_DEFAULT.MIN_LOCAL_OPENUI5_VERSION */;
|
|
232
232
|
// If the ui5 `version` is higher than the min framework version 'result' then use that as the local version instead
|
|
233
233
|
// Update to a valid coerced version string e.g. snapshot-1.80 -> 1.80.0. Cannot be null as previously validated.
|
|
234
234
|
const versionSemVer = semver_1.default.coerce(version);
|
package/dist/data/index.js
CHANGED
|
@@ -11,18 +11,18 @@ const validators_1 = require("./validators");
|
|
|
11
11
|
* @returns {Ui5App} - a new Ui5App instance with all required defaults set
|
|
12
12
|
*/
|
|
13
13
|
function mergeWithDefaults(ui5App) {
|
|
14
|
-
validators_1.validate(ui5App);
|
|
15
|
-
ui5App.app = defaults_1.mergeApp(ui5App.app);
|
|
14
|
+
(0, validators_1.validate)(ui5App);
|
|
15
|
+
ui5App.app = (0, defaults_1.mergeApp)(ui5App.app);
|
|
16
16
|
ui5App.appOptions = ui5App.appOptions || {};
|
|
17
17
|
// if typescript and codeAssist is enabled disable codeAssist
|
|
18
18
|
if (ui5App.appOptions.typescript && ui5App.appOptions.codeAssist) {
|
|
19
19
|
ui5App.appOptions.codeAssist = false;
|
|
20
20
|
}
|
|
21
|
-
ui5App.ui5 = defaults_1.mergeUi5(ui5App.ui5 || {}, ui5App.appOptions);
|
|
22
|
-
ui5App.package = defaults_1.mergeObjects(defaults_1.packageDefaults(ui5App.package.version, ui5App.app.description), ui5App.package);
|
|
21
|
+
ui5App.ui5 = (0, defaults_1.mergeUi5)(ui5App.ui5 || {}, ui5App.appOptions);
|
|
22
|
+
ui5App.package = (0, defaults_1.mergeObjects)((0, defaults_1.packageDefaults)(ui5App.package.version, ui5App.app.description), ui5App.package);
|
|
23
23
|
if (ui5App.appOptions.sapux) {
|
|
24
24
|
ui5App.package.devDependencies = ui5App.package.devDependencies || {};
|
|
25
|
-
ui5App.package.devDependencies['@sap/ux-specification'] = defaults_1.getSpecTagVersion(ui5App.ui5.version);
|
|
25
|
+
ui5App.package.devDependencies['@sap/ux-specification'] = (0, defaults_1.getSpecTagVersion)(ui5App.ui5.version);
|
|
26
26
|
}
|
|
27
27
|
return ui5App;
|
|
28
28
|
}
|
package/dist/data/ui5Libs.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param ui5Libs - The ui5 libraries to be merged with the defaults
|
|
5
5
|
* @returns UI5 libs with defaults
|
|
6
6
|
*/
|
|
7
|
-
export declare const getUI5Libs: (ui5Libs?: string | string[]
|
|
7
|
+
export declare const getUI5Libs: (ui5Libs?: string | string[]) => string[];
|
|
8
8
|
/**
|
|
9
9
|
* UI5 task and middleware configurations required for TypeScript projects
|
|
10
10
|
*/
|
package/dist/data/validators.js
CHANGED
|
@@ -15,11 +15,11 @@ const i18n_1 = require("../i18n");
|
|
|
15
15
|
*/
|
|
16
16
|
function validateAppId(appId) {
|
|
17
17
|
if (!appId) {
|
|
18
|
-
throw new Error(i18n_1.t('error.missingRequiredProperty', { propertyName: 'app.id' }));
|
|
18
|
+
throw new Error((0, i18n_1.t)('error.missingRequiredProperty', { propertyName: 'app.id' }));
|
|
19
19
|
}
|
|
20
20
|
const match = appId.match(/["]/);
|
|
21
21
|
if (match) {
|
|
22
|
-
throw new Error(i18n_1.t('error.disallowedCharacters', { propertyName: 'app.id', disallowedChars: `${match === null || match === void 0 ? void 0 : match.join()}` }));
|
|
22
|
+
throw new Error((0, i18n_1.t)('error.disallowedCharacters', { propertyName: 'app.id', disallowedChars: `${match === null || match === void 0 ? void 0 : match.join()}` }));
|
|
23
23
|
}
|
|
24
24
|
return true;
|
|
25
25
|
}
|
|
@@ -34,7 +34,7 @@ exports.validateAppId = validateAppId;
|
|
|
34
34
|
*/
|
|
35
35
|
function validateUI5Version(version) {
|
|
36
36
|
if (version && semver_1.default.coerce(version) === null) {
|
|
37
|
-
throw new Error(i18n_1.t('error.invalidUI5Version', { version }));
|
|
37
|
+
throw new Error((0, i18n_1.t)('error.invalidUI5Version', { version }));
|
|
38
38
|
}
|
|
39
39
|
return true;
|
|
40
40
|
}
|
package/dist/files.js
CHANGED
|
@@ -11,9 +11,9 @@ const path_1 = require("path");
|
|
|
11
11
|
* @throws if an error occurs reading a file path
|
|
12
12
|
*/
|
|
13
13
|
function getFilePaths(dir) {
|
|
14
|
-
return fs_1.readdirSync(dir).reduce((files, entry) => {
|
|
15
|
-
const entryPath = path_1.join(dir, entry);
|
|
16
|
-
const isDirectory = fs_1.statSync(entryPath).isDirectory();
|
|
14
|
+
return (0, fs_1.readdirSync)(dir).reduce((files, entry) => {
|
|
15
|
+
const entryPath = (0, path_1.join)(dir, entry);
|
|
16
|
+
const isDirectory = (0, fs_1.statSync)(entryPath).isDirectory();
|
|
17
17
|
return isDirectory ? [...files, ...getFilePaths(entryPath)] : [...files, entryPath];
|
|
18
18
|
}, []);
|
|
19
19
|
}
|
package/dist/index.js
CHANGED
|
@@ -30,17 +30,17 @@ function generate(basePath, ui5AppConfig, fs) {
|
|
|
30
30
|
var _a, _b;
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
if (!fs) {
|
|
33
|
-
fs = mem_fs_editor_1.create(mem_fs_1.create());
|
|
33
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
34
34
|
}
|
|
35
|
-
const ui5App = data_1.mergeWithDefaults(ui5AppConfig);
|
|
36
|
-
const tmplPath = path_1.join(__dirname, '..', 'templates');
|
|
35
|
+
const ui5App = (0, data_1.mergeWithDefaults)(ui5AppConfig);
|
|
36
|
+
const tmplPath = (0, path_1.join)(__dirname, '..', 'templates');
|
|
37
37
|
const ignore = [((_a = ui5AppConfig.appOptions) === null || _a === void 0 ? void 0 : _a.typescript) ? '**/*.js' : '**/*.ts'];
|
|
38
|
-
fs.copyTpl(path_1.join(tmplPath, 'core', '**/*.*'), path_1.join(basePath), ui5App, undefined, {
|
|
38
|
+
fs.copyTpl((0, path_1.join)(tmplPath, 'core', '**/*.*'), (0, path_1.join)(basePath), ui5App, undefined, {
|
|
39
39
|
globOptions: { dot: true, ignore },
|
|
40
40
|
processDestinationPath: (filePath) => filePath.replace(/gitignore.tmpl/g, '.gitignore')
|
|
41
41
|
});
|
|
42
42
|
// ui5.yaml
|
|
43
|
-
const ui5ConfigPath = path_1.join(basePath, 'ui5.yaml');
|
|
43
|
+
const ui5ConfigPath = (0, path_1.join)(basePath, 'ui5.yaml');
|
|
44
44
|
const ui5Config = yield ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
|
|
45
45
|
ui5Config.addFioriToolsProxydMiddleware({
|
|
46
46
|
ui5: {
|
|
@@ -49,12 +49,12 @@ function generate(basePath, ui5AppConfig, fs) {
|
|
|
49
49
|
});
|
|
50
50
|
ui5Config.addFioriToolsAppReloadMiddleware();
|
|
51
51
|
// ui5-local.yaml
|
|
52
|
-
const ui5LocalConfigPath = path_1.join(basePath, 'ui5-local.yaml');
|
|
52
|
+
const ui5LocalConfigPath = (0, 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
56
|
// Add optional features
|
|
57
|
-
options_1.applyOptionalFeatures(ui5App, fs, basePath, tmplPath, [ui5Config, ui5LocalConfig]);
|
|
57
|
+
(0, options_1.applyOptionalFeatures)(ui5App, fs, basePath, tmplPath, [ui5Config, ui5LocalConfig]);
|
|
58
58
|
// write ui5 yamls
|
|
59
59
|
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
60
60
|
fs.write(ui5LocalConfigPath, ui5LocalConfig.toString());
|
|
@@ -72,10 +72,10 @@ exports.generate = generate;
|
|
|
72
72
|
function isTypescriptEnabled(basePath, fs) {
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
if (!fs) {
|
|
75
|
-
fs = mem_fs_editor_1.create(mem_fs_1.create());
|
|
75
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
76
76
|
}
|
|
77
77
|
// check middlewares and tasks
|
|
78
|
-
const ui5Config = yield ui5_config_1.UI5Config.newInstance(fs.read(path_1.join(basePath, 'ui5.yaml')));
|
|
78
|
+
const ui5Config = yield ui5_config_1.UI5Config.newInstance(fs.read((0, path_1.join)(basePath, 'ui5.yaml')));
|
|
79
79
|
if (!ui5Config.findCustomMiddleware(ui5Libs_1.ui5TSSupport.middleware.name)) {
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
@@ -97,10 +97,10 @@ function enableTypescript(basePath, fs) {
|
|
|
97
97
|
var _a, _b;
|
|
98
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
99
|
if (!fs) {
|
|
100
|
-
fs = mem_fs_editor_1.create(mem_fs_1.create());
|
|
100
|
+
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
101
101
|
}
|
|
102
|
-
const manifestPath = path_1.join(basePath, 'webapp/manifest.json');
|
|
103
|
-
const ui5ConfigPath = path_1.join(basePath, 'ui5.yaml');
|
|
102
|
+
const manifestPath = (0, path_1.join)(basePath, 'webapp/manifest.json');
|
|
103
|
+
const ui5ConfigPath = (0, path_1.join)(basePath, 'ui5.yaml');
|
|
104
104
|
if (!fs.exists(manifestPath)) {
|
|
105
105
|
throw new Error(`Invalid project folder. Cannot find required file ${manifestPath}`);
|
|
106
106
|
}
|
|
@@ -109,14 +109,14 @@ function enableTypescript(basePath, fs) {
|
|
|
109
109
|
}
|
|
110
110
|
const manifest = fs.readJSON(manifestPath);
|
|
111
111
|
const ui5Config = yield ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
|
|
112
|
-
const tmplPath = path_1.join(__dirname, '..', 'templates');
|
|
112
|
+
const tmplPath = (0, path_1.join)(__dirname, '..', 'templates');
|
|
113
113
|
const ui5App = {
|
|
114
114
|
app: manifest['sap.app'],
|
|
115
115
|
ui5: {
|
|
116
|
-
typesVersion: defaults_1.getEsmTypesVersion((_b = (_a = manifest['sap.ui5']) === null || _a === void 0 ? void 0 : _a.dependencies) === null || _b === void 0 ? void 0 : _b.minUI5Version)
|
|
116
|
+
typesVersion: (0, defaults_1.getEsmTypesVersion)((_b = (_a = manifest['sap.ui5']) === null || _a === void 0 ? void 0 : _a.dependencies) === null || _b === void 0 ? void 0 : _b.minUI5Version)
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
options_1.enableTypescript({ basePath, fs, ui5Configs: [ui5Config], tmplPath, ui5App }, true);
|
|
119
|
+
(0, options_1.enableTypescript)({ basePath, fs, ui5Configs: [ui5Config], tmplPath, ui5App }, true);
|
|
120
120
|
fs.write(ui5ConfigPath, ui5Config.toString());
|
|
121
121
|
return fs;
|
|
122
122
|
});
|
package/dist/options.js
CHANGED
|
@@ -17,11 +17,11 @@ const defaults_1 = require("./data/defaults");
|
|
|
17
17
|
* @param input.tmplPath template basepath
|
|
18
18
|
*/
|
|
19
19
|
function copyTemplates(name, { ui5App, fs, basePath, tmplPath }) {
|
|
20
|
-
const optTmplDirPath = path_1.join(tmplPath, 'optional', `${name}`);
|
|
21
|
-
const optTmplFilePaths = files_1.getFilePaths(optTmplDirPath);
|
|
20
|
+
const optTmplDirPath = (0, path_1.join)(tmplPath, 'optional', `${name}`);
|
|
21
|
+
const optTmplFilePaths = (0, files_1.getFilePaths)(optTmplDirPath);
|
|
22
22
|
optTmplFilePaths.forEach((optTmplFilePath) => {
|
|
23
23
|
const relPath = optTmplFilePath.replace(optTmplDirPath, '');
|
|
24
|
-
const outPath = path_1.join(basePath, relPath);
|
|
24
|
+
const outPath = (0, path_1.join)(basePath, relPath);
|
|
25
25
|
// Extend or add
|
|
26
26
|
if (!fs.exists(outPath)) {
|
|
27
27
|
fs.copyTpl(optTmplFilePath, outPath, ui5App, undefined, {
|
|
@@ -29,9 +29,9 @@ function copyTemplates(name, { ui5App, fs, basePath, tmplPath }) {
|
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const add = JSON.parse(ejs_1.render(fs.read(optTmplFilePath), ui5App, {}));
|
|
32
|
+
const add = JSON.parse((0, ejs_1.render)(fs.read(optTmplFilePath), ui5App, {}));
|
|
33
33
|
const existingFile = JSON.parse(fs.read(outPath));
|
|
34
|
-
const merged = defaults_1.mergeObjects(existingFile, add);
|
|
34
|
+
const merged = (0, defaults_1.mergeObjects)(existingFile, add);
|
|
35
35
|
fs.writeJSON(outPath, merged);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
@@ -55,13 +55,13 @@ const factories = {
|
|
|
55
55
|
*/
|
|
56
56
|
function enableTypescript(input, keepOldComponent = false) {
|
|
57
57
|
var _a;
|
|
58
|
-
input.ui5App.app.baseComponent = (_a = input.ui5App.app.baseComponent) !== null && _a !== void 0 ? _a : "sap/ui/core/UIComponent" /* BASE_COMPONENT */;
|
|
58
|
+
input.ui5App.app.baseComponent = (_a = input.ui5App.app.baseComponent) !== null && _a !== void 0 ? _a : "sap/ui/core/UIComponent" /* UI5_DEFAULT.BASE_COMPONENT */;
|
|
59
59
|
copyTemplates('typescript', input);
|
|
60
60
|
input.ui5Configs.forEach((ui5Config) => {
|
|
61
61
|
ui5Config.addCustomMiddleware([ui5Libs_1.ui5TSSupport.middleware]);
|
|
62
62
|
ui5Config.addCustomTasks([ui5Libs_1.ui5TSSupport.task]);
|
|
63
63
|
});
|
|
64
|
-
const compPath = path_1.join(input.basePath, 'webapp/Component.js');
|
|
64
|
+
const compPath = (0, path_1.join)(input.basePath, 'webapp/Component.js');
|
|
65
65
|
if (keepOldComponent) {
|
|
66
66
|
input.fs.move(compPath, `${compPath}.old`);
|
|
67
67
|
}
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-application-writer"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.18.
|
|
12
|
+
"version": "0.18.7",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"!dist/**/*.map"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@sap-ux/ui5-config": "0.16.
|
|
23
|
+
"@sap-ux/ui5-config": "0.16.4",
|
|
24
24
|
"@ui5/manifest": "1.49.2",
|
|
25
25
|
"ejs": "3.1.7",
|
|
26
26
|
"i18next": "21.6.11",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"semver": "7.3.5"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@sap-ux/project-access": "1.1.
|
|
33
|
+
"@sap-ux/project-access": "1.1.3",
|
|
34
34
|
"@types/ejs": "3.1.0",
|
|
35
35
|
"@types/fs-extra": "9.0.13",
|
|
36
36
|
"@types/lodash": "4.14.176",
|