@ui5/task-adaptation 1.6.3 → 1.6.4-rc.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/CHANGELOG.md +42 -3
- package/dist/adapters/abapAdapter.d.ts +2 -4
- package/dist/adapters/abapAdapter.js +2 -4
- package/dist/adapters/commands/downloadAnnotationsCommand.d.ts +2 -4
- package/dist/adapters/commands/downloadAnnotationsCommand.js +2 -6
- package/dist/adapters/commands/i18nPropertiesMergeCommand.js +7 -4
- package/dist/annotations/abapAnnotationManager.d.ts +17 -0
- package/dist/{annotationManager.js → annotations/abapAnnotationManager.js} +12 -10
- package/dist/annotations/annotationManager.d.ts +3 -0
- package/dist/annotations/annotationManager.js +2 -0
- package/dist/annotations/localAnnotationManager.d.ts +4 -0
- package/dist/annotations/localAnnotationManager.js +7 -0
- package/dist/annotations/serviceRequestor.d.ts +3 -3
- package/dist/annotations/serviceRequestor.js +4 -4
- package/dist/bundle.js +119 -2
- package/dist/index.js +5 -6
- package/dist/landscapeConfiguration.d.ts +9 -0
- package/dist/landscapeConfiguration.js +65 -0
- package/dist/model/configuration.d.ts +2 -0
- package/dist/previewManager.d.ts +2 -2
- package/dist/previewManager.js +7 -7
- package/dist/repositories/{abapRepoManager.d.ts → abapRepository.d.ts} +5 -3
- package/dist/repositories/{abapRepoManager.js → abapRepository.js} +17 -4
- package/dist/repositories/html5Repository.d.ts +18 -0
- package/dist/repositories/{html5RepoManager.js → html5Repository.js} +58 -27
- package/dist/repositories/localRepository.d.ts +16 -0
- package/dist/repositories/localRepository.js +66 -0
- package/dist/repositories/repository.d.ts +8 -0
- package/dist/repositories/repository.js +2 -0
- package/dist/util/commonUtil.d.ts +1 -0
- package/dist/util/commonUtil.js +3 -0
- package/dist/util/fsUtil.d.ts +2 -0
- package/dist/util/fsUtil.js +34 -0
- package/package.json +5 -2
- package/scripts/publish.ts +256 -0
- package/scripts/test-integration-prep.sh +4 -0
- package/dist/annotationManager.d.ts +0 -17
- package/dist/processors/abapProcessor.d.ts +0 -18
- package/dist/processors/abapProcessor.js +0 -43
- package/dist/processors/cfProcessor.d.ts +0 -14
- package/dist/processors/cfProcessor.js +0 -46
- package/dist/processors/previewProcessor.d.ts +0 -8
- package/dist/processors/previewProcessor.js +0 -11
- package/dist/processors/processor.d.ts +0 -10
- package/dist/processors/processor.js +0 -39
- package/dist/repositories/html5RepoManager.d.ts +0 -12
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.6.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.2...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v1.6.4-rc.2"></a>
|
|
8
|
+
## [v1.6.4-rc.2] - 2026-04-06
|
|
9
|
+
|
|
10
|
+
<a name="v1.6.4-rc.1"></a>
|
|
11
|
+
## [v1.6.4-rc.1] - 2026-04-06
|
|
6
12
|
|
|
7
13
|
<a name="v1.6.3"></a>
|
|
8
14
|
## [v1.6.3] - 2026-03-18
|
|
@@ -24,6 +30,24 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
24
30
|
|
|
25
31
|
<a name="v1.5.4"></a>
|
|
26
32
|
## [v1.5.4] - 2026-02-16
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<a name="v1.6.0-rc.4"></a>
|
|
38
|
+
## [v1.6.0-rc.4] - 2026-02-12
|
|
39
|
+
|
|
40
|
+
<a name="v1.6.0-rc.3"></a>
|
|
41
|
+
## [v1.6.0-rc.3] - 2026-02-05
|
|
42
|
+
|
|
43
|
+
<a name="v1.6.0-rc.2"></a>
|
|
44
|
+
## [v1.6.0-rc.2] - 2026-02-05
|
|
45
|
+
|
|
46
|
+
<a name="v1.6.0-rc.1"></a>
|
|
47
|
+
## [v1.6.0-rc.1] - 2026-02-05
|
|
48
|
+
|
|
49
|
+
<a name="v1.6.0-rc.0"></a>
|
|
50
|
+
## [v1.6.0-rc.0] - 2026-02-02
|
|
27
51
|
|
|
28
52
|
<a name="v1.5.3"></a>
|
|
29
53
|
## [v1.5.3] - 2025-09-29
|
|
@@ -34,6 +58,12 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
34
58
|
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
35
59
|
|
|
36
60
|
|
|
61
|
+
<a name="v1.5.2-rc.1"></a>
|
|
62
|
+
## [v1.5.2-rc.1] - 2025-08-22
|
|
63
|
+
|
|
64
|
+
<a name="v1.5.2-rc.0"></a>
|
|
65
|
+
## [v1.5.2-rc.0] - 2025-08-19
|
|
66
|
+
|
|
37
67
|
<a name="v1.5.1"></a>
|
|
38
68
|
## [v1.5.1] - 2025-08-06
|
|
39
69
|
|
|
@@ -149,15 +179,24 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
149
179
|
<a name="v1.0.0"></a>
|
|
150
180
|
## v1.0.0 - 2020-12-09
|
|
151
181
|
|
|
182
|
+
[v1.6.4-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.1...v1.6.4-rc.2
|
|
183
|
+
[v1.6.4-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.3...v1.6.4-rc.1
|
|
152
184
|
[v1.6.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.2...v1.6.3
|
|
153
185
|
[v1.6.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.1...v1.6.2
|
|
154
186
|
[v1.6.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0...v1.6.1
|
|
155
187
|
[v1.6.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.2.0...v1.6.0
|
|
156
188
|
[v0.2.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.1.0...v0.2.0
|
|
157
189
|
[v0.1.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.4...v0.1.0
|
|
158
|
-
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.
|
|
190
|
+
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.4...v1.5.4
|
|
191
|
+
[v1.6.0-rc.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.3...v1.6.0-rc.4
|
|
192
|
+
[v1.6.0-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.2...v1.6.0-rc.3
|
|
193
|
+
[v1.6.0-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.1...v1.6.0-rc.2
|
|
194
|
+
[v1.6.0-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.0...v1.6.0-rc.1
|
|
195
|
+
[v1.6.0-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.3...v1.6.0-rc.0
|
|
159
196
|
[v1.5.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2...v1.5.3
|
|
160
|
-
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2
|
|
197
|
+
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.1...v1.5.2
|
|
198
|
+
[v1.5.2-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.0...v1.5.2-rc.1
|
|
199
|
+
[v1.5.2-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2-rc.0
|
|
161
200
|
[v1.5.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.1
|
|
162
201
|
[v1.4.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.2...v1.4.3
|
|
163
202
|
[v1.4.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.0...v1.4.2
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { IConfiguration } from "../model/configuration.js";
|
|
2
1
|
import { IAdapter } from "./adapter.js";
|
|
3
2
|
import { AdaptCommandChain, MergeCommandChain, PostCommandChain } from "./commands/command.js";
|
|
4
3
|
import BaseApp from "../baseAppManager.js";
|
|
5
4
|
import AppVariant from "../appVariantManager.js";
|
|
6
|
-
import AnnotationManager from "../annotationManager.js";
|
|
5
|
+
import AnnotationManager from "../annotations/annotationManager.js";
|
|
7
6
|
export default class AbapAdapter implements IAdapter {
|
|
8
|
-
private configuration;
|
|
9
7
|
private annotationManager;
|
|
10
|
-
constructor(
|
|
8
|
+
constructor(annotationManager: AnnotationManager);
|
|
11
9
|
createAdaptCommandChain(baseApp: BaseApp, appVariant: AppVariant): AdaptCommandChain;
|
|
12
10
|
createMergeCommandChain(baseApp: BaseApp, appVariant: AppVariant): MergeCommandChain;
|
|
13
11
|
createPostCommandChain(): PostCommandChain;
|
|
@@ -3,10 +3,8 @@ import { AdaptCommandChain, ManifestUpdateCommandChain, MergeCommandChain, PostC
|
|
|
3
3
|
import DownloadAnnotationsCommand from "./commands/downloadAnnotationsCommand.js";
|
|
4
4
|
import I18nPropertiesMergeCommand from "./commands/i18nPropertiesMergeCommand.js";
|
|
5
5
|
export default class AbapAdapter {
|
|
6
|
-
configuration;
|
|
7
6
|
annotationManager;
|
|
8
|
-
constructor(
|
|
9
|
-
this.configuration = configuration;
|
|
7
|
+
constructor(annotationManager) {
|
|
10
8
|
this.annotationManager = annotationManager;
|
|
11
9
|
}
|
|
12
10
|
createAdaptCommandChain(baseApp, appVariant) {
|
|
@@ -19,7 +17,7 @@ export default class AbapAdapter {
|
|
|
19
17
|
new ManifestUpdateCommandChain([
|
|
20
18
|
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
21
19
|
]),
|
|
22
|
-
new DownloadAnnotationsCommand(appVariant.id, appVariant.prefix, this.annotationManager
|
|
20
|
+
new DownloadAnnotationsCommand(appVariant.id, appVariant.prefix, this.annotationManager),
|
|
23
21
|
]);
|
|
24
22
|
}
|
|
25
23
|
createMergeCommandChain(baseApp, appVariant) {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import AnnotationManager from "../../annotationManager.js";
|
|
2
|
-
import { IConfiguration } from "../../model/configuration.js";
|
|
3
1
|
import { AdaptCommand } from "./command.js";
|
|
2
|
+
import IAnnotationManager from "../../annotations/annotationManager.js";
|
|
4
3
|
export default class DownloadAnnotationsCommand extends AdaptCommand {
|
|
5
4
|
private appVariantId;
|
|
6
5
|
private prefix;
|
|
7
6
|
private annotationManager;
|
|
8
|
-
|
|
9
|
-
constructor(appVariantId: string, prefix: string, annotationManager: AnnotationManager, configuration: IConfiguration);
|
|
7
|
+
constructor(appVariantId: string, prefix: string, annotationManager: IAnnotationManager);
|
|
10
8
|
accept: (filename: string) => filename is "manifest.json";
|
|
11
9
|
execute(files: Map<string, string>, filename: string): Promise<void>;
|
|
12
10
|
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { AdaptCommand } from "./command.js";
|
|
2
|
-
import Language from "../../model/language.js";
|
|
3
2
|
export default class DownloadAnnotationsCommand extends AdaptCommand {
|
|
4
3
|
appVariantId;
|
|
5
4
|
prefix;
|
|
6
5
|
annotationManager;
|
|
7
|
-
|
|
8
|
-
constructor(appVariantId, prefix, annotationManager, configuration) {
|
|
6
|
+
constructor(appVariantId, prefix, annotationManager) {
|
|
9
7
|
super();
|
|
10
8
|
this.appVariantId = appVariantId;
|
|
11
9
|
this.prefix = prefix;
|
|
12
10
|
this.annotationManager = annotationManager;
|
|
13
|
-
this.configuration = configuration;
|
|
14
11
|
}
|
|
15
12
|
accept = (filename) => filename === "manifest.json";
|
|
16
13
|
async execute(files, filename) {
|
|
17
|
-
const languages = Language.create(this.configuration.languages);
|
|
18
14
|
const baseAppManifest = JSON.parse(files.get(filename));
|
|
19
|
-
let newFiles = await this.annotationManager.process(baseAppManifest,
|
|
15
|
+
let newFiles = await this.annotationManager.process(baseAppManifest, this.appVariantId, this.prefix);
|
|
20
16
|
if (newFiles) {
|
|
21
17
|
newFiles.forEach((value, key) => files.set(key, value));
|
|
22
18
|
}
|
|
@@ -26,16 +26,19 @@ export default class I18nPropertiesMergeCommand extends MergeCommand {
|
|
|
26
26
|
if (i18nPathWithExtension) {
|
|
27
27
|
// build regex to match specific + language related files
|
|
28
28
|
const i18nPath = trimExtension(i18nPathWithExtension);
|
|
29
|
-
const
|
|
29
|
+
const regexSource = "^" + escapeRegex(i18nPath) + TRANSLATION_REGEX_PATTERN;
|
|
30
30
|
if (change.changeType.includes("addNewModelEnhanceWith")) {
|
|
31
|
-
copyPaths.add(
|
|
31
|
+
copyPaths.add(regexSource);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
|
-
mergePaths.add(
|
|
34
|
+
mergePaths.add(regexSource);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
mergePaths: Array.from(mergePaths, source => new RegExp(source)),
|
|
40
|
+
copyPaths: Array.from(copyPaths, source => new RegExp(source))
|
|
41
|
+
};
|
|
39
42
|
}
|
|
40
43
|
async execute(files, filename, appVariantContent) {
|
|
41
44
|
// merge/copy logic
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IConfiguration } from "../model/types.js";
|
|
2
|
+
import IAnnotationManager from "./annotationManager.js";
|
|
3
|
+
import IRepository from "../repositories/repository.js";
|
|
4
|
+
export interface IAnnotationFiles {
|
|
5
|
+
annotationName: string;
|
|
6
|
+
annotationFileName: string;
|
|
7
|
+
}
|
|
8
|
+
export default class AbapAnnotationManager implements IAnnotationManager {
|
|
9
|
+
private repository;
|
|
10
|
+
private configuration;
|
|
11
|
+
constructor(configuration: IConfiguration, repository: IRepository);
|
|
12
|
+
ANNOTATIONS_FOLDER: string;
|
|
13
|
+
process(baseAppManifest: any, appVariantId: string, prefix: string): Promise<Map<string, string>>;
|
|
14
|
+
private updateManifestModel;
|
|
15
|
+
private createManifestModel;
|
|
16
|
+
private enhanceManifestModel;
|
|
17
|
+
}
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import DataSourceManager from "./
|
|
2
|
-
import I18nManager from "
|
|
3
|
-
import
|
|
1
|
+
import DataSourceManager from "./dataSource/dataSourceManager.js";
|
|
2
|
+
import I18nManager from "../i18nManager.js";
|
|
3
|
+
import Language from "../model/language.js";
|
|
4
|
+
import ServiceRequestor from "./serviceRequestor.js";
|
|
4
5
|
import { posix as path } from "path";
|
|
5
6
|
const I18N_DEFAULT_PATH = "i18n/annotations";
|
|
6
7
|
const I18N_DEFAULT_MODEL_NAME = "@i18n";
|
|
7
8
|
const SAPUI5 = "sap.ui5";
|
|
8
|
-
export default class
|
|
9
|
-
|
|
9
|
+
export default class AbapAnnotationManager {
|
|
10
|
+
repository;
|
|
10
11
|
configuration;
|
|
11
|
-
constructor(configuration,
|
|
12
|
+
constructor(configuration, repository) {
|
|
12
13
|
this.configuration = configuration;
|
|
13
|
-
this.
|
|
14
|
+
this.repository = repository;
|
|
14
15
|
}
|
|
15
16
|
ANNOTATIONS_FOLDER = "annotations";
|
|
16
|
-
async process(baseAppManifest,
|
|
17
|
+
async process(baseAppManifest, appVariantId, prefix) {
|
|
18
|
+
const languages = Language.create(this.configuration.languages);
|
|
17
19
|
//TODO: switch to this after resolving @i18n custom model
|
|
18
20
|
const modelName = I18N_DEFAULT_MODEL_NAME; //`i18n_a9n_${normalisedId}`;
|
|
19
21
|
const i18nPathName = path.join(prefix, I18N_DEFAULT_PATH);
|
|
20
22
|
const i18nManager = new I18nManager(modelName, appVariantId, languages);
|
|
21
|
-
const serviceRequestor = new ServiceRequestor(this.configuration, this.
|
|
23
|
+
const serviceRequestor = new ServiceRequestor(this.configuration, this.repository);
|
|
22
24
|
const dataSourceManager = new DataSourceManager();
|
|
23
25
|
dataSourceManager.addDataSources(baseAppManifest["sap.app"]?.dataSources);
|
|
24
26
|
const annotationFiles = await dataSourceManager.createAnnotationFiles(languages, i18nManager, serviceRequestor);
|
|
@@ -69,4 +71,4 @@ export default class AnnotationManager {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
//# sourceMappingURL=
|
|
74
|
+
//# sourceMappingURL=abapAnnotationManager.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import AbapRepoManager from "../repositories/abapRepoManager.js";
|
|
2
1
|
import { IConfiguration } from "../model/types.js";
|
|
3
2
|
import Language from "../model/language.js";
|
|
3
|
+
import IRepository from "../repositories/repository.js";
|
|
4
4
|
export default class ServiceRequestor {
|
|
5
|
-
private
|
|
5
|
+
private repository;
|
|
6
6
|
private configuration;
|
|
7
|
-
constructor(configuration: IConfiguration,
|
|
7
|
+
constructor(configuration: IConfiguration, repository: IRepository);
|
|
8
8
|
downloadAnnotation(uri: string, name: string, language: Language): Promise<string>;
|
|
9
9
|
}
|
|
@@ -35,10 +35,10 @@ function retryOnError(maxRetries) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
export default class ServiceRequestor {
|
|
38
|
-
|
|
38
|
+
repository;
|
|
39
39
|
configuration;
|
|
40
|
-
constructor(configuration,
|
|
41
|
-
this.
|
|
40
|
+
constructor(configuration, repository) {
|
|
41
|
+
this.repository = repository;
|
|
42
42
|
this.configuration = configuration;
|
|
43
43
|
}
|
|
44
44
|
//@ts-ignore tsx (esbuild) is not yet implemented the new decorators, but
|
|
@@ -47,7 +47,7 @@ export default class ServiceRequestor {
|
|
|
47
47
|
async downloadAnnotation(uri, name, language) {
|
|
48
48
|
uri += `?sap-language=${language.sap}`;
|
|
49
49
|
log.verbose(`Getting annotation '${name}' ${language} by '${uri}'`);
|
|
50
|
-
let files = await this.
|
|
50
|
+
let files = await this.repository.downloadAnnotationFile(uri);
|
|
51
51
|
if (!files || files.size === 0) {
|
|
52
52
|
throw new Error(`No files were fetched for '${name}' by '${uri}'`);
|
|
53
53
|
}
|
package/dist/bundle.js
CHANGED
|
@@ -2352,6 +2352,31 @@ var SetMinUI5Version = {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
};
|
|
2354
2354
|
|
|
2355
|
+
const rSemver = /^(0|[1-9]\d*)\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;
|
|
2356
|
+
const SetUI5VersionNumber = {
|
|
2357
|
+
applyChange(oManifest, oChange) {
|
|
2358
|
+
if (!oChange.getContent().hasOwnProperty("ui5VersionNumber")) {
|
|
2359
|
+
throw new Error("No ui5VersionNumber in change content provided");
|
|
2360
|
+
}
|
|
2361
|
+
const sUI5VersionNumber = oChange.getContent().ui5VersionNumber;
|
|
2362
|
+
if (typeof sUI5VersionNumber !== "string") {
|
|
2363
|
+
throw new Error(`The current change value type of property ui5VersionNumber is '${typeof sUI5VersionNumber}'. Only allowed type for property ui5VersionNumber is string`);
|
|
2364
|
+
}
|
|
2365
|
+
const aSemverMatch = rSemver.exec(sUI5VersionNumber);
|
|
2366
|
+
if (!aSemverMatch) {
|
|
2367
|
+
throw new Error(`The value of property ui5VersionNumber ('${sUI5VersionNumber}') is not a valid semantic version (MAJOR.MINOR or MAJOR.MINOR.PATCH)`);
|
|
2368
|
+
}
|
|
2369
|
+
const aPropertyPath = ["sap.platform.cf", "ui5VersionNumber"];
|
|
2370
|
+
const oNewVersion = new Version(sUI5VersionNumber);
|
|
2371
|
+
const oCurrVersionString = ObjectPath.get(aPropertyPath, oManifest);
|
|
2372
|
+
const oCurrVersion = oCurrVersionString ? new Version(oCurrVersionString) : null;
|
|
2373
|
+
if (!oCurrVersion || oCurrVersion.compareTo(oNewVersion) < 0) {
|
|
2374
|
+
ObjectPath.set(aPropertyPath, sUI5VersionNumber, oManifest);
|
|
2375
|
+
}
|
|
2376
|
+
return oManifest;
|
|
2377
|
+
}
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2355
2380
|
var SetRegistrationIds = {
|
|
2356
2381
|
applyChange(oManifest, oChange) {
|
|
2357
2382
|
ObjectPath.set(["sap.fiori", "registrationIds"], oChange.getContent().registrationIds, oManifest);
|
|
@@ -4020,6 +4045,7 @@ const RegistrationBuild = {
|
|
|
4020
4045
|
appdescr_ui5_addComponentUsages: () => Promise.resolve(AddComponentUsages),
|
|
4021
4046
|
appdescr_ui5_changeModel: () => Promise.resolve(ChangeModel),
|
|
4022
4047
|
appdescr_ui5_setMinUI5Version: () => Promise.resolve(SetMinUI5Version),
|
|
4048
|
+
appdescr_platform_cf_setUI5VersionNumber: () => Promise.resolve(SetUI5VersionNumber),
|
|
4023
4049
|
appdescr_fiori_setRegistrationIds: () => Promise.resolve(SetRegistrationIds),
|
|
4024
4050
|
appdescr_ui5_setFlexExtensionPointEnabled: () => Promise.resolve(SetFlexExtensionPointEnabled),
|
|
4025
4051
|
appdescr_ui5_addNewModel: () => Promise.resolve(AddNewModel),
|
|
@@ -5799,15 +5825,18 @@ var Filter = BaseObject.extend("sap.ui.model.Filter", {
|
|
|
5799
5825
|
if (!this.aFilters.every(isFilter)) {
|
|
5800
5826
|
Log.error("Filter in aggregation of multi filter has to be instance of" + " sap.ui.model.Filter");
|
|
5801
5827
|
}
|
|
5802
|
-
} else if (!this.aFilters && this.sPath !== undefined && (this.sOperator && this.oValue1
|
|
5828
|
+
} else if (!this.aFilters && this.sPath !== undefined && (this.sOperator && this.hasOwnProperty("oValue1") || this.fnTest)) {
|
|
5803
5829
|
this._bMultiFilter = false;
|
|
5804
5830
|
} else {
|
|
5805
5831
|
Log.error("Wrong parameters defined for filter.");
|
|
5806
5832
|
}
|
|
5807
5833
|
this.sFractionalSeconds1 = undefined;
|
|
5808
5834
|
this.sFractionalSeconds2 = undefined;
|
|
5835
|
+
this.bBound = undefined;
|
|
5836
|
+
this.bResolved = undefined;
|
|
5809
5837
|
}
|
|
5810
5838
|
});
|
|
5839
|
+
Filter.generated = Symbol("generated");
|
|
5811
5840
|
Filter.NONE = new Filter({
|
|
5812
5841
|
path: "/",
|
|
5813
5842
|
test: () => false
|
|
@@ -5834,6 +5863,44 @@ Filter.prototype.appendFractionalSeconds1 = function (sFractionalSeconds) {
|
|
|
5834
5863
|
Filter.prototype.appendFractionalSeconds2 = function (sFractionalSeconds) {
|
|
5835
5864
|
this.sFractionalSeconds2 = sFractionalSeconds;
|
|
5836
5865
|
};
|
|
5866
|
+
Filter.prototype.cloneWithValues = function (vNewValue1, vNewValue2) {
|
|
5867
|
+
if (this._bMultiFilter) {
|
|
5868
|
+
throw new Error("Cannot clone multi-filter");
|
|
5869
|
+
}
|
|
5870
|
+
const oClone = new Filter({
|
|
5871
|
+
path: this.sPath,
|
|
5872
|
+
operator: this.sOperator,
|
|
5873
|
+
value1: vNewValue1,
|
|
5874
|
+
value2: vNewValue2,
|
|
5875
|
+
variable: this.sVariable,
|
|
5876
|
+
condition: this.oCondition,
|
|
5877
|
+
and: this.bAnd,
|
|
5878
|
+
test: this.fnTest?.[Filter.generated] ? undefined : this.fnTest,
|
|
5879
|
+
comparator: this.fnCompare,
|
|
5880
|
+
caseSensitive: this.bCaseSensitive
|
|
5881
|
+
});
|
|
5882
|
+
oClone.bResolved = this.bResolved;
|
|
5883
|
+
oClone.bBound = this.bBound;
|
|
5884
|
+
if (oClone.bResolved === false) {
|
|
5885
|
+
oClone.bResolved = true;
|
|
5886
|
+
}
|
|
5887
|
+
return oClone;
|
|
5888
|
+
};
|
|
5889
|
+
Filter.prototype.cloneIfContained = function (oFilter, oFilterClone) {
|
|
5890
|
+
if (!this._bMultiFilter) {
|
|
5891
|
+
return this === oFilter ? oFilterClone : this;
|
|
5892
|
+
}
|
|
5893
|
+
let bReplaced = false;
|
|
5894
|
+
const aFilters = this.aFilters.map(oFilterElement => {
|
|
5895
|
+
const oClonedFilterElement = oFilterElement.cloneIfContained(oFilter, oFilterClone);
|
|
5896
|
+
bReplaced ||= oClonedFilterElement !== oFilterElement;
|
|
5897
|
+
return oClonedFilterElement;
|
|
5898
|
+
});
|
|
5899
|
+
return bReplaced ? new Filter({
|
|
5900
|
+
filters: aFilters,
|
|
5901
|
+
and: this.bAnd
|
|
5902
|
+
}) : this;
|
|
5903
|
+
};
|
|
5837
5904
|
var Type = {
|
|
5838
5905
|
Logical: "Logical",
|
|
5839
5906
|
Binary: "Binary",
|
|
@@ -6031,9 +6098,58 @@ Filter.prototype.getVariable = function () {
|
|
|
6031
6098
|
Filter.prototype.isAnd = function () {
|
|
6032
6099
|
return !!this.bAnd;
|
|
6033
6100
|
};
|
|
6101
|
+
Filter.prototype.isBound = function () {
|
|
6102
|
+
return !!this.bBound;
|
|
6103
|
+
};
|
|
6034
6104
|
Filter.prototype.isCaseSensitive = function () {
|
|
6035
6105
|
return this.bCaseSensitive;
|
|
6036
6106
|
};
|
|
6107
|
+
Filter.prototype.isMultiFilter = function () {
|
|
6108
|
+
return this._bMultiFilter;
|
|
6109
|
+
};
|
|
6110
|
+
Filter.prototype.isNeutral = function () {
|
|
6111
|
+
if (this._bMultiFilter) {
|
|
6112
|
+
throw new Error("Multi-filter unsupported");
|
|
6113
|
+
}
|
|
6114
|
+
if (this.bResolved === undefined) {
|
|
6115
|
+
return false;
|
|
6116
|
+
}
|
|
6117
|
+
if (this.bResolved === false) {
|
|
6118
|
+
return true;
|
|
6119
|
+
}
|
|
6120
|
+
const nullish = oValue => oValue === undefined || oValue === null;
|
|
6121
|
+
return this.sOperator === FilterOperator.BT || this.sOperator === FilterOperator.NB ? nullish(this.oValue1) || nullish(this.oValue2) : nullish(this.oValue1);
|
|
6122
|
+
};
|
|
6123
|
+
Filter.prototype.isResolved = function () {
|
|
6124
|
+
return this._bMultiFilter ? this.aFilters.every(oFilter => oFilter.isResolved()) : this.bResolved !== false;
|
|
6125
|
+
};
|
|
6126
|
+
Filter.prototype.removeAllNeutrals = function () {
|
|
6127
|
+
if (!this._bMultiFilter) {
|
|
6128
|
+
return this.isNeutral() ? undefined : this;
|
|
6129
|
+
}
|
|
6130
|
+
const aFilters = [];
|
|
6131
|
+
this.aFilters.forEach(oFilter => {
|
|
6132
|
+
const oNewFilter = oFilter.removeAllNeutrals();
|
|
6133
|
+
if (oNewFilter) {
|
|
6134
|
+
aFilters.push(oNewFilter);
|
|
6135
|
+
}
|
|
6136
|
+
});
|
|
6137
|
+
if (aFilters.length === this.aFilters.length) {
|
|
6138
|
+
return this;
|
|
6139
|
+
} else if (!aFilters.length) {
|
|
6140
|
+
return undefined;
|
|
6141
|
+
}
|
|
6142
|
+
return new Filter({
|
|
6143
|
+
filters: aFilters,
|
|
6144
|
+
and: this.bAnd
|
|
6145
|
+
});
|
|
6146
|
+
};
|
|
6147
|
+
Filter.prototype.setBound = function () {
|
|
6148
|
+
this.bBound = true;
|
|
6149
|
+
};
|
|
6150
|
+
Filter.prototype.setResolved = function (bResolved) {
|
|
6151
|
+
this.bResolved = !!bResolved;
|
|
6152
|
+
};
|
|
6037
6153
|
Filter.defaultComparator = function (a, b) {
|
|
6038
6154
|
if (a == b) {
|
|
6039
6155
|
return 0;
|
|
@@ -6437,7 +6553,8 @@ _Helper = {
|
|
|
6437
6553
|
var oSyncPromise = this[sFetch].apply(this, arguments);
|
|
6438
6554
|
if (oSyncPromise.isFulfilled()) {
|
|
6439
6555
|
return oSyncPromise.getResult();
|
|
6440
|
-
}
|
|
6556
|
+
}
|
|
6557
|
+
if (bThrow) {
|
|
6441
6558
|
if (oSyncPromise.isRejected()) {
|
|
6442
6559
|
oSyncPromise.caught();
|
|
6443
6560
|
throw oSyncPromise.getResult();
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { logBuilderVersion } from "./util/commonUtil.js";
|
|
|
3
3
|
import AppVariant from "./appVariantManager.js";
|
|
4
4
|
import BaseApp from "./baseAppManager.js";
|
|
5
5
|
import ResourceUtil from "./util/resourceUtil.js";
|
|
6
|
-
import { determineProcessor } from "./processors/processor.js";
|
|
7
6
|
import FilesUtil from "./util/filesUtil.js";
|
|
8
7
|
import PreviewManager from "./previewManager.js";
|
|
8
|
+
import { initialize } from "./landscapeConfiguration.js";
|
|
9
9
|
/**
|
|
10
10
|
* Creates an appVariant bundle from the provided resources.
|
|
11
11
|
*/
|
|
@@ -13,11 +13,10 @@ export default ({ workspace, options, taskUtil }) => {
|
|
|
13
13
|
dotenv.config();
|
|
14
14
|
async function process(workspace, taskUtil) {
|
|
15
15
|
logBuilderVersion();
|
|
16
|
-
const
|
|
17
|
-
const adapter = processor.getAdapter();
|
|
16
|
+
const { repository, adapter } = initialize(options.configuration);
|
|
18
17
|
const adaptationProject = await AppVariant.fromWorkspace(workspace, options.projectNamespace);
|
|
19
|
-
const previewManagerPromise = PreviewManager.createFromRoot(adaptationProject.reference,
|
|
20
|
-
const appVariantIdHierarchy = await
|
|
18
|
+
const previewManagerPromise = PreviewManager.createFromRoot(adaptationProject.reference, repository, options.configuration);
|
|
19
|
+
const appVariantIdHierarchy = await repository.getAppVariantIdHierarchy(adaptationProject.reference);
|
|
21
20
|
if (appVariantIdHierarchy.length === 0) {
|
|
22
21
|
throw new Error(`No app variant found for reference ${adaptationProject.reference}`);
|
|
23
22
|
}
|
|
@@ -25,7 +24,7 @@ export default ({ workspace, options, taskUtil }) => {
|
|
|
25
24
|
// latest app variant on top. We reverse the list to process original
|
|
26
25
|
// application first and then app variants in chronological order.
|
|
27
26
|
const reversedHierarchy = appVariantIdHierarchy.toReversed();
|
|
28
|
-
const fetchFilesPromises = reversedHierarchy.map(({ repoName, cachebusterToken }) =>
|
|
27
|
+
const fetchFilesPromises = reversedHierarchy.map(({ repoName, cachebusterToken }) => repository.fetch(repoName, cachebusterToken));
|
|
29
28
|
fetchFilesPromises.push(Promise.resolve(adaptationProject.files));
|
|
30
29
|
const appVariants = new Array();
|
|
31
30
|
const adapt = async (baseAppFiles, appVariantFiles) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IConfiguration } from "./model/types.js";
|
|
2
|
+
import { IAdapter } from "./adapters/adapter.js";
|
|
3
|
+
import IRepository from "./repositories/repository.js";
|
|
4
|
+
import IAnnotationManager from "./annotations/annotationManager.js";
|
|
5
|
+
export declare function initialize(configuration: IConfiguration): {
|
|
6
|
+
adapter: IAdapter;
|
|
7
|
+
repository: IRepository;
|
|
8
|
+
annotationManager: IAnnotationManager;
|
|
9
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import AbapAdapter from "./adapters/abapAdapter.js";
|
|
2
|
+
import CFAdapter from "./adapters/cfAdapter.js";
|
|
3
|
+
import PreviewAdapter from "./adapters/previewAdapter.js";
|
|
4
|
+
import AbapRepository from "./repositories/abapRepository.js";
|
|
5
|
+
import HTML5Repository from "./repositories/html5Repository.js";
|
|
6
|
+
import LocalRepository from "./repositories/localRepository.js";
|
|
7
|
+
import AbapAnnotationManager from "./annotations/abapAnnotationManager.js";
|
|
8
|
+
import LocalAnnotationManager from "./annotations/localAnnotationManager.js";
|
|
9
|
+
import { validateObject } from "./util/commonUtil.js";
|
|
10
|
+
export function initialize(configuration) {
|
|
11
|
+
validateObject(configuration, ["type"], "should be specified in ui5.yaml configuration: 'cf' or 'abap'");
|
|
12
|
+
const repository = getRepository(configuration);
|
|
13
|
+
const annotationManager = getAnnotationManager(configuration, repository);
|
|
14
|
+
return {
|
|
15
|
+
adapter: getAdapter(configuration, annotationManager),
|
|
16
|
+
repository,
|
|
17
|
+
annotationManager
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function getAdapter(configuration, annotationManager) {
|
|
21
|
+
if (isPreview(configuration)) {
|
|
22
|
+
return new PreviewAdapter(configuration);
|
|
23
|
+
}
|
|
24
|
+
switch (configuration.type) {
|
|
25
|
+
case "abap":
|
|
26
|
+
return new AbapAdapter(annotationManager);
|
|
27
|
+
case "cf":
|
|
28
|
+
return new CFAdapter(configuration);
|
|
29
|
+
default:
|
|
30
|
+
throw new Error(`No adapter found for the given configuration type '${configuration.type}'`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function getRepository(configuration) {
|
|
34
|
+
if (isLocal(configuration)) {
|
|
35
|
+
return new LocalRepository(configuration);
|
|
36
|
+
}
|
|
37
|
+
switch (configuration.type) {
|
|
38
|
+
case "abap":
|
|
39
|
+
return new AbapRepository(configuration);
|
|
40
|
+
case "cf":
|
|
41
|
+
return new HTML5Repository(configuration);
|
|
42
|
+
default:
|
|
43
|
+
throw new Error(`No repository found for the given configuration type '${configuration.type}'`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getAnnotationManager(configuration, repository) {
|
|
47
|
+
if (isLocal(configuration)) {
|
|
48
|
+
return new LocalAnnotationManager();
|
|
49
|
+
}
|
|
50
|
+
switch (configuration.type) {
|
|
51
|
+
case "abap":
|
|
52
|
+
return new AbapAnnotationManager(configuration, repository);
|
|
53
|
+
case "cf":
|
|
54
|
+
return new LocalAnnotationManager();
|
|
55
|
+
default:
|
|
56
|
+
throw new Error(`No annotation manager found for the given configuration type '${configuration.type}'`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function isLocal(configuration) {
|
|
60
|
+
return process.env.ADP_BUILDER_MODE === "local" || configuration.mode === "local";
|
|
61
|
+
}
|
|
62
|
+
function isPreview(configuration) {
|
|
63
|
+
return process.env.ADP_BUILDER_MODE === "preview" || configuration.mode === "preview";
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=landscapeConfiguration.js.map
|
|
@@ -9,12 +9,14 @@ export interface IConfiguration {
|
|
|
9
9
|
sapCloudService?: string;
|
|
10
10
|
destination?: string;
|
|
11
11
|
type?: "cf" | "abap";
|
|
12
|
+
mode?: "preview" | "local" | "default";
|
|
12
13
|
languages?: any[] | undefined;
|
|
13
14
|
enableAnnotationCache?: boolean;
|
|
14
15
|
enableBetaFeatures?: boolean;
|
|
15
16
|
writeTempFiles?: any;
|
|
16
17
|
target?: AbapTarget & IAbapTargetMeta;
|
|
17
18
|
serviceInstanceName?: string;
|
|
19
|
+
adpDir?: string;
|
|
18
20
|
}
|
|
19
21
|
export interface IAbapTargetMeta {
|
|
20
22
|
name?: string;
|
package/dist/previewManager.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import IProcessor from "./processors/processor.js";
|
|
2
1
|
import { IConfiguration } from "./model/types.js";
|
|
2
|
+
import IRepository from "./repositories/repository.js";
|
|
3
3
|
export default class PreviewManager {
|
|
4
4
|
private readonly fetchLibsPromises;
|
|
5
5
|
private readonly configuration;
|
|
6
|
-
static createFromRoot(appId: string,
|
|
6
|
+
static createFromRoot(appId: string, repository: IRepository, configuration: IConfiguration): Promise<PreviewManager>;
|
|
7
7
|
static isPreviewRequested(): boolean;
|
|
8
8
|
private constructor();
|
|
9
9
|
processPreviewResources(baseAppFiles: ReadonlyMap<string, string>): Promise<void>;
|