@ui5/task-adaptation 1.6.4 → 1.6.5-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.
Files changed (50) hide show
  1. package/CHANGELOG.md +49 -6
  2. package/dist/adapters/abapAdapter.d.ts +2 -4
  3. package/dist/adapters/abapAdapter.js +2 -4
  4. package/dist/adapters/commands/downloadAnnotationsCommand.d.ts +2 -4
  5. package/dist/adapters/commands/downloadAnnotationsCommand.js +2 -6
  6. package/dist/annotations/abapAnnotationManager.d.ts +17 -0
  7. package/dist/{annotationManager.js → annotations/abapAnnotationManager.js} +12 -10
  8. package/dist/annotations/annotationManager.d.ts +3 -0
  9. package/dist/annotations/annotationManager.js +2 -0
  10. package/dist/annotations/cfAnnotationManager.d.ts +4 -0
  11. package/dist/annotations/cfAnnotationManager.js +7 -0
  12. package/dist/annotations/localAnnotationManager.d.ts +4 -0
  13. package/dist/annotations/localAnnotationManager.js +7 -0
  14. package/dist/annotations/serviceRequestor.d.ts +3 -3
  15. package/dist/annotations/serviceRequestor.js +4 -4
  16. package/dist/appVariantManager.js +2 -5
  17. package/dist/index.js +5 -6
  18. package/dist/landscapeConfiguration.d.ts +9 -0
  19. package/dist/landscapeConfiguration.js +66 -0
  20. package/dist/model/configuration.d.ts +2 -0
  21. package/dist/model/types.d.ts +0 -1
  22. package/dist/previewManager.d.ts +2 -2
  23. package/dist/previewManager.js +7 -7
  24. package/dist/repositories/{abapRepoManager.d.ts → abapRepository.d.ts} +5 -3
  25. package/dist/repositories/{abapRepoManager.js → abapRepository.js} +17 -4
  26. package/dist/repositories/html5Repository.d.ts +18 -0
  27. package/dist/repositories/{html5RepoManager.js → html5Repository.js} +58 -27
  28. package/dist/repositories/localRepository.d.ts +16 -0
  29. package/dist/repositories/localRepository.js +67 -0
  30. package/dist/repositories/repository.d.ts +8 -0
  31. package/dist/repositories/repository.js +2 -0
  32. package/dist/util/commonUtil.d.ts +1 -0
  33. package/dist/util/commonUtil.js +3 -0
  34. package/dist/util/filesUtil.d.ts +0 -2
  35. package/dist/util/filesUtil.js +0 -7
  36. package/dist/util/fsUtil.d.ts +2 -0
  37. package/dist/util/fsUtil.js +34 -0
  38. package/package.json +4 -7
  39. package/scripts/publish.ts +256 -0
  40. package/scripts/test-integration-prep.sh +4 -0
  41. package/dist/annotationManager.d.ts +0 -17
  42. package/dist/processors/abapProcessor.d.ts +0 -18
  43. package/dist/processors/abapProcessor.js +0 -43
  44. package/dist/processors/cfProcessor.d.ts +0 -14
  45. package/dist/processors/cfProcessor.js +0 -46
  46. package/dist/processors/previewProcessor.d.ts +0 -8
  47. package/dist/processors/previewProcessor.js +0 -11
  48. package/dist/processors/processor.d.ts +0 -10
  49. package/dist/processors/processor.js +0 -39
  50. package/dist/repositories/html5RepoManager.d.ts +0 -12
package/CHANGELOG.md CHANGED
@@ -2,10 +2,19 @@
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.4...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.5-rc.1...HEAD).
6
6
 
7
- <a name="v1.6.4"></a>
8
- ## [v1.6.4] - 2026-04-10
7
+ <a name="v1.6.5-rc.1"></a>
8
+ ## [v1.6.5-rc.1] - 2026-04-13
9
+
10
+ <a name="v1.6.4-rc.3"></a>
11
+ ## [v1.6.4-rc.3] - 2026-04-07
12
+
13
+ <a name="v1.6.4-rc.2"></a>
14
+ ## [v1.6.4-rc.2] - 2026-04-06
15
+
16
+ <a name="v1.6.4-rc.1"></a>
17
+ ## [v1.6.4-rc.1] - 2026-04-06
9
18
 
10
19
  <a name="v1.6.3"></a>
11
20
  ## [v1.6.3] - 2026-03-18
@@ -27,6 +36,24 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
27
36
 
28
37
  <a name="v1.5.4"></a>
29
38
  ## [v1.5.4] - 2026-02-16
39
+ ### Bug Fixes
40
+ - Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
41
+
42
+
43
+ <a name="v1.6.0-rc.4"></a>
44
+ ## [v1.6.0-rc.4] - 2026-02-12
45
+
46
+ <a name="v1.6.0-rc.3"></a>
47
+ ## [v1.6.0-rc.3] - 2026-02-05
48
+
49
+ <a name="v1.6.0-rc.2"></a>
50
+ ## [v1.6.0-rc.2] - 2026-02-05
51
+
52
+ <a name="v1.6.0-rc.1"></a>
53
+ ## [v1.6.0-rc.1] - 2026-02-05
54
+
55
+ <a name="v1.6.0-rc.0"></a>
56
+ ## [v1.6.0-rc.0] - 2026-02-02
30
57
 
31
58
  <a name="v1.5.3"></a>
32
59
  ## [v1.5.3] - 2025-09-29
@@ -37,6 +64,12 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
37
64
  - Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
38
65
 
39
66
 
67
+ <a name="v1.5.2-rc.1"></a>
68
+ ## [v1.5.2-rc.1] - 2025-08-22
69
+
70
+ <a name="v1.5.2-rc.0"></a>
71
+ ## [v1.5.2-rc.0] - 2025-08-19
72
+
40
73
  <a name="v1.5.1"></a>
41
74
  ## [v1.5.1] - 2025-08-06
42
75
 
@@ -152,16 +185,26 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
152
185
  <a name="v1.0.0"></a>
153
186
  ## v1.0.0 - 2020-12-09
154
187
 
155
- [v1.6.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.3...v1.6.4
188
+ [v1.6.5-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.3...v1.6.5-rc.1
189
+ [v1.6.4-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.2...v1.6.4-rc.3
190
+ [v1.6.4-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.1...v1.6.4-rc.2
191
+ [v1.6.4-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.3...v1.6.4-rc.1
156
192
  [v1.6.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.2...v1.6.3
157
193
  [v1.6.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.1...v1.6.2
158
194
  [v1.6.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0...v1.6.1
159
195
  [v1.6.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.2.0...v1.6.0
160
196
  [v0.2.0]: https://github.com/SAP/ui5-task-adaptation/compare/v0.1.0...v0.2.0
161
197
  [v0.1.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.4...v0.1.0
162
- [v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.3...v1.5.4
198
+ [v1.5.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.4...v1.5.4
199
+ [v1.6.0-rc.4]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.3...v1.6.0-rc.4
200
+ [v1.6.0-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.2...v1.6.0-rc.3
201
+ [v1.6.0-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.1...v1.6.0-rc.2
202
+ [v1.6.0-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.0-rc.0...v1.6.0-rc.1
203
+ [v1.6.0-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.3...v1.6.0-rc.0
163
204
  [v1.5.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2...v1.5.3
164
- [v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2
205
+ [v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.1...v1.5.2
206
+ [v1.5.2-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2-rc.0...v1.5.2-rc.1
207
+ [v1.5.2-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2-rc.0
165
208
  [v1.5.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.1
166
209
  [v1.4.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.2...v1.4.3
167
210
  [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 IAnnotationManager from "../annotations/annotationManager.js";
7
6
  export default class AbapAdapter implements IAdapter {
8
- private configuration;
9
7
  private annotationManager;
10
- constructor(configuration: IConfiguration, annotationManager: AnnotationManager);
8
+ constructor(annotationManager: IAnnotationManager);
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(configuration, annotationManager) {
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, this.configuration),
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
- private configuration;
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
- configuration;
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, languages, this.appVariantId, this.prefix);
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
  }
@@ -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 "./annotations/dataSource/dataSourceManager.js";
2
- import I18nManager from "./i18nManager.js";
3
- import ServiceRequestor from "./annotations/serviceRequestor.js";
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 AnnotationManager {
9
- abapRepoManager;
9
+ export default class AbapAnnotationManager {
10
+ repository;
10
11
  configuration;
11
- constructor(configuration, abapRepoManager) {
12
+ constructor(configuration, repository) {
12
13
  this.configuration = configuration;
13
- this.abapRepoManager = abapRepoManager;
14
+ this.repository = repository;
14
15
  }
15
16
  ANNOTATIONS_FOLDER = "annotations";
16
- async process(baseAppManifest, languages, appVariantId, prefix) {
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.abapRepoManager);
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=annotationManager.js.map
74
+ //# sourceMappingURL=abapAnnotationManager.js.map
@@ -0,0 +1,3 @@
1
+ export default interface IAnnotationManager {
2
+ process(baseAppManifest: any, appVariantId: string, prefix: string): Promise<Map<string, string>>;
3
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=annotationManager.js.map
@@ -0,0 +1,4 @@
1
+ import IAnnotationManager from "./annotationManager.js";
2
+ export default class CFAnnotationManager implements IAnnotationManager {
3
+ process(_baseAppManifest: any, _appVariantId: string, _prefix: string): Promise<Map<string, string>>;
4
+ }
@@ -0,0 +1,7 @@
1
+ export default class CFAnnotationManager {
2
+ async process(_baseAppManifest, _appVariantId, _prefix) {
3
+ // No annotation processing needed for cf
4
+ return new Map();
5
+ }
6
+ }
7
+ //# sourceMappingURL=cfAnnotationManager.js.map
@@ -0,0 +1,4 @@
1
+ import IAnnotationManager from "./annotationManager.js";
2
+ export default class LocalAnnotationManager implements IAnnotationManager {
3
+ process(_baseAppManifest: any, _appVariantId: string, _prefix: string): Promise<Map<string, string>>;
4
+ }
@@ -0,0 +1,7 @@
1
+ export default class LocalAnnotationManager {
2
+ async process(_baseAppManifest, _appVariantId, _prefix) {
3
+ // No annotation processing needed for local
4
+ return new Map();
5
+ }
6
+ }
7
+ //# sourceMappingURL=localAnnotationManager.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 abapRepoManager;
5
+ private repository;
6
6
  private configuration;
7
- constructor(configuration: IConfiguration, abapRepoManager: AbapRepoManager);
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
- abapRepoManager;
38
+ repository;
39
39
  configuration;
40
- constructor(configuration, abapRepoManager) {
41
- this.abapRepoManager = abapRepoManager;
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.abapRepoManager.downloadAnnotationFile(uri);
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
  }
@@ -62,21 +62,18 @@ export default class AppVariant {
62
62
  }
63
63
  ;
64
64
  getProcessedManifestChanges() {
65
- // Order: manifest changes first, then *.change files sorted by creation ASC
65
+ // Order: manifest changes first, then *.change files
66
66
  const manifestChanges = structuredClone(this.content) ?? [];
67
- const changeFileChanges = [];
68
67
  this.files.forEach((content, filename) => {
69
68
  if (filename.endsWith(CHANGES_EXT)) {
70
69
  const change = JSON.parse(content);
71
70
  if (isManifestChange(filename, content)) {
72
71
  const { newFilename } = moveFile(filename, content, this.prefix, this.id);
73
72
  this.updateRelativePaths(change, newFilename);
74
- changeFileChanges.push(change);
73
+ manifestChanges.push(change);
75
74
  }
76
75
  }
77
76
  });
78
- changeFileChanges.sort(FilesUtil.sortByTimeStamp);
79
- manifestChanges.push(...changeFileChanges);
80
77
  if (this.layer) {
81
78
  manifestChanges.forEach(change => change.layer = this.layer ?? change.layer);
82
79
  }
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 processor = determineProcessor(options.configuration);
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, processor, options.configuration);
20
- const appVariantIdHierarchy = await processor.getAppVariantIdHierarchy(adaptationProject.reference);
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 }) => processor.fetch(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,66 @@
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
+ import CFAnnotationManager from "./annotations/cfAnnotationManager.js";
11
+ export function initialize(configuration) {
12
+ validateObject(configuration, ["type"], "should be specified in ui5.yaml configuration: 'cf' or 'abap'");
13
+ const repository = getRepository(configuration);
14
+ const annotationManager = getAnnotationManager(configuration, repository);
15
+ return {
16
+ adapter: getAdapter(configuration, annotationManager),
17
+ repository,
18
+ annotationManager
19
+ };
20
+ }
21
+ function getAdapter(configuration, annotationManager) {
22
+ if (isPreview(configuration)) {
23
+ return new PreviewAdapter(configuration);
24
+ }
25
+ switch (configuration.type) {
26
+ case "abap":
27
+ return new AbapAdapter(annotationManager);
28
+ case "cf":
29
+ return new CFAdapter(configuration);
30
+ default:
31
+ throw new Error(`No adapter found for the given configuration type '${configuration.type}'`);
32
+ }
33
+ }
34
+ function getRepository(configuration) {
35
+ if (isLocal(configuration)) {
36
+ return new LocalRepository(configuration);
37
+ }
38
+ switch (configuration.type) {
39
+ case "abap":
40
+ return new AbapRepository(configuration);
41
+ case "cf":
42
+ return new HTML5Repository(configuration);
43
+ default:
44
+ throw new Error(`No repository found for the given configuration type '${configuration.type}'`);
45
+ }
46
+ }
47
+ function getAnnotationManager(configuration, repository) {
48
+ if (isLocal(configuration)) {
49
+ return new LocalAnnotationManager();
50
+ }
51
+ switch (configuration.type) {
52
+ case "abap":
53
+ return new AbapAnnotationManager(configuration, repository);
54
+ case "cf":
55
+ return new CFAnnotationManager();
56
+ default:
57
+ throw new Error(`No annotation manager found for the given configuration type '${configuration.type}'`);
58
+ }
59
+ }
60
+ function isLocal(configuration) {
61
+ return process.env.ADP_BUILDER_MODE === "local" || configuration.mode === "local";
62
+ }
63
+ function isPreview(configuration) {
64
+ return process.env.ADP_BUILDER_MODE === "preview" || configuration.mode === "preview";
65
+ }
66
+ //# 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;
@@ -61,7 +61,6 @@ export interface IChange {
61
61
  layer?: string;
62
62
  content?: IChangeContent;
63
63
  filename: string;
64
- creation: string;
65
64
  }
66
65
  export interface IChangeText {
67
66
  i18n: string;
@@ -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, processor: IProcessor, configuration: IConfiguration): Promise<PreviewManager>;
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>;
@@ -10,7 +10,7 @@ const XS_APP_JSON_FILE = "xs-app.json";
10
10
  export default class PreviewManager {
11
11
  fetchLibsPromises = new Map();
12
12
  configuration;
13
- static async createFromRoot(appId, processor, configuration) {
13
+ static async createFromRoot(appId, repository, configuration) {
14
14
  let ui5AppInfo = "";
15
15
  if (PreviewManager.isPreviewRequested()) {
16
16
  try {
@@ -23,12 +23,12 @@ export default class PreviewManager {
23
23
  else {
24
24
  log.verbose("Preview mode not requested (env variable ADP_BUILDER_MODE=preview is not set), skipping preview resources processing.");
25
25
  }
26
- return new PreviewManager(appId, ui5AppInfo, processor, configuration);
26
+ return new PreviewManager(appId, ui5AppInfo, repository, configuration);
27
27
  }
28
28
  static isPreviewRequested() {
29
29
  return process.env.ADP_BUILDER_MODE === "preview";
30
30
  }
31
- constructor(appId, ui5AppInfo, processor, configuration) {
31
+ constructor(appId, ui5AppInfo, repository, configuration) {
32
32
  this.configuration = configuration;
33
33
  // If no ui5AppInfo is provided, no preview processing is needed
34
34
  if (!ui5AppInfo) {
@@ -41,7 +41,7 @@ export default class PreviewManager {
41
41
  }
42
42
  const reuseLibs = appInfo.asyncHints.libs.filter(lib => lib.html5AppHostId && lib.html5AppName && lib.html5AppVersion);
43
43
  if (reuseLibs.length > 0) {
44
- this.fetchLibsPromises = this.preReadLibs(reuseLibs, processor);
44
+ this.fetchLibsPromises = this.preReadLibs(reuseLibs, repository);
45
45
  }
46
46
  const logMap = {
47
47
  Error: log.error,
@@ -89,13 +89,13 @@ export default class PreviewManager {
89
89
  }
90
90
  await ResourceUtil.writeInProject(REUSE_DIR, mergedFiles);
91
91
  }
92
- preReadLibs(reuseLibs, processor) {
92
+ preReadLibs(reuseLibs, repository) {
93
93
  const promises = new Map();
94
94
  reuseLibs.forEach(lib => {
95
95
  log.info(`Downloading reuse library '${lib.html5AppName}' version '${lib.html5AppVersion}'`);
96
- const promise = processor
96
+ const promise = repository
97
97
  .fetchReuseLib(lib.html5AppName, lib.html5CacheBusterToken, lib)
98
- .then(libFiles => PreviewManager.moveLibraryFiles(libFiles, lib.html5AppName, lib.name));
98
+ .then((libFiles) => PreviewManager.moveLibraryFiles(libFiles, lib.html5AppName, lib.name));
99
99
  promises.set(lib.html5AppName, promise);
100
100
  });
101
101
  return promises;
@@ -1,13 +1,15 @@
1
- import { IConfiguration, IMetadata } from "../model/types.js";
1
+ import { IConfiguration, IMetadata, IReuseLibInfo } from "../model/types.js";
2
2
  import AbapProvider from "./abapProvider.js";
3
3
  import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
4
- export default class AbapRepoManager {
4
+ import IRepository from "./repository.js";
5
+ export default class AbapRepository implements IRepository {
5
6
  private configuration;
6
7
  private abapProvider;
7
8
  constructor(configuration: IConfiguration, abapProvider?: AbapProvider);
9
+ fetchReuseLib(_libName: string, _cachebusterToken: string, _lib: IReuseLibInfo): Promise<Map<string, string>>;
8
10
  getAppVariantIdHierarchy(id: string): Promise<IAppVariantIdHierarchyItem[]>;
9
11
  getAnnotationMetadata(uri: string): Promise<IMetadata>;
10
12
  downloadAnnotationFile(uri: string): Promise<Map<string, any>>;
11
13
  getMetadata(id: string): Promise<IMetadata>;
12
- fetch(repoName: string): Promise<Map<string, string>>;
14
+ fetch(repoName: string, _cachebusterToken: string): Promise<Map<string, string>>;
13
15
  }
@@ -1,7 +1,14 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
1
7
  import AbapProvider from "./abapProvider.js";
2
8
  import { getLogger } from "@ui5/logger";
3
9
  import { unzipZipEntries } from "../util/zipUtil.js";
4
- const log = getLogger("@ui5/task-adaptation::AbapRepoManager");
10
+ import { cached } from "../cache/cacheHolder.js";
11
+ const log = getLogger("@ui5/task-adaptation::AbapRepository");
5
12
  const REQUEST_OPTIONS_XML = {
6
13
  responseType: "text",
7
14
  headers: {
@@ -13,13 +20,16 @@ const REQUEST_OPTIONS_JSON = {
13
20
  "Accept": "application/json"
14
21
  }
15
22
  };
16
- export default class AbapRepoManager {
23
+ export default class AbapRepository {
17
24
  configuration;
18
25
  abapProvider;
19
26
  constructor(configuration, abapProvider) {
20
27
  this.configuration = configuration;
21
28
  this.abapProvider = abapProvider ? abapProvider : new AbapProvider();
22
29
  }
30
+ fetchReuseLib(_libName, _cachebusterToken, _lib) {
31
+ throw new Error("Preview is not available on SAP S/4HANA On-Premise or Cloud Systems. Please create a ticket on CA-UI5-FL-ADP-BAS component.");
32
+ }
23
33
  async getAppVariantIdHierarchy(id) {
24
34
  const provider = await this.abapProvider.get(this.configuration);
25
35
  const lrep = provider.getLayeredRepository();
@@ -68,7 +78,7 @@ export default class AbapRepoManager {
68
78
  id
69
79
  };
70
80
  }
71
- async fetch(repoName) {
81
+ async fetch(repoName, _cachebusterToken) {
72
82
  const encodedRepoName = encodeURIComponent(repoName);
73
83
  const provider = await this.abapProvider.get(this.configuration);
74
84
  const ui5Repo = provider.getUi5AbapRepository();
@@ -87,4 +97,7 @@ export default class AbapRepoManager {
87
97
  throw new Error(`App '${repoName}' doesn't contain files`);
88
98
  }
89
99
  }
90
- //# sourceMappingURL=abapRepoManager.js.map
100
+ __decorate([
101
+ cached()
102
+ ], AbapRepository.prototype, "fetch", null);
103
+ //# sourceMappingURL=abapRepository.js.map
@@ -0,0 +1,18 @@
1
+ import { IConfiguration, IReuseLibInfo } from "./../model/types.js";
2
+ import IRepository from "./repository.js";
3
+ import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
4
+ export default class HTML5Repository implements IRepository {
5
+ private configuration;
6
+ constructor(configuration: IConfiguration);
7
+ getAppVariantIdHierarchy(appId: string): Promise<IAppVariantIdHierarchyItem[]>;
8
+ fetch(_repoName: string, _cachebusterToken: string): Promise<Map<string, string>>;
9
+ fetchReuseLib(_libName: string, _cachebusterToken: string, lib: IReuseLibInfo): Promise<Map<string, string>>;
10
+ getMetadata(): Promise<any>;
11
+ private getHtml5RepoInfo;
12
+ private getHTML5Credentials;
13
+ private getToken;
14
+ private requestMetadata;
15
+ private getAppZipEntries;
16
+ private download;
17
+ downloadAnnotationFile(_uri: string): Promise<Map<string, string>>;
18
+ }