@sap-ux/ui5-application-writer 1.5.17 → 1.5.19
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 +1 -1
- package/dist/index.js +8 -8
- package/dist/options.js +5 -5
- package/dist/utils.js +3 -3
- package/package.json +4 -4
package/dist/data/defaults.js
CHANGED
|
@@ -179,7 +179,7 @@ function getLocalVersion({ framework, version, localVersion }) {
|
|
|
179
179
|
return "1.95.0" /* UI5_DEFAULT.DEFAULT_LOCAL_UI5_VERSION */;
|
|
180
180
|
}
|
|
181
181
|
// minimum version available as local libs
|
|
182
|
-
const minVersion = framework === 'SAPUI5' ? "1.
|
|
182
|
+
const minVersion = framework === 'SAPUI5' ? "1.84.54" /* UI5_DEFAULT.MIN_LOCAL_SAPUI5_VERSION */ : "1.52.5" /* UI5_DEFAULT.MIN_LOCAL_OPENUI5_VERSION */;
|
|
183
183
|
// If the ui5 `version` is higher than the min framework version 'result' then use that as the local version instead
|
|
184
184
|
// Update to a valid coerced version string e.g. snapshot-1.80 -> 1.80.0. Cannot be null as previously validated.
|
|
185
185
|
const versionSemVer = semver_1.default.coerce(version);
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.getManifestVersion = exports.getTemplateVersionPath = exports.processDes
|
|
|
4
4
|
exports.generate = generate;
|
|
5
5
|
exports.enableTypescript = enableTypescript;
|
|
6
6
|
exports.isTypescriptEnabled = isTypescriptEnabled;
|
|
7
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
const mem_fs_1 = require("mem-fs");
|
|
9
9
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
10
10
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
@@ -26,7 +26,7 @@ async function generate(basePath, ui5AppConfig, fs) {
|
|
|
26
26
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
27
27
|
}
|
|
28
28
|
const ui5App = (0, data_1.mergeWithDefaults)(ui5AppConfig);
|
|
29
|
-
const tmplPath = (0,
|
|
29
|
+
const tmplPath = (0, node_path_1.join)(__dirname, '..', 'templates');
|
|
30
30
|
const ignore = [ui5AppConfig.appOptions?.typescript ? '**/*.js' : '**/*.ts'];
|
|
31
31
|
if (ui5AppConfig.appOptions?.generateIndex === false) {
|
|
32
32
|
ignore.push('**/webapp/index.html');
|
|
@@ -53,7 +53,7 @@ async function generate(basePath, ui5AppConfig, fs) {
|
|
|
53
53
|
ui5Version: ui5App.ui5?.version
|
|
54
54
|
});
|
|
55
55
|
// ui5.yaml
|
|
56
|
-
const ui5ConfigPath = (0,
|
|
56
|
+
const ui5ConfigPath = (0, node_path_1.join)(basePath, 'ui5.yaml');
|
|
57
57
|
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
|
|
58
58
|
ui5Config.addFioriToolsProxyMiddleware({
|
|
59
59
|
ui5: {
|
|
@@ -68,7 +68,7 @@ async function generate(basePath, ui5AppConfig, fs) {
|
|
|
68
68
|
ui5Config.updateCustomMiddleware(fioriToolsPreviewConfigMiddlware);
|
|
69
69
|
}
|
|
70
70
|
if (isEdmxProjectType) {
|
|
71
|
-
const ui5LocalConfigPath = (0,
|
|
71
|
+
const ui5LocalConfigPath = (0, node_path_1.join)(basePath, 'ui5-local.yaml');
|
|
72
72
|
// write ui5-local.yaml only for non-CAP applications
|
|
73
73
|
const ui5LocalConfig = await ui5_config_1.UI5Config.newInstance(fs.read(ui5LocalConfigPath));
|
|
74
74
|
ui5LocalConfig.addUI5Framework(ui5App.ui5.framework, ui5App.ui5.localVersion, ui5App.ui5.ui5Libs, ui5App.ui5.ui5Theme);
|
|
@@ -122,7 +122,7 @@ async function isTypescriptEnabled(basePath, fs) {
|
|
|
122
122
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
123
123
|
}
|
|
124
124
|
// check middlewares and tasks
|
|
125
|
-
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0,
|
|
125
|
+
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read((0, node_path_1.join)(basePath, 'ui5.yaml')));
|
|
126
126
|
if (!ui5Config.findCustomMiddleware(ui5Libs_1.ui5TSSupport.middleware.name)) {
|
|
127
127
|
return false;
|
|
128
128
|
}
|
|
@@ -142,8 +142,8 @@ async function enableTypescript(basePath, fs) {
|
|
|
142
142
|
if (!fs) {
|
|
143
143
|
fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
144
144
|
}
|
|
145
|
-
const manifestPath = (0,
|
|
146
|
-
const ui5ConfigPath = (0,
|
|
145
|
+
const manifestPath = (0, node_path_1.join)(basePath, 'webapp/manifest.json');
|
|
146
|
+
const ui5ConfigPath = (0, node_path_1.join)(basePath, 'ui5.yaml');
|
|
147
147
|
if (!fs.exists(manifestPath)) {
|
|
148
148
|
throw new Error(`Invalid project folder. Cannot find required file ${manifestPath}`);
|
|
149
149
|
}
|
|
@@ -152,7 +152,7 @@ async function enableTypescript(basePath, fs) {
|
|
|
152
152
|
}
|
|
153
153
|
const manifest = fs.readJSON(manifestPath);
|
|
154
154
|
const ui5Config = await ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
|
|
155
|
-
const tmplPath = (0,
|
|
155
|
+
const tmplPath = (0, node_path_1.join)(__dirname, '..', 'templates');
|
|
156
156
|
//By chosing getMinimumUI5Version we assume that the esm type is compatible if there are multiple versions.
|
|
157
157
|
const typesVersion = (0, ui5_config_1.getEsmTypesVersion)((0, project_access_1.getMinimumUI5Version)(manifest));
|
|
158
158
|
const typesPackage = (0, ui5_config_1.getTypesPackage)(typesVersion);
|
package/dist/options.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.enableTypescript = enableTypescript;
|
|
|
4
4
|
exports.enableNpmPackageConsumption = enableNpmPackageConsumption;
|
|
5
5
|
exports.applyOptionalFeatures = applyOptionalFeatures;
|
|
6
6
|
exports.getTemplateOptions = getTemplateOptions;
|
|
7
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
const ejs_1 = require("ejs");
|
|
9
9
|
const project_access_1 = require("@sap-ux/project-access");
|
|
10
10
|
const ui5Libs_1 = require("./data/ui5Libs");
|
|
@@ -21,15 +21,15 @@ const utils_1 = require("./utils");
|
|
|
21
21
|
* @param input.tmplPath template basepath
|
|
22
22
|
*/
|
|
23
23
|
async function copyTemplates(name, { ui5App, fs, basePath, tmplPath }) {
|
|
24
|
-
let optTmplDirPath = (0,
|
|
24
|
+
let optTmplDirPath = (0, node_path_1.join)(tmplPath, 'optional', `${name}`);
|
|
25
25
|
const optionPath = (0, utils_1.getTemplateVersionPath)(ui5App.ui5);
|
|
26
26
|
if (name === 'loadReuseLibs') {
|
|
27
|
-
optTmplDirPath = (0,
|
|
27
|
+
optTmplDirPath = (0, node_path_1.join)(optTmplDirPath, optionPath);
|
|
28
28
|
}
|
|
29
29
|
const optTmplFilePaths = await (0, project_access_1.getFilePaths)(optTmplDirPath);
|
|
30
30
|
optTmplFilePaths.forEach((optTmplFilePath) => {
|
|
31
31
|
const relPath = optTmplFilePath.replace(optTmplDirPath, '');
|
|
32
|
-
const outPath = (0,
|
|
32
|
+
const outPath = (0, node_path_1.join)(basePath, relPath);
|
|
33
33
|
// Extend or add
|
|
34
34
|
if (!fs.exists(outPath)) {
|
|
35
35
|
fs.copyTpl(optTmplFilePath, outPath, ui5App, undefined, {
|
|
@@ -73,7 +73,7 @@ async function enableTypescript(input, keepOldComponent = false) {
|
|
|
73
73
|
ui5Config.addCustomMiddleware([ui5Libs_1.ui5TSSupport.middleware]);
|
|
74
74
|
ui5Config.addCustomTasks([ui5Libs_1.ui5TSSupport.task]);
|
|
75
75
|
});
|
|
76
|
-
const compPath = (0,
|
|
76
|
+
const compPath = (0, node_path_1.join)(input.basePath, 'webapp/Component.js');
|
|
77
77
|
if (keepOldComponent) {
|
|
78
78
|
input.fs.move(compPath, `${compPath}.old`);
|
|
79
79
|
}
|
package/dist/utils.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.getTemplateVersionPath = getTemplateVersionPath;
|
|
|
6
6
|
exports.processDestinationPath = processDestinationPath;
|
|
7
7
|
exports.copyTemplates = copyTemplates;
|
|
8
8
|
const semver_1 = require("semver");
|
|
9
|
-
const
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
10
|
const project_access_1 = require("@sap-ux/project-access");
|
|
11
11
|
exports.ui5LtsVersion_1_71 = '1.71.0';
|
|
12
12
|
exports.ui5LtsVersion_1_120 = '1.120.0';
|
|
@@ -71,11 +71,11 @@ function copyTemplates(options) {
|
|
|
71
71
|
? exports.ui5LtsVersion_1_120
|
|
72
72
|
: exports.ui5LtsVersion_1_71;
|
|
73
73
|
// Copy version-specific template files
|
|
74
|
-
fs.copyTpl((0,
|
|
74
|
+
fs.copyTpl((0, node_path_1.join)(tmplPath, 'core', templateUi5Version, '**/*.*'), (0, node_path_1.join)(basePath), templateOptions, undefined, {
|
|
75
75
|
globOptions: { dot: true, ignore }
|
|
76
76
|
});
|
|
77
77
|
// Copy remaining common files
|
|
78
|
-
fs.copyTpl(remainingCoreFiles.map((fileName) => (0,
|
|
78
|
+
fs.copyTpl(remainingCoreFiles.map((fileName) => (0, node_path_1.join)(tmplPath, 'core', fileName)), (0, node_path_1.join)(basePath), templateOptions, undefined, {
|
|
79
79
|
globOptions: { dot: true, ignore },
|
|
80
80
|
processDestinationPath: (filePath) => filePath.replace(/gitignore.tmpl/g, '.gitignore')
|
|
81
81
|
});
|
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": "1.5.
|
|
12
|
+
"version": "1.5.19",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"mem-fs": "2.1.0",
|
|
28
28
|
"mem-fs-editor": "9.4.0",
|
|
29
29
|
"semver": "7.5.4",
|
|
30
|
-
"@sap-ux/ui5-config": "0.29.
|
|
30
|
+
"@sap-ux/ui5-config": "0.29.8"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/ejs": "3.1.2",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@types/mem-fs-editor": "7.0.1",
|
|
38
38
|
"@types/semver": "7.5.2",
|
|
39
39
|
"fs-extra": "10.0.0",
|
|
40
|
-
"@sap-ux/eslint-plugin-fiori-tools": "0.6.
|
|
41
|
-
"@sap-ux/project-access": "1.32.
|
|
40
|
+
"@sap-ux/eslint-plugin-fiori-tools": "0.6.1",
|
|
41
|
+
"@sap-ux/project-access": "1.32.4"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=20.x"
|