@ui5/task-adaptation 1.6.5-rc.2 → 1.6.5-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/REUSE.toml +1 -1
- package/dist/cache/cacheHolder.js +8 -7
- package/dist/cache/cachedResource.d.ts +4 -0
- package/dist/cache/cachedResource.js +2 -0
- package/dist/index.js +1 -1
- package/dist/landscapeConfiguration.js +8 -8
- package/dist/model/configuration.d.ts +0 -4
- package/dist/model/configuration.js +0 -1
- package/dist/previewManager.js +7 -1
- package/dist/repositories/abapRepository.d.ts +6 -5
- package/dist/repositories/abapRepository.js +10 -11
- package/dist/repositories/html5Repository.d.ts +8 -5
- package/dist/repositories/html5Repository.js +18 -30
- package/dist/repositories/localRepository.d.ts +6 -9
- package/dist/repositories/localRepository.js +12 -22
- package/dist/repositories/repository.d.ts +3 -5
- package/package.json +5 -4
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-rc.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.6.5-rc.3...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v1.6.5-rc.3"></a>
|
|
8
|
+
## [v1.6.5-rc.3] - 2026-04-27
|
|
9
|
+
### Reverts
|
|
10
|
+
- Release 1.6.5-rc.0
|
|
11
|
+
|
|
6
12
|
|
|
7
13
|
<a name="v1.6.5-rc.2"></a>
|
|
8
14
|
## [v1.6.5-rc.2] - 2026-04-14
|
|
@@ -188,6 +194,7 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
188
194
|
<a name="v1.0.0"></a>
|
|
189
195
|
## v1.0.0 - 2020-12-09
|
|
190
196
|
|
|
197
|
+
[v1.6.5-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.5-rc.2...v1.6.5-rc.3
|
|
191
198
|
[v1.6.5-rc.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.5-rc.1...v1.6.5-rc.2
|
|
192
199
|
[v1.6.5-rc.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.3...v1.6.5-rc.1
|
|
193
200
|
[v1.6.4-rc.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.6.4-rc.2...v1.6.4-rc.3
|
package/REUSE.toml
CHANGED
|
@@ -7,4 +7,4 @@ SPDX-PackageDownloadLocation = "https://github.com/SAP/ui5-task-adaptation"
|
|
|
7
7
|
path = "**.**"
|
|
8
8
|
precedence = "aggregate"
|
|
9
9
|
SPDX-FileCopyrightText = "2009-2025 SAP SE or an SAP affiliate company"
|
|
10
|
-
SPDX-License-Identifier = "Apache-2.0"
|
|
10
|
+
SPDX-License-Identifier = "Apache-2.0"
|
|
@@ -68,17 +68,18 @@ export function cached() {
|
|
|
68
68
|
return function (_target, _propertyKey, descriptor) {
|
|
69
69
|
const originalValue = descriptor.value;
|
|
70
70
|
descriptor.value = async function (...args) {
|
|
71
|
-
const
|
|
72
|
-
const cachebusterToken =
|
|
73
|
-
|
|
74
|
-
CacheHolder.
|
|
71
|
+
const cachedResource = args[0];
|
|
72
|
+
const { appName, cacheBusterToken: cachebusterToken } = cachedResource;
|
|
73
|
+
const token = await cachebusterToken;
|
|
74
|
+
let files = await CacheHolder.read(appName, token);
|
|
75
|
+
CacheHolder.clearOutdatedExcept(appName);
|
|
75
76
|
if (files.size === 0) {
|
|
76
|
-
log.verbose(`No cache for repo '${
|
|
77
|
+
log.verbose(`No cache for repo '${appName}' with token '${token}'. Fetching from HTML5 Repository.`);
|
|
77
78
|
files = await originalValue.apply(this, args);
|
|
78
|
-
await CacheHolder.write(
|
|
79
|
+
await CacheHolder.write(appName, token, files);
|
|
79
80
|
}
|
|
80
81
|
else {
|
|
81
|
-
log.verbose(`Using cached files for repo '${
|
|
82
|
+
log.verbose(`Using cached files for repo '${appName}' with token '${token}'.`);
|
|
82
83
|
}
|
|
83
84
|
return files;
|
|
84
85
|
};
|
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export default ({ workspace, options, taskUtil }) => {
|
|
|
24
24
|
// latest app variant on top. We reverse the list to process original
|
|
25
25
|
// application first and then app variants in chronological order.
|
|
26
26
|
const reversedHierarchy = appVariantIdHierarchy.toReversed();
|
|
27
|
-
const fetchFilesPromises = reversedHierarchy.map(
|
|
27
|
+
const fetchFilesPromises = reversedHierarchy.map(variant => repository.fetch(variant));
|
|
28
28
|
fetchFilesPromises.push(Promise.resolve(adaptationProject.files));
|
|
29
29
|
const appVariants = new Array();
|
|
30
30
|
const adapt = async (baseAppFiles, appVariantFiles) => {
|
|
@@ -47,7 +47,7 @@ function getTypeByConfiguration(configuration) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
function getAdapter(configuration, annotationManager) {
|
|
50
|
-
if (isPreview(
|
|
50
|
+
if (isPreview()) {
|
|
51
51
|
return new PreviewAdapter(configuration);
|
|
52
52
|
}
|
|
53
53
|
switch (configuration.type) {
|
|
@@ -60,8 +60,8 @@ function getAdapter(configuration, annotationManager) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
function getRepository(configuration) {
|
|
63
|
-
if (isLocal(
|
|
64
|
-
return new LocalRepository(
|
|
63
|
+
if (isLocal()) {
|
|
64
|
+
return new LocalRepository();
|
|
65
65
|
}
|
|
66
66
|
switch (configuration.type) {
|
|
67
67
|
case "abap":
|
|
@@ -73,7 +73,7 @@ function getRepository(configuration) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function getAnnotationManager(configuration, repository) {
|
|
76
|
-
if (isLocal(
|
|
76
|
+
if (isLocal()) {
|
|
77
77
|
return new LocalAnnotationManager();
|
|
78
78
|
}
|
|
79
79
|
switch (configuration.type) {
|
|
@@ -85,10 +85,10 @@ function getAnnotationManager(configuration, repository) {
|
|
|
85
85
|
throw new Error(`No annotation manager found for the given configuration type '${configuration.type}'`);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
function isLocal(
|
|
89
|
-
return process.env.ADP_BUILDER_MODE === "local"
|
|
88
|
+
function isLocal() {
|
|
89
|
+
return process.env.ADP_BUILDER_MODE === "local";
|
|
90
90
|
}
|
|
91
|
-
function isPreview(
|
|
92
|
-
return process.env.ADP_BUILDER_MODE === "preview"
|
|
91
|
+
function isPreview() {
|
|
92
|
+
return process.env.ADP_BUILDER_MODE === "preview";
|
|
93
93
|
}
|
|
94
94
|
//# sourceMappingURL=landscapeConfiguration.js.map
|
|
@@ -9,19 +9,15 @@ export interface IConfiguration {
|
|
|
9
9
|
sapCloudService?: string;
|
|
10
10
|
destination?: string;
|
|
11
11
|
type?: LandscapeType;
|
|
12
|
-
mode?: LandscapeMode;
|
|
13
12
|
languages?: any[] | undefined;
|
|
14
13
|
enableAnnotationCache?: boolean;
|
|
15
14
|
enableBetaFeatures?: boolean;
|
|
16
15
|
writeTempFiles?: any;
|
|
17
16
|
target?: AbapTarget & IAbapTargetMeta;
|
|
18
17
|
serviceInstanceName?: string;
|
|
19
|
-
adpDir?: string;
|
|
20
18
|
}
|
|
21
19
|
export declare const LANDSCAPE_TYPES: readonly ["cf", "abap"];
|
|
22
20
|
export type LandscapeType = typeof LANDSCAPE_TYPES[number];
|
|
23
|
-
export declare const LANDSCAPE_MODES: readonly ["preview", "local", "default"];
|
|
24
|
-
export type LandscapeMode = typeof LANDSCAPE_MODES[number];
|
|
25
21
|
export interface IAbapTargetMeta {
|
|
26
22
|
name?: string;
|
|
27
23
|
ignoreCertErrors?: boolean;
|
package/dist/previewManager.js
CHANGED
|
@@ -93,8 +93,14 @@ export default class PreviewManager {
|
|
|
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 resource = {
|
|
97
|
+
appName: lib.html5AppName,
|
|
98
|
+
appVersion: lib.html5AppVersion,
|
|
99
|
+
appHostId: lib.html5AppHostId,
|
|
100
|
+
cacheBusterToken: Promise.resolve(lib.html5CacheBusterToken)
|
|
101
|
+
};
|
|
96
102
|
const promise = repository
|
|
97
|
-
.
|
|
103
|
+
.fetch(resource)
|
|
98
104
|
.then((libFiles) => PreviewManager.moveLibraryFiles(libFiles, lib.html5AppName, lib.name));
|
|
99
105
|
promises.set(lib.html5AppName, promise);
|
|
100
106
|
});
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { IConfiguration, IMetadata
|
|
1
|
+
import { IConfiguration, IMetadata } from "../model/types.js";
|
|
2
2
|
import AbapProvider from "./abapProvider.js";
|
|
3
|
-
import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
|
|
4
3
|
import IRepository from "./repository.js";
|
|
4
|
+
import ICachedResource from "../cache/cachedResource.js";
|
|
5
|
+
type IAbapResource = ICachedResource;
|
|
5
6
|
export default class AbapRepository implements IRepository {
|
|
6
7
|
private configuration;
|
|
7
8
|
private abapProvider;
|
|
8
9
|
constructor(configuration: IConfiguration, abapProvider?: AbapProvider);
|
|
9
|
-
|
|
10
|
-
getAppVariantIdHierarchy(id: string): Promise<IAppVariantIdHierarchyItem[]>;
|
|
10
|
+
getAppVariantIdHierarchy(id: string): Promise<IAbapResource[]>;
|
|
11
11
|
getAnnotationMetadata(uri: string): Promise<IMetadata>;
|
|
12
12
|
downloadAnnotationFile(uri: string): Promise<Map<string, any>>;
|
|
13
13
|
getMetadata(id: string): Promise<IMetadata>;
|
|
14
|
-
fetch(
|
|
14
|
+
fetch(resource: IAbapResource): Promise<Map<string, string>>;
|
|
15
15
|
}
|
|
16
|
+
export {};
|
|
@@ -27,9 +27,6 @@ export default class AbapRepository {
|
|
|
27
27
|
this.configuration = configuration;
|
|
28
28
|
this.abapProvider = abapProvider ? abapProvider : new AbapProvider();
|
|
29
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
|
-
}
|
|
33
30
|
async getAppVariantIdHierarchy(id) {
|
|
34
31
|
const provider = await this.abapProvider.get(this.configuration);
|
|
35
32
|
const lrep = provider.getLayeredRepository();
|
|
@@ -37,15 +34,17 @@ export default class AbapRepository {
|
|
|
37
34
|
params: { id }
|
|
38
35
|
});
|
|
39
36
|
if (response.status === 200) {
|
|
40
|
-
|
|
37
|
+
const hierarchy = JSON.parse(response.data)?.appVariantIdHierarchy;
|
|
38
|
+
return hierarchy.map(item => ({
|
|
39
|
+
appName: item.repoName,
|
|
40
|
+
cacheBusterToken: Promise.resolve(item.cachebusterToken)
|
|
41
|
+
}));
|
|
41
42
|
}
|
|
42
43
|
else if (this.configuration.appName) {
|
|
43
44
|
// Fallback to old API on old ABAP backend or CF for backward compatibility
|
|
44
|
-
const metadataResponse = await this.getMetadata(id);
|
|
45
45
|
return [{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
cachebusterToken: metadataResponse.changedOn
|
|
46
|
+
appName: this.configuration.appName,
|
|
47
|
+
cacheBusterToken: this.getMetadata(id).then(metadata => metadata.changedOn),
|
|
49
48
|
}];
|
|
50
49
|
}
|
|
51
50
|
throw new Error(`App variant id hierarchy for app id '${id}' is not provided`);
|
|
@@ -78,8 +77,8 @@ export default class AbapRepository {
|
|
|
78
77
|
id
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
|
-
async fetch(
|
|
82
|
-
const encodedRepoName = encodeURIComponent(
|
|
80
|
+
async fetch(resource) {
|
|
81
|
+
const encodedRepoName = encodeURIComponent(resource.appName);
|
|
83
82
|
const provider = await this.abapProvider.get(this.configuration);
|
|
84
83
|
const ui5Repo = provider.getUi5AbapRepository();
|
|
85
84
|
const response = await ui5Repo.get(`/Repositories('${encodedRepoName}')`, {
|
|
@@ -94,7 +93,7 @@ export default class AbapRepository {
|
|
|
94
93
|
const buffer = Buffer.from(data.d.ZipArchive, "base64");
|
|
95
94
|
return unzipZipEntries(buffer);
|
|
96
95
|
}
|
|
97
|
-
throw new Error(`App '${
|
|
96
|
+
throw new Error(`App '${resource.appName}' doesn't contain files`);
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
__decorate([
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { IConfiguration
|
|
1
|
+
import { IConfiguration } from "./../model/types.js";
|
|
2
2
|
import IRepository from "./repository.js";
|
|
3
|
-
import
|
|
3
|
+
import ICachedResource from "../cache/cachedResource.js";
|
|
4
|
+
export interface IHtml5Resource extends ICachedResource {
|
|
5
|
+
appVersion: string;
|
|
6
|
+
appHostId: string;
|
|
7
|
+
}
|
|
4
8
|
export default class HTML5Repository implements IRepository {
|
|
5
9
|
private configuration;
|
|
6
10
|
private validator;
|
|
7
11
|
constructor(configuration: IConfiguration);
|
|
8
|
-
getAppVariantIdHierarchy(
|
|
9
|
-
fetch(
|
|
10
|
-
fetchReuseLib(_libName: string, _cachebusterToken: string, lib: IReuseLibInfo): Promise<Map<string, string>>;
|
|
12
|
+
getAppVariantIdHierarchy(_appId: string): Promise<IHtml5Resource[]>;
|
|
13
|
+
fetch(resource: IHtml5Resource): Promise<Map<string, string>>;
|
|
11
14
|
getMetadata(): Promise<any>;
|
|
12
15
|
private getHtml5RepoInfo;
|
|
13
16
|
private getHTML5Credentials;
|
|
@@ -18,31 +18,21 @@ export default class HTML5Repository {
|
|
|
18
18
|
this.configuration = configuration;
|
|
19
19
|
this.validator.validateConfiguration(configuration);
|
|
20
20
|
}
|
|
21
|
-
async getAppVariantIdHierarchy(
|
|
22
|
-
const
|
|
21
|
+
async getAppVariantIdHierarchy(_appId) {
|
|
22
|
+
const { appName, appVersion, appHostId } = this.configuration;
|
|
23
|
+
if (!appName || !appVersion || !appHostId) {
|
|
24
|
+
throw new Error("Missing required configuration properties appName, appVersion or appHostId");
|
|
25
|
+
}
|
|
23
26
|
return [{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
appName,
|
|
28
|
+
cacheBusterToken: this.getMetadata().then(metadata => metadata.changedOn),
|
|
29
|
+
appVersion,
|
|
30
|
+
appHostId,
|
|
27
31
|
}];
|
|
28
32
|
}
|
|
29
|
-
async fetch(
|
|
33
|
+
async fetch(resource) {
|
|
30
34
|
const { token, baseUri } = await this.getHtml5RepoInfo();
|
|
31
|
-
|
|
32
|
-
appName: this.configuration.appName,
|
|
33
|
-
appVersion: this.configuration.appVersion,
|
|
34
|
-
appHostId: this.configuration.appHostId
|
|
35
|
-
};
|
|
36
|
-
return this.getAppZipEntries(appData, baseUri, token);
|
|
37
|
-
}
|
|
38
|
-
async fetchReuseLib(_libName, _cachebusterToken, lib) {
|
|
39
|
-
const { token, baseUri } = await this.getHtml5RepoInfo();
|
|
40
|
-
const libAppData = {
|
|
41
|
-
appName: lib.html5AppName,
|
|
42
|
-
appVersion: lib.html5AppVersion,
|
|
43
|
-
appHostId: lib.html5AppHostId
|
|
44
|
-
};
|
|
45
|
-
return this.getAppZipEntries(libAppData, baseUri, token);
|
|
35
|
+
return this.getAppZipEntries(resource, baseUri, token);
|
|
46
36
|
}
|
|
47
37
|
async getMetadata() {
|
|
48
38
|
const { token, baseUri } = await this.getHtml5RepoInfo();
|
|
@@ -66,17 +56,17 @@ export default class HTML5Repository {
|
|
|
66
56
|
async getHTML5Credentials(spaceGuid) {
|
|
67
57
|
log.verbose("Getting HTML5 Repo Runtime credentials from space " + spaceGuid);
|
|
68
58
|
const PLAN_NAME = "app-runtime";
|
|
69
|
-
const
|
|
59
|
+
const SERVICE_INSTANCE_NAME = "html5-apps-repo-runtime";
|
|
70
60
|
const getParams = {
|
|
71
61
|
spaceGuids: [spaceGuid],
|
|
72
62
|
planNames: [PLAN_NAME],
|
|
73
|
-
names: [
|
|
63
|
+
names: [SERVICE_INSTANCE_NAME]
|
|
74
64
|
};
|
|
75
65
|
const createParams = {
|
|
76
66
|
spaceGuid,
|
|
77
67
|
planName: PLAN_NAME,
|
|
78
68
|
serviceName: "html5-apps-repo",
|
|
79
|
-
serviceInstanceName:
|
|
69
|
+
serviceInstanceName: SERVICE_INSTANCE_NAME,
|
|
80
70
|
tags: ["html5-apps-repo-rt"]
|
|
81
71
|
};
|
|
82
72
|
const serviceKeys = await CFUtil.getServiceInstanceKeys(getParams, createParams);
|
|
@@ -107,9 +97,10 @@ export default class HTML5Repository {
|
|
|
107
97
|
const metadata = await RequestUtil.get(uri, requestOptions);
|
|
108
98
|
return metadata.find((item) => item.appHostId === appHostId && item.applicationName === appName && item.applicationVersion === appVersion);
|
|
109
99
|
}
|
|
110
|
-
async getAppZipEntries(
|
|
111
|
-
const
|
|
112
|
-
const
|
|
100
|
+
async getAppZipEntries(resource, html5RepoBaseUri, token) {
|
|
101
|
+
const { appName, appVersion, appHostId } = resource;
|
|
102
|
+
const uri = `${html5RepoBaseUri}/applications/content/${appName}-${appVersion}/`;
|
|
103
|
+
const zip = await this.download(token, appHostId, uri);
|
|
113
104
|
return unzipZipEntries(zip);
|
|
114
105
|
}
|
|
115
106
|
async download(token, appHostId, uri) {
|
|
@@ -133,7 +124,4 @@ export default class HTML5Repository {
|
|
|
133
124
|
__decorate([
|
|
134
125
|
cached()
|
|
135
126
|
], HTML5Repository.prototype, "fetch", null);
|
|
136
|
-
__decorate([
|
|
137
|
-
cached()
|
|
138
|
-
], HTML5Repository.prototype, "fetchReuseLib", null);
|
|
139
127
|
//# sourceMappingURL=html5Repository.js.map
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { IAppVariantIdHierarchyItem } from "../model/appVariantIdHierarchyItem.js";
|
|
2
|
-
import { IConfiguration } from "../model/configuration.js";
|
|
3
|
-
import { IReuseLibInfo } from "../model/types.js";
|
|
4
1
|
import IRepository from "./repository.js";
|
|
2
|
+
import ICachedResource from "../cache/cachedResource.js";
|
|
3
|
+
export interface ILocalResource extends ICachedResource {
|
|
4
|
+
absolutePath: string;
|
|
5
|
+
}
|
|
5
6
|
export default class LocalRepository implements IRepository {
|
|
6
|
-
private configuration;
|
|
7
|
-
constructor(configuration: IConfiguration);
|
|
8
7
|
downloadAnnotationFile(_uri: string): Promise<Map<string, string>>;
|
|
9
|
-
getAppVariantIdHierarchy(appId: string): Promise<
|
|
10
|
-
fetch(
|
|
11
|
-
fetchReuseLib(libName: string, cachebusterToken: string, _lib: IReuseLibInfo): Promise<Map<string, string>>;
|
|
8
|
+
getAppVariantIdHierarchy(appId: string): Promise<ILocalResource[]>;
|
|
9
|
+
fetch(resource: ILocalResource): Promise<Map<string, string>>;
|
|
12
10
|
private collectAppVariantIdHierarchyItems;
|
|
13
11
|
private getExistingManifestPath;
|
|
14
|
-
private readFilesInBaseAppDir;
|
|
15
12
|
private getLocalFilesDirectory;
|
|
16
13
|
}
|
|
@@ -4,10 +4,6 @@ import fs from "node:fs/promises";
|
|
|
4
4
|
import FsUtil from "../util/fsUtil.js";
|
|
5
5
|
const log = getLogger("@ui5/task-adaptation::LocalRepository");
|
|
6
6
|
export default class LocalRepository {
|
|
7
|
-
configuration;
|
|
8
|
-
constructor(configuration) {
|
|
9
|
-
this.configuration = configuration;
|
|
10
|
-
}
|
|
11
7
|
async downloadAnnotationFile(_uri) {
|
|
12
8
|
log.verbose("Downloading annotation files is not supported in LocalRepository.");
|
|
13
9
|
return new Map();
|
|
@@ -17,26 +13,24 @@ export default class LocalRepository {
|
|
|
17
13
|
await this.collectAppVariantIdHierarchyItems(appId, items);
|
|
18
14
|
return items;
|
|
19
15
|
}
|
|
20
|
-
fetch(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fetchReuseLib(libName, cachebusterToken, _lib) {
|
|
24
|
-
return this.readFilesInBaseAppDir(libName, cachebusterToken);
|
|
16
|
+
fetch(resource) {
|
|
17
|
+
log.verbose(`Fetching base app files from local directory: ${resource.absolutePath}`);
|
|
18
|
+
return FsUtil.readFilesRecursively(resource.absolutePath);
|
|
25
19
|
}
|
|
26
20
|
async collectAppVariantIdHierarchyItems(appId, items) {
|
|
27
21
|
const appDir = this.getLocalFilesDirectory(appId);
|
|
28
22
|
const filenames = [
|
|
29
|
-
["manifest.json"],
|
|
30
|
-
["manifest.appdescr_variant"],
|
|
31
|
-
["
|
|
32
|
-
["
|
|
23
|
+
{ path: ["webapp", "manifest.json"], suffix: "" },
|
|
24
|
+
{ path: ["webapp", "manifest.appdescr_variant"], suffix: "" },
|
|
25
|
+
{ path: ["manifest.json"], suffix: "-opt-static-abap" },
|
|
26
|
+
{ path: ["manifest.appdescr_variant"], suffix: "-opt-static-abap" },
|
|
33
27
|
];
|
|
34
|
-
const filepaths = filenames.map((filename) => path.join(appDir, ...filename));
|
|
28
|
+
const filepaths = filenames.map((filename) => path.join(appDir + filename.suffix, ...filename.path));
|
|
35
29
|
const existingManifestPath = await this.getExistingManifestPath(filepaths);
|
|
36
30
|
items.push({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
appName: appId,
|
|
32
|
+
cacheBusterToken: Promise.resolve("local"),
|
|
33
|
+
absolutePath: path.dirname(existingManifestPath),
|
|
40
34
|
});
|
|
41
35
|
if (existingManifestPath.endsWith("manifest.appdescr_variant")) {
|
|
42
36
|
const manifestContent = await fs.readFile(existingManifestPath, "utf-8");
|
|
@@ -52,12 +46,8 @@ export default class LocalRepository {
|
|
|
52
46
|
}
|
|
53
47
|
throw new Error(`None of the paths exist: '${filePaths.join("', '")}'.`);
|
|
54
48
|
}
|
|
55
|
-
readFilesInBaseAppDir(_appId, cachebusterToken) {
|
|
56
|
-
log.verbose(`Fetching base app files from local directory: ${cachebusterToken}`);
|
|
57
|
-
return FsUtil.readFilesRecursively(cachebusterToken);
|
|
58
|
-
}
|
|
59
49
|
getLocalFilesDirectory(appId) {
|
|
60
|
-
const adpDirConfigured = process.env.ADP_BUILDER_DIR
|
|
50
|
+
const adpDirConfigured = process.env.ADP_BUILDER_DIR;
|
|
61
51
|
const adpDir = adpDirConfigured
|
|
62
52
|
? path.normalize(adpDirConfigured).replace(/\\/g, "/").replace(/\/+$/, "").split("/")
|
|
63
53
|
: [".."];
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IReuseLibInfo } from "../model/types.js";
|
|
1
|
+
import ICachedResource from "../cache/cachedResource.js";
|
|
3
2
|
export default interface IRepository {
|
|
4
|
-
getAppVariantIdHierarchy(appId: string): Promise<
|
|
5
|
-
fetch(
|
|
6
|
-
fetchReuseLib(libName: string, cachebusterToken: string, lib: IReuseLibInfo): Promise<Map<string, string>>;
|
|
3
|
+
getAppVariantIdHierarchy(appId: string): Promise<ICachedResource[]>;
|
|
4
|
+
fetch(resource: ICachedResource): Promise<Map<string, string>>;
|
|
7
5
|
downloadAnnotationFile(uri: string): Promise<Map<string, string>>;
|
|
8
6
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/task-adaptation",
|
|
3
|
-
"version": "1.6.5-rc.
|
|
3
|
+
"version": "1.6.5-rc.3",
|
|
4
4
|
"description": "Custom task for ui5-builder which allows building UI5 Flexibility Adaptation Projects for SAP BTP, Cloud Foundry environment",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@sap-ux/axios-extension": "^1.22.9",
|
|
37
37
|
"@sap-ux/btp-utils": "^1.1.3",
|
|
38
|
-
"@sap-ux/store": "^1.
|
|
39
|
-
"@sap-ux/system-access": "^0.
|
|
38
|
+
"@sap-ux/store": "^1.5.13",
|
|
39
|
+
"@sap-ux/system-access": "^0.7.5",
|
|
40
40
|
"@sap/cf-tools": "^3.2.2",
|
|
41
41
|
"@ui5/fs": "^4.0.1",
|
|
42
42
|
"@ui5/logger": "^4.0.1",
|
|
@@ -112,7 +112,8 @@
|
|
|
112
112
|
"src/adapters/adapter.ts",
|
|
113
113
|
"src/adapters/previewAdapter.ts",
|
|
114
114
|
"src/repositories/repository.ts",
|
|
115
|
-
"src/annotations/annotationManager.ts"
|
|
115
|
+
"src/annotations/annotationManager.ts",
|
|
116
|
+
"src/cache/cachedResource.ts"
|
|
116
117
|
],
|
|
117
118
|
"check-coverage": true,
|
|
118
119
|
"statements": 85,
|