@ui5/task-adaptation 1.0.23 → 1.1.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/CHANGELOG.md +8 -1
- package/dist/appVariantManager.d.ts +0 -7
- package/dist/appVariantManager.js +1 -19
- package/dist/baseAppManager.d.ts +1 -0
- package/dist/baseAppManager.js +22 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.0
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.1.0...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v1.1.0"></a>
|
|
8
|
+
## [v1.1.0] - 2024-01-30
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- Include app variant id in bundle name [`afab97a`](https://github.com/SAP/ui5-task-adaptation/commit/afab97a10867a58b6e96eb4310f288d29773cf66)
|
|
11
|
+
|
|
6
12
|
|
|
7
13
|
<a name="v1.0.23"></a>
|
|
8
14
|
## [v1.0.23] - 2024-01-19
|
|
@@ -67,6 +73,7 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
67
73
|
<a name="v1.0.0"></a>
|
|
68
74
|
## v1.0.0 - 2020-12-09
|
|
69
75
|
|
|
76
|
+
[v1.1.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.0.23...v1.1.0
|
|
70
77
|
[v1.0.23]: https://github.com/SAP/ui5-task-adaptation/compare/v1.0.21...v1.0.23
|
|
71
78
|
[v1.0.21]: https://github.com/SAP/ui5-task-adaptation/compare/v1.0.20...v1.0.21
|
|
72
79
|
[v1.0.20]: https://github.com/SAP/ui5-task-adaptation/compare/v1.0.19...v1.0.20
|
|
@@ -7,11 +7,4 @@ export default class AppVariantManager {
|
|
|
7
7
|
private static isManifestAppVariant;
|
|
8
8
|
static getAppVariantInfo(appVariantResources: any[]): Promise<IAppVariantInfo>;
|
|
9
9
|
private static omitFiles;
|
|
10
|
-
/**
|
|
11
|
-
* We need to add texts properties to changes because not all have texts property.
|
|
12
|
-
* Changes without texts property can causes issues in bundle.js
|
|
13
|
-
* This is needed for now, and will be removed as soon as change merger in openUI5 is updated
|
|
14
|
-
* @param changes
|
|
15
|
-
*/
|
|
16
|
-
private static patchMissingTextsNode;
|
|
17
10
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const commonUtil_1 = require("./util/commonUtil");
|
|
4
3
|
const resourceUtil_1 = require("./util/resourceUtil");
|
|
5
4
|
const path_1 = require("path");
|
|
6
|
-
const
|
|
5
|
+
const commonUtil_1 = require("./util/commonUtil");
|
|
7
6
|
const EXTENSIONS = "js,json,xml,html,properties,change,appdescr_variant";
|
|
8
7
|
class AppVariantManager {
|
|
9
8
|
static async process(appVariantResources, projectNamespace, taskUtil) {
|
|
@@ -11,7 +10,6 @@ class AppVariantManager {
|
|
|
11
10
|
for (const resource of appVariantResources) {
|
|
12
11
|
this.omitFiles(resource, taskUtil);
|
|
13
12
|
}
|
|
14
|
-
this.patchMissingTextsNode(appVariantInfo?.manifest?.content ?? []);
|
|
15
13
|
await this.renameChanges(appVariantResources, projectNamespace, appVariantInfo);
|
|
16
14
|
return appVariantInfo;
|
|
17
15
|
}
|
|
@@ -73,22 +71,6 @@ class AppVariantManager {
|
|
|
73
71
|
taskUtil.setTag(resource, taskUtil.STANDARD_TAGS.OmitFromBuildResult, true);
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
/**
|
|
77
|
-
* We need to add texts properties to changes because not all have texts property.
|
|
78
|
-
* Changes without texts property can causes issues in bundle.js
|
|
79
|
-
* This is needed for now, and will be removed as soon as change merger in openUI5 is updated
|
|
80
|
-
* @param changes
|
|
81
|
-
*/
|
|
82
|
-
static patchMissingTextsNode(changes) {
|
|
83
|
-
log.verbose("Adjusting appdescr_ui5_addNewModelEnhanceWith with module");
|
|
84
|
-
for (const change of changes) {
|
|
85
|
-
if (change.changeType === "appdescr_ui5_addNewModelEnhanceWith") {
|
|
86
|
-
if (!change.texts && change.content?.bundleUrl) {
|
|
87
|
-
change.texts = { i18n: change.content.bundleUrl };
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
74
|
}
|
|
93
75
|
exports.default = AppVariantManager;
|
|
94
76
|
//# sourceMappingURL=appVariantManager.js.map
|
package/dist/baseAppManager.d.ts
CHANGED
|
@@ -23,5 +23,6 @@ export default class BaseAppManager {
|
|
|
23
23
|
private static fillAppVariantIdHierarchy;
|
|
24
24
|
static validateProperty(value: string, property: string): void;
|
|
25
25
|
static applyDescriptorChanges(baseAppManifest: any, appVariantInfo: IAppVariantInfo): Promise<void>;
|
|
26
|
+
private static adjustAddNewModelEnhanceWith;
|
|
26
27
|
static writeToWorkspace(baseAppFiles: Map<string, string>, projectNamespace: string): any[];
|
|
27
28
|
}
|
package/dist/baseAppManager.js
CHANGED
|
@@ -12,7 +12,7 @@ class BaseAppManager {
|
|
|
12
12
|
static async process(baseAppFiles, appVariantInfo, options, processor) {
|
|
13
13
|
const baseAppManifest = this.getBaseAppManifest(baseAppFiles);
|
|
14
14
|
const { id, version } = this.getIdVersion(baseAppManifest.content);
|
|
15
|
-
const renamedBaseAppFiles = (0,
|
|
15
|
+
const renamedBaseAppFiles = (0, commonUtil_2.renameResources)(baseAppFiles, appVariantInfo.reference, appVariantInfo.id);
|
|
16
16
|
const { filepath, content } = this.getBaseAppManifest(renamedBaseAppFiles);
|
|
17
17
|
await processor.updateLandscapeSpecificContent(content, renamedBaseAppFiles);
|
|
18
18
|
this.fillAppVariantIdHierarchy(processor, id, version, content);
|
|
@@ -56,7 +56,7 @@ class BaseAppManager {
|
|
|
56
56
|
return i18nNode["bundleName"].replace(sapAppId, "").replaceAll(".", "/").substring(1);
|
|
57
57
|
}
|
|
58
58
|
static extractI18NFromBundleUrl(i18nNode) {
|
|
59
|
-
return (0,
|
|
59
|
+
return (0, commonUtil_1.removePropertiesExtension)(i18nNode["bundleUrl"]);
|
|
60
60
|
}
|
|
61
61
|
static getBaseAppManifest(baseAppFiles) {
|
|
62
62
|
let filepath = [...baseAppFiles.keys()].find(filepath => filepath.endsWith("manifest.json"));
|
|
@@ -94,14 +94,31 @@ class BaseAppManager {
|
|
|
94
94
|
...manifest.content,
|
|
95
95
|
...appVariantInfo.manifestChanges
|
|
96
96
|
];
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
const changesContent = new Array();
|
|
98
|
+
const i18nBundleName = (0, commonUtil_1.dotToUnderscore)(appVariantInfo.id);
|
|
99
|
+
for (const change of structuredClone(allChanges)) {
|
|
100
|
+
if (manifest.layer) {
|
|
101
|
+
change.layer = manifest.layer;
|
|
102
|
+
}
|
|
103
|
+
this.adjustAddNewModelEnhanceWith(change, i18nBundleName);
|
|
104
|
+
changesContent.push(new Change(change));
|
|
99
105
|
}
|
|
100
|
-
const changesContent = allChanges.map(change => new Change(change));
|
|
101
106
|
if (changesContent.length > 0) {
|
|
102
107
|
await Applier.applyChanges(baseAppManifest, changesContent, strategy);
|
|
103
108
|
}
|
|
104
109
|
}
|
|
110
|
+
static adjustAddNewModelEnhanceWith(change, i18nBundleName) {
|
|
111
|
+
if (change.changeType === "appdescr_ui5_addNewModelEnhanceWith") {
|
|
112
|
+
if (change.texts == null) {
|
|
113
|
+
// We need to add texts properties to changes because not all
|
|
114
|
+
// have texts property. Changes without texts property can
|
|
115
|
+
// causes issues in bundle.js This is needed for now, and will
|
|
116
|
+
// be removed as soon as change merger in openUI5 is updated
|
|
117
|
+
change.texts = { i18n: change.content?.bundleUrl || "i18n/i18n.properties" };
|
|
118
|
+
}
|
|
119
|
+
change.texts.i18n = i18nBundleName + "/" + change.texts.i18n;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
105
122
|
static writeToWorkspace(baseAppFiles, projectNamespace) {
|
|
106
123
|
const IGNORE_FILES = [
|
|
107
124
|
"/manifest-bundle.zip",
|
package/package.json
CHANGED