@ui5/task-adaptation 1.6.2 → 1.6.4-rc.1
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 +5 -16
- package/dist/adapters/adapter.d.ts +3 -1
- package/dist/adapters/adapter.js +15 -1
- package/dist/adapters/cfAdapter.js +3 -12
- package/dist/adapters/commands/command.d.ts +3 -8
- package/dist/adapters/commands/command.js +5 -7
- package/dist/adapters/commands/downloadAnnotationsCommand.d.ts +2 -4
- package/dist/adapters/commands/downloadAnnotationsCommand.js +2 -6
- package/dist/adapters/commands/xsAppJsonEnhanceRoutesCommand.js +5 -24
- package/dist/adapters/previewAdapter.d.ts +10 -2
- package/dist/adapters/previewAdapter.js +14 -1
- 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 +6 -7
- 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 +4 -3
- package/dist/previewManager.js +15 -15
- 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 +62 -0
- package/dist/repositories/repository.d.ts +8 -0
- package/dist/repositories/repository.js +2 -0
- package/dist/util/cf/xsAppJsonUtil.d.ts +2 -1
- package/dist/util/cf/xsAppJsonUtil.js +19 -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 +6 -3
- 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.1...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v1.6.4-rc.1"></a>
|
|
8
|
+
## [v1.6.4-rc.1] - 2026-04-06
|
|
9
|
+
|
|
10
|
+
<a name="v1.6.3"></a>
|
|
11
|
+
## [v1.6.3] - 2026-03-18
|
|
6
12
|
|
|
7
13
|
<a name="v1.6.2"></a>
|
|
8
14
|
## [v1.6.2] - 2026-03-16
|
|
@@ -21,6 +27,24 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
21
27
|
|
|
22
28
|
<a name="v1.5.4"></a>
|
|
23
29
|
## [v1.5.4] - 2026-02-16
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
<a name="v1.6.0-rc.4"></a>
|
|
35
|
+
## [v1.6.0-rc.4] - 2026-02-12
|
|
36
|
+
|
|
37
|
+
<a name="v1.6.0-rc.3"></a>
|
|
38
|
+
## [v1.6.0-rc.3] - 2026-02-05
|
|
39
|
+
|
|
40
|
+
<a name="v1.6.0-rc.2"></a>
|
|
41
|
+
## [v1.6.0-rc.2] - 2026-02-05
|
|
42
|
+
|
|
43
|
+
<a name="v1.6.0-rc.1"></a>
|
|
44
|
+
## [v1.6.0-rc.1] - 2026-02-05
|
|
45
|
+
|
|
46
|
+
<a name="v1.6.0-rc.0"></a>
|
|
47
|
+
## [v1.6.0-rc.0] - 2026-02-02
|
|
24
48
|
|
|
25
49
|
<a name="v1.5.3"></a>
|
|
26
50
|
## [v1.5.3] - 2025-09-29
|
|
@@ -31,6 +55,12 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
31
55
|
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
32
56
|
|
|
33
57
|
|
|
58
|
+
<a name="v1.5.2-rc.1"></a>
|
|
59
|
+
## [v1.5.2-rc.1] - 2025-08-22
|
|
60
|
+
|
|
61
|
+
<a name="v1.5.2-rc.0"></a>
|
|
62
|
+
## [v1.5.2-rc.0] - 2025-08-19
|
|
63
|
+
|
|
34
64
|
<a name="v1.5.1"></a>
|
|
35
65
|
## [v1.5.1] - 2025-08-06
|
|
36
66
|
|
|
@@ -146,14 +176,23 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
146
176
|
<a name="v1.0.0"></a>
|
|
147
177
|
## v1.0.0 - 2020-12-09
|
|
148
178
|
|
|
179
|
+
[v1.6.4-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.3...v1.6.4-rc.1
|
|
180
|
+
[v1.6.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.2...v1.6.3
|
|
149
181
|
[v1.6.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.1...v1.6.2
|
|
150
182
|
[v1.6.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0...v1.6.1
|
|
151
183
|
[v1.6.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.2.0...v1.6.0
|
|
152
184
|
[v0.2.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.1.0...v0.2.0
|
|
153
185
|
[v0.1.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.4...v0.1.0
|
|
154
|
-
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.
|
|
186
|
+
[v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.4...v1.5.4
|
|
187
|
+
[v1.6.0-rc.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.3...v1.6.0-rc.4
|
|
188
|
+
[v1.6.0-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.2...v1.6.0-rc.3
|
|
189
|
+
[v1.6.0-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.1...v1.6.0-rc.2
|
|
190
|
+
[v1.6.0-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.0...v1.6.0-rc.1
|
|
191
|
+
[v1.6.0-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.3...v1.6.0-rc.0
|
|
155
192
|
[v1.5.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2...v1.5.3
|
|
156
|
-
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2
|
|
193
|
+
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.1...v1.5.2
|
|
194
|
+
[v1.5.2-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.0...v1.5.2-rc.1
|
|
195
|
+
[v1.5.2-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2-rc.0
|
|
157
196
|
[v1.5.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.1
|
|
158
197
|
[v1.4.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.2...v1.4.3
|
|
159
198
|
[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;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
+
import { getCommonManifestUpdateCommands } from "./adapter.js";
|
|
1
2
|
import { AdaptCommandChain, ManifestUpdateCommandChain, MergeCommandChain, PostCommandChain } from "./commands/command.js";
|
|
2
|
-
import AddAppVariantIdHierarchyCommand from "./commands/addAppVariantIdHierarchyCommand.js";
|
|
3
|
-
import ApplyDescriptorChangesCommand from "./commands/applyDescriptorChangesCommand.js";
|
|
4
|
-
import SetAppVariantIdCommand from "./commands/setAppVariantIdCommand.js";
|
|
5
|
-
import UpdateComponentNameCommand from "./commands/updateComponentNameCommand.js";
|
|
6
3
|
import DownloadAnnotationsCommand from "./commands/downloadAnnotationsCommand.js";
|
|
7
4
|
import I18nPropertiesMergeCommand from "./commands/i18nPropertiesMergeCommand.js";
|
|
8
|
-
import UpdateCloudDevAdaptationCommand from "./commands/updateCloudDevAdaptationCommand.js";
|
|
9
5
|
export default class AbapAdapter {
|
|
10
|
-
configuration;
|
|
11
6
|
annotationManager;
|
|
12
|
-
constructor(
|
|
13
|
-
this.configuration = configuration;
|
|
7
|
+
constructor(annotationManager) {
|
|
14
8
|
this.annotationManager = annotationManager;
|
|
15
9
|
}
|
|
16
10
|
createAdaptCommandChain(baseApp, appVariant) {
|
|
17
|
-
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
18
11
|
const appVariantIdHierarchyItem = {
|
|
19
12
|
appVariantId: baseApp.id,
|
|
20
13
|
version: baseApp.version,
|
|
@@ -22,18 +15,14 @@ export default class AbapAdapter {
|
|
|
22
15
|
};
|
|
23
16
|
return new AdaptCommandChain(baseApp.files, [
|
|
24
17
|
new ManifestUpdateCommandChain([
|
|
25
|
-
|
|
26
|
-
new UpdateComponentNameCommand(baseApp.id),
|
|
27
|
-
new ApplyDescriptorChangesCommand(manifestChanges, appVariant.prefix),
|
|
28
|
-
new AddAppVariantIdHierarchyCommand(appVariantIdHierarchyItem),
|
|
29
|
-
new UpdateCloudDevAdaptationCommand(),
|
|
18
|
+
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
30
19
|
]),
|
|
31
|
-
new DownloadAnnotationsCommand(appVariant.id, appVariant.prefix, this.annotationManager
|
|
20
|
+
new DownloadAnnotationsCommand(appVariant.id, appVariant.prefix, this.annotationManager),
|
|
32
21
|
]);
|
|
33
22
|
}
|
|
34
23
|
createMergeCommandChain(baseApp, appVariant) {
|
|
35
24
|
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
36
|
-
return new MergeCommandChain([
|
|
25
|
+
return new MergeCommandChain(appVariant.getProcessedFiles(), [
|
|
37
26
|
new I18nPropertiesMergeCommand(baseApp.i18nPath, appVariant.prefix, manifestChanges),
|
|
38
27
|
]);
|
|
39
28
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import AppVariant from "../appVariantManager.js";
|
|
2
2
|
import BaseApp from "../baseAppManager.js";
|
|
3
|
-
import {
|
|
3
|
+
import { IAppVariantIdHierarchyManifestItem } from "../model/appVariantIdHierarchyItem.js";
|
|
4
|
+
import { AdaptCommandChain, ManifestUpdateCommand, MergeCommandChain, PostCommandChain } from "./commands/command.js";
|
|
4
5
|
export interface IAdapter {
|
|
5
6
|
createAdaptCommandChain(baseApp: BaseApp, appVariant: AppVariant): AdaptCommandChain;
|
|
6
7
|
createMergeCommandChain(baseApp: BaseApp, appVariant: AppVariant): MergeCommandChain;
|
|
7
8
|
createPostCommandChain(): PostCommandChain;
|
|
8
9
|
}
|
|
10
|
+
export declare function getCommonManifestUpdateCommands(baseApp: BaseApp, appVariant: AppVariant, appVariantIdHierarchyItem: IAppVariantIdHierarchyManifestItem): ManifestUpdateCommand[];
|
package/dist/adapters/adapter.js
CHANGED
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import AddAppVariantIdHierarchyCommand from "./commands/addAppVariantIdHierarchyCommand.js";
|
|
2
|
+
import ApplyDescriptorChangesCommand from "./commands/applyDescriptorChangesCommand.js";
|
|
3
|
+
import SetAppVariantIdCommand from "./commands/setAppVariantIdCommand.js";
|
|
4
|
+
import UpdateCloudDevAdaptationCommand from "./commands/updateCloudDevAdaptationCommand.js";
|
|
5
|
+
import UpdateComponentNameCommand from "./commands/updateComponentNameCommand.js";
|
|
6
|
+
export function getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem) {
|
|
7
|
+
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
8
|
+
return [
|
|
9
|
+
new SetAppVariantIdCommand(appVariant.id),
|
|
10
|
+
new UpdateComponentNameCommand(baseApp.id),
|
|
11
|
+
new ApplyDescriptorChangesCommand(manifestChanges, appVariant.prefix),
|
|
12
|
+
new AddAppVariantIdHierarchyCommand(appVariantIdHierarchyItem),
|
|
13
|
+
new UpdateCloudDevAdaptationCommand(),
|
|
14
|
+
];
|
|
15
|
+
}
|
|
2
16
|
//# sourceMappingURL=adapter.js.map
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
+
import { getCommonManifestUpdateCommands } from "./adapter.js";
|
|
1
2
|
import { AdaptCommandChain, ManifestUpdateCommandChain, MergeCommandChain, PostCommandChain } from "./commands/command.js";
|
|
2
3
|
import XsAppJsonEnhanceRoutesCommand from "./commands/xsAppJsonEnhanceRoutesCommand.js";
|
|
3
|
-
import AddAppVariantIdHierarchyCommand from "./commands/addAppVariantIdHierarchyCommand.js";
|
|
4
|
-
import UpdateCloudDevAdaptationCommand from "./commands/updateCloudDevAdaptationCommand.js";
|
|
5
4
|
import UpdateCloudPlatformCommand from "./commands/updateCloudPlatformCommand.js";
|
|
6
|
-
import ApplyDescriptorChangesCommand from "./commands/applyDescriptorChangesCommand.js";
|
|
7
|
-
import SetAppVariantIdCommand from "./commands/setAppVariantIdCommand.js";
|
|
8
|
-
import UpdateComponentNameCommand from "./commands/updateComponentNameCommand.js";
|
|
9
5
|
import I18nPropertiesMergeCommand from "./commands/i18nPropertiesMergeCommand.js";
|
|
10
6
|
import XsAppJsonMergeCommand from "./commands/xsAppJsonMergeCommand.js";
|
|
11
7
|
export default class CFAdapter {
|
|
@@ -14,25 +10,20 @@ export default class CFAdapter {
|
|
|
14
10
|
this.configuration = configuration;
|
|
15
11
|
}
|
|
16
12
|
createAdaptCommandChain(baseApp, appVariant) {
|
|
17
|
-
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
18
13
|
const appVariantIdHierarchyItem = {
|
|
19
14
|
appVariantId: baseApp.id,
|
|
20
15
|
version: baseApp.version
|
|
21
16
|
};
|
|
22
17
|
return new AdaptCommandChain(baseApp.files, [
|
|
23
18
|
new ManifestUpdateCommandChain([
|
|
24
|
-
|
|
25
|
-
new UpdateComponentNameCommand(baseApp.id),
|
|
26
|
-
new ApplyDescriptorChangesCommand(manifestChanges, appVariant.prefix),
|
|
27
|
-
new AddAppVariantIdHierarchyCommand(appVariantIdHierarchyItem),
|
|
28
|
-
new UpdateCloudDevAdaptationCommand(),
|
|
19
|
+
...getCommonManifestUpdateCommands(baseApp, appVariant, appVariantIdHierarchyItem),
|
|
29
20
|
new UpdateCloudPlatformCommand(this.configuration.sapCloudService),
|
|
30
21
|
]),
|
|
31
22
|
]);
|
|
32
23
|
}
|
|
33
24
|
createMergeCommandChain(baseApp, appVariant) {
|
|
34
25
|
const manifestChanges = appVariant.getProcessedManifestChanges();
|
|
35
|
-
return new MergeCommandChain([
|
|
26
|
+
return new MergeCommandChain(appVariant.getProcessedFiles(), [
|
|
36
27
|
new I18nPropertiesMergeCommand(baseApp.i18nPath, appVariant.prefix, manifestChanges),
|
|
37
28
|
new XsAppJsonMergeCommand(),
|
|
38
29
|
]);
|
|
@@ -14,8 +14,6 @@ export declare class AdaptCommandChain {
|
|
|
14
14
|
constructor(files: ReadonlyMap<string, string>, commands: AdaptCommand[]);
|
|
15
15
|
/**
|
|
16
16
|
* Executes all commands in the chain that accept the given filename
|
|
17
|
-
* @param files - Map of all files being processed
|
|
18
|
-
* @param filename - The current file being processed
|
|
19
17
|
*/
|
|
20
18
|
execute(): Promise<ReadonlyMap<string, string>>;
|
|
21
19
|
}
|
|
@@ -35,15 +33,14 @@ export declare abstract class MergeCommand {
|
|
|
35
33
|
* It manages a collection of commands and executes them in sequence
|
|
36
34
|
*/
|
|
37
35
|
export declare class MergeCommandChain {
|
|
36
|
+
private appVariantFiles;
|
|
38
37
|
private commands;
|
|
39
|
-
constructor(commands?: MergeCommand[]);
|
|
38
|
+
constructor(appVariantFiles: ReadonlyMap<string, string>, commands?: MergeCommand[]);
|
|
40
39
|
/**
|
|
41
40
|
* Executes all commands in the chain that accept the given filename
|
|
42
41
|
* @param files - Map of all files being processed
|
|
43
|
-
* @param filename - The current file being processed
|
|
44
|
-
* @param appVariantContent - Content from the app variant
|
|
45
42
|
*/
|
|
46
|
-
execute(files: ReadonlyMap<string, string
|
|
43
|
+
execute(files: ReadonlyMap<string, string>): Promise<ReadonlyMap<string, string>>;
|
|
47
44
|
}
|
|
48
45
|
export declare abstract class ManifestUpdateCommand {
|
|
49
46
|
readonly commandType = "manifestUpdate";
|
|
@@ -64,8 +61,6 @@ export declare abstract class PostCommand {
|
|
|
64
61
|
/**
|
|
65
62
|
* Executes the command on the specified file
|
|
66
63
|
* @param files - Map of all files being processed
|
|
67
|
-
* @param filename - The current file being processed
|
|
68
|
-
* @param appVariantContent - Content from the app variant
|
|
69
64
|
*/
|
|
70
65
|
abstract execute(files: Map<string, string>): Promise<void>;
|
|
71
66
|
}
|
|
@@ -10,8 +10,6 @@ export class AdaptCommandChain {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Executes all commands in the chain that accept the given filename
|
|
13
|
-
* @param files - Map of all files being processed
|
|
14
|
-
* @param filename - The current file being processed
|
|
15
13
|
*/
|
|
16
14
|
async execute() {
|
|
17
15
|
const filesCopy = new Map(this.files);
|
|
@@ -33,19 +31,19 @@ export class MergeCommand {
|
|
|
33
31
|
* It manages a collection of commands and executes them in sequence
|
|
34
32
|
*/
|
|
35
33
|
export class MergeCommandChain {
|
|
34
|
+
appVariantFiles;
|
|
36
35
|
commands;
|
|
37
|
-
constructor(commands = []) {
|
|
36
|
+
constructor(appVariantFiles, commands = []) {
|
|
37
|
+
this.appVariantFiles = appVariantFiles;
|
|
38
38
|
this.commands = commands;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Executes all commands in the chain that accept the given filename
|
|
42
42
|
* @param files - Map of all files being processed
|
|
43
|
-
* @param filename - The current file being processed
|
|
44
|
-
* @param appVariantContent - Content from the app variant
|
|
45
43
|
*/
|
|
46
|
-
async execute(files
|
|
44
|
+
async execute(files) {
|
|
47
45
|
const filesCopy = new Map(files);
|
|
48
|
-
for (const [filename, appVariantContent] of appVariantFiles) {
|
|
46
|
+
for (const [filename, appVariantContent] of this.appVariantFiles) {
|
|
49
47
|
const acceptedCommands = this.commands.filter(command => command.accept(filename));
|
|
50
48
|
if (acceptedCommands.length > 0) {
|
|
51
49
|
for (const command of acceptedCommands) {
|
|
@@ -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
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import CFUtil from "../../util/cfUtil.js";
|
|
3
|
-
import { getLogger } from "@ui5/logger";
|
|
1
|
+
import { fetchCredentialsAndEnhanceRoutes } from "../../util/cf/xsAppJsonUtil.js";
|
|
4
2
|
import { PostCommand } from "./command.js";
|
|
5
|
-
const log = getLogger("@ui5/task-adaptation::CFProcessor");
|
|
6
3
|
export default class XsAppJsonEnhanceRoutesCommand extends PostCommand {
|
|
7
4
|
configuration;
|
|
8
5
|
constructor(configuration) {
|
|
@@ -10,26 +7,10 @@ export default class XsAppJsonEnhanceRoutesCommand extends PostCommand {
|
|
|
10
7
|
this.configuration = configuration;
|
|
11
8
|
}
|
|
12
9
|
async execute(files) {
|
|
13
|
-
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let serviceCredentials;
|
|
18
|
-
try {
|
|
19
|
-
// Get valid service keys with proper endpoints structure
|
|
20
|
-
serviceCredentials = await CFUtil.getOrCreateServiceKeyWithEndpoints(serviceInstanceName, space);
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
throw new Error(`Failed to get valid service keys for app '${this.configuration.appName}': ${error.message}`);
|
|
24
|
-
}
|
|
25
|
-
if (serviceCredentials) {
|
|
26
|
-
const xsAppJson = files.get("xs-app.json");
|
|
27
|
-
if (xsAppJson) {
|
|
28
|
-
files.set("xs-app.json", enhanceRoutesWithEndpointAndService(xsAppJson, serviceCredentials));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
log.info(`No endpoints found for app '${this.configuration.appName}'. xs-app.json will not be updated.`);
|
|
10
|
+
let xsAppJson = files.get("xs-app.json");
|
|
11
|
+
if (xsAppJson) {
|
|
12
|
+
xsAppJson = await fetchCredentialsAndEnhanceRoutes(xsAppJson, this.configuration);
|
|
13
|
+
files.set("xs-app.json", xsAppJson);
|
|
33
14
|
}
|
|
34
15
|
}
|
|
35
16
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import AppVariant from "../appVariantManager.js";
|
|
2
|
+
import BaseApp from "../baseAppManager.js";
|
|
3
|
+
import { IConfiguration } from "../model/configuration.js";
|
|
1
4
|
import { IAdapter } from "./adapter.js";
|
|
2
|
-
import
|
|
3
|
-
export default class PreviewAdapter
|
|
5
|
+
import { AdaptCommandChain, MergeCommandChain, PostCommandChain } from "./commands/command.js";
|
|
6
|
+
export default class PreviewAdapter implements IAdapter {
|
|
7
|
+
private cfAdapter;
|
|
8
|
+
constructor(configuration: IConfiguration);
|
|
9
|
+
createAdaptCommandChain(baseApp: BaseApp, appVariant: AppVariant): AdaptCommandChain;
|
|
10
|
+
createMergeCommandChain(baseApp: BaseApp, appVariant: AppVariant): MergeCommandChain;
|
|
11
|
+
createPostCommandChain(): PostCommandChain;
|
|
4
12
|
}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import CFAdapter from "./cfAdapter.js";
|
|
2
|
-
export default class PreviewAdapter
|
|
2
|
+
export default class PreviewAdapter {
|
|
3
|
+
cfAdapter;
|
|
4
|
+
constructor(configuration) {
|
|
5
|
+
this.cfAdapter = new CFAdapter(configuration);
|
|
6
|
+
}
|
|
7
|
+
createAdaptCommandChain(baseApp, appVariant) {
|
|
8
|
+
return this.cfAdapter.createAdaptCommandChain(baseApp, appVariant);
|
|
9
|
+
}
|
|
10
|
+
createMergeCommandChain(baseApp, appVariant) {
|
|
11
|
+
return this.cfAdapter.createMergeCommandChain(baseApp, appVariant);
|
|
12
|
+
}
|
|
13
|
+
createPostCommandChain() {
|
|
14
|
+
return this.cfAdapter.createPostCommandChain();
|
|
15
|
+
}
|
|
3
16
|
}
|
|
4
17
|
//# sourceMappingURL=previewAdapter.js.map
|
|
@@ -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
|
}
|