@ui5/task-adaptation 1.5.2-rc.1 → 1.5.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 +6 -7
- package/dist/baseAppManager.js +3 -0
- package/dist/index.js +1 -2
- package/dist/processors/cfProcessor.js +2 -2
- package/dist/util/cfUtil.js +1 -1
- package/package.json +1 -1
- package/scripts/publish.ts +0 -256
- package/scripts/test-integration-prep.sh +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,13 +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.5.2
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task-adaptation/compare/v1.5.2...HEAD).
|
|
6
6
|
|
|
7
|
-
<a name="v1.5.2
|
|
8
|
-
## [v1.5.2
|
|
7
|
+
<a name="v1.5.2"></a>
|
|
8
|
+
## [v1.5.2] - 2025-08-25
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- Removed moved changes [`babdc1b`](https://github.com/SAP/ui5-task-adaptation/commit/babdc1bce8e407b2638e014cfaa4e6547bba10ac)
|
|
9
11
|
|
|
10
|
-
<a name="v1.5.2-rc.0"></a>
|
|
11
|
-
## [v1.5.2-rc.0] - 2025-08-19
|
|
12
12
|
|
|
13
13
|
<a name="v1.5.1"></a>
|
|
14
14
|
## [v1.5.1] - 2025-08-06
|
|
@@ -125,8 +125,7 @@ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-task
|
|
|
125
125
|
<a name="v1.0.0"></a>
|
|
126
126
|
## v1.0.0 - 2020-12-09
|
|
127
127
|
|
|
128
|
-
[v1.5.2
|
|
129
|
-
[v1.5.2-rc.0]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2-rc.0
|
|
128
|
+
[v1.5.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.5.1...v1.5.2
|
|
130
129
|
[v1.5.1]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.3...v1.5.1
|
|
131
130
|
[v1.4.3]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.2...v1.4.3
|
|
132
131
|
[v1.4.2]: https://github.com/SAP/ui5-task-adaptation/compare/v1.4.0...v1.4.2
|
package/dist/baseAppManager.js
CHANGED
|
@@ -104,6 +104,9 @@ export default class BaseApp {
|
|
|
104
104
|
}
|
|
105
105
|
VALIDATION_RULES = new Map([["sap.app/id", (value) => {
|
|
106
106
|
if (!value.includes(".")) {
|
|
107
|
+
// https://help.sap.com/docs/bas/developing-sap-fiori-app-in-sap-business-application-studio/releasing-sap-fiori-application-to-be-extensible-in-adaptation-projects-on-sap-s-4hana-cloud
|
|
108
|
+
// In the manifest.json file, make sure that the attribute
|
|
109
|
+
// sap.app/id has at least 2 segments.
|
|
107
110
|
throw new Error(`The original application id '${value}' should consist of multiple segments split by dot, e.g.: original.id`);
|
|
108
111
|
}
|
|
109
112
|
}]]);
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as dotenv from "dotenv";
|
|
2
|
-
import {
|
|
2
|
+
import { logBuilderVersion } from "./util/commonUtil.js";
|
|
3
3
|
import AppVariant from "./appVariantManager.js";
|
|
4
4
|
import BaseApp from "./baseAppManager.js";
|
|
5
5
|
import I18nMerger from "./util/i18nMerger.js";
|
|
@@ -13,7 +13,6 @@ export default ({ workspace, options, taskUtil }) => {
|
|
|
13
13
|
dotenv.config();
|
|
14
14
|
async function process(workspace, taskUtil) {
|
|
15
15
|
logBuilderVersion();
|
|
16
|
-
logBetaUsage();
|
|
17
16
|
const processor = determineProcessor(options.configuration);
|
|
18
17
|
const adaptationProject = await AppVariant.fromWorkspace(workspace, options.projectNamespace);
|
|
19
18
|
const appVariantIdHierarchy = await processor.getAppVariantIdHierarchy(adaptationProject.reference);
|
|
@@ -41,7 +41,7 @@ export default class CFProcessor {
|
|
|
41
41
|
// Also skip if no routes or no routes with a destination property
|
|
42
42
|
const xsAppJson = JSON.parse(xsAppJsonContent);
|
|
43
43
|
if (!Array.isArray(xsAppJson.routes) || !xsAppJson.routes.some((route) => route.destination)) {
|
|
44
|
-
log.
|
|
44
|
+
log.verbose(`No routes with 'destination' found in xs-app.json for app '${this.configuration.appName}'. Skipping xs-app.json update.`);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
const { serviceInstanceName, space } = this.configuration;
|
|
@@ -61,7 +61,7 @@ export default class CFProcessor {
|
|
|
61
61
|
baseAppFiles.set("xs-app.json", JSON.stringify(xsAppJson, null, 2));
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
log.
|
|
64
|
+
log.info(`No endpoints found for app '${this.configuration.appName}'. xs-app.json will not be updated.`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
enhanceRoutesWithEndpointAndService(serviceCredentials, baseRoutes) {
|
package/dist/util/cfUtil.js
CHANGED
|
@@ -214,7 +214,7 @@ export default class CFUtil {
|
|
|
214
214
|
return validKey.credentials;
|
|
215
215
|
}
|
|
216
216
|
const uniqueServiceKeyName = await uniqueServiceKeyNamePromise;
|
|
217
|
-
log.
|
|
217
|
+
log.verbose(`No valid service key found with proper endpoints structure. Creating new service key '${uniqueServiceKeyName}' for '${serviceInstance.name}'`);
|
|
218
218
|
await this.createServiceKey(serviceInstance.name, uniqueServiceKeyName);
|
|
219
219
|
// Get the newly created service key and validate its endpoints
|
|
220
220
|
const newValidKey = await this.getServiceKeyWithValidEndpoints(serviceInstance.guid);
|
package/package.json
CHANGED
package/scripts/publish.ts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { promises as fs } from "fs";
|
|
2
|
-
import path from "path";
|
|
3
|
-
import yargs from "yargs";
|
|
4
|
-
import { hideBin } from "yargs/helpers";
|
|
5
|
-
import { Octokit } from "@octokit/rest";
|
|
6
|
-
import { retry } from "@octokit/plugin-retry";
|
|
7
|
-
|
|
8
|
-
const OctokitClass = Octokit.plugin(retry);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Recursively get all file paths in the workspace root, excluding:
|
|
13
|
-
* - test/lib/integration
|
|
14
|
-
* - test/fixtures
|
|
15
|
-
* - test/expected
|
|
16
|
-
* - test/lib/index.perf.ts
|
|
17
|
-
* Returns relative paths from the root.
|
|
18
|
-
*/
|
|
19
|
-
async function getAllRootFilesExceptTestExclusions(root: string): Promise<string[]> {
|
|
20
|
-
const excludeDirs = [
|
|
21
|
-
"test/lib/integration",
|
|
22
|
-
"test/fixtures",
|
|
23
|
-
"test/expected",
|
|
24
|
-
".git",
|
|
25
|
-
"coverage",
|
|
26
|
-
".DS_Store",
|
|
27
|
-
"node_modules",
|
|
28
|
-
".nyc_output",
|
|
29
|
-
"coverage",
|
|
30
|
-
"dist",
|
|
31
|
-
"dist-debug",
|
|
32
|
-
"dist.zip",
|
|
33
|
-
".env",
|
|
34
|
-
"test/resources/metadata/download"
|
|
35
|
-
];
|
|
36
|
-
const excludeFiles = [
|
|
37
|
-
"test/lib/index.perf.ts",
|
|
38
|
-
"scripts/test-integration-prep.sh",
|
|
39
|
-
"Jenkinsfile"
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
async function walk(dir: string): Promise<string[]> {
|
|
43
|
-
const dirents = await fs.readdir(dir, { withFileTypes: true });
|
|
44
|
-
const files: string[] = [];
|
|
45
|
-
for (const dirent of dirents) {
|
|
46
|
-
const relPath = path.relative(root, path.join(dir, dirent.name));
|
|
47
|
-
if (excludeDirs.some(ex => relPath === ex || relPath.startsWith(ex + path.sep))) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
if (excludeFiles.includes(relPath)) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
if (dirent.isDirectory()) {
|
|
54
|
-
files.push(...await walk(path.join(dir, dirent.name)));
|
|
55
|
-
} else {
|
|
56
|
-
files.push(relPath);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return files;
|
|
60
|
-
}
|
|
61
|
-
return walk(root);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const FILES = await getAllRootFilesExceptTestExclusions(process.cwd());
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
interface PublishArgs {
|
|
68
|
-
p?: string;
|
|
69
|
-
dryRun?: boolean;
|
|
70
|
-
tag?: string;
|
|
71
|
-
branch?: string;
|
|
72
|
-
[key: string]: unknown;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function publish() {
|
|
76
|
-
const argv = yargs(hideBin(process.argv))
|
|
77
|
-
.option("p", {
|
|
78
|
-
type: "string",
|
|
79
|
-
description: "GitHub token (-p)",
|
|
80
|
-
alias: "p"
|
|
81
|
-
})
|
|
82
|
-
.option("dryRun", {
|
|
83
|
-
type: "boolean",
|
|
84
|
-
description: "Run without publishing",
|
|
85
|
-
default: false
|
|
86
|
-
})
|
|
87
|
-
.option("tag", {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "Publish with a specific tag"
|
|
90
|
-
})
|
|
91
|
-
.option("branch", {
|
|
92
|
-
type: "string",
|
|
93
|
-
description: "Branch to update (default: main)",
|
|
94
|
-
default: "main",
|
|
95
|
-
alias: "b"
|
|
96
|
-
})
|
|
97
|
-
.help()
|
|
98
|
-
.alias("h", "help")
|
|
99
|
-
.parseSync() as PublishArgs;
|
|
100
|
-
|
|
101
|
-
if (argv.dryRun) {
|
|
102
|
-
console.log("Dry run: no publishing will be performed.");
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const auth = argv.p;
|
|
106
|
-
if (auth) {
|
|
107
|
-
const octokit = new OctokitClass({ auth });
|
|
108
|
-
const ORGANIZATION = "SAP";
|
|
109
|
-
const REPO = "ui5-task-adaptation";
|
|
110
|
-
await uploadToRepo(octokit, ORGANIZATION, REPO, argv.branch);
|
|
111
|
-
if (argv.tag) {
|
|
112
|
-
console.log(`Published with tag: ${argv.tag}`);
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
console.log("Github token is not provided.");
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
async function getLatestVersion(): Promise<string> {
|
|
121
|
-
const pkg = await fs.readFile(path.join(process.cwd(), "package.json"), { encoding: "utf-8" });
|
|
122
|
-
const pkgJson = JSON.parse(pkg);
|
|
123
|
-
return pkgJson.version;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
async function uploadToRepo(
|
|
128
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
129
|
-
org: string,
|
|
130
|
-
repo: string,
|
|
131
|
-
branch: string = "main"
|
|
132
|
-
): Promise<void> {
|
|
133
|
-
const fileBlobs = await Promise.all(Object.values(FILES).map(file => toBlob(octokit, org, repo, path.join(process.cwd(), file))));
|
|
134
|
-
const currentCommit = await getCurrentCommit(octokit, org, repo, branch);
|
|
135
|
-
const newTree = await createNewTree(
|
|
136
|
-
octokit,
|
|
137
|
-
org,
|
|
138
|
-
repo,
|
|
139
|
-
fileBlobs,
|
|
140
|
-
FILES,
|
|
141
|
-
currentCommit.treeSha
|
|
142
|
-
);
|
|
143
|
-
const currentVersion = await getLatestVersion();
|
|
144
|
-
const commitMessage = `Release ${currentVersion}`;
|
|
145
|
-
const newCommit = await createNewCommit(
|
|
146
|
-
octokit,
|
|
147
|
-
org,
|
|
148
|
-
repo,
|
|
149
|
-
commitMessage,
|
|
150
|
-
newTree.sha,
|
|
151
|
-
currentCommit.commitSha
|
|
152
|
-
);
|
|
153
|
-
await setBranchToCommit(octokit, org, repo, branch, newCommit.sha);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
async function getCurrentCommit(
|
|
158
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
159
|
-
org: string,
|
|
160
|
-
repo: string,
|
|
161
|
-
branch: string = "main"
|
|
162
|
-
): Promise<{ commitSha: string; treeSha: string }> {
|
|
163
|
-
const { data: refData } = await octokit.git.getRef({
|
|
164
|
-
owner: org,
|
|
165
|
-
repo,
|
|
166
|
-
ref: `heads/${branch}`,
|
|
167
|
-
});
|
|
168
|
-
const commitSha = refData.object.sha
|
|
169
|
-
const { data: commitData } = await octokit.git.getCommit({
|
|
170
|
-
owner: org,
|
|
171
|
-
repo,
|
|
172
|
-
commit_sha: commitSha,
|
|
173
|
-
});
|
|
174
|
-
return {
|
|
175
|
-
commitSha,
|
|
176
|
-
treeSha: commitData.tree.sha,
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
async function toBlob(
|
|
182
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
183
|
-
org: string,
|
|
184
|
-
repo: string,
|
|
185
|
-
filePath: string
|
|
186
|
-
): Promise<{ sha: string }> {
|
|
187
|
-
const content = await fs.readFile(filePath, { encoding: "utf8" });
|
|
188
|
-
const blobData = await octokit.git.createBlob({
|
|
189
|
-
owner: org,
|
|
190
|
-
repo,
|
|
191
|
-
content,
|
|
192
|
-
encoding: "utf-8",
|
|
193
|
-
})
|
|
194
|
-
return blobData.data;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
async function createNewTree(
|
|
199
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
200
|
-
owner: string,
|
|
201
|
-
repo: string,
|
|
202
|
-
blobs: { sha: string }[],
|
|
203
|
-
paths: string[],
|
|
204
|
-
parentTreeSha: string
|
|
205
|
-
): Promise<any> {
|
|
206
|
-
const tree = blobs.map(({ sha }, i) => ({
|
|
207
|
-
path: paths[i],
|
|
208
|
-
mode: "100644" as const,
|
|
209
|
-
type: "blob" as const,
|
|
210
|
-
sha,
|
|
211
|
-
}));
|
|
212
|
-
const { data } = await octokit.git.createTree({
|
|
213
|
-
owner,
|
|
214
|
-
repo,
|
|
215
|
-
tree,
|
|
216
|
-
base_tree: parentTreeSha,
|
|
217
|
-
})
|
|
218
|
-
return data;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
async function createNewCommit(
|
|
223
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
224
|
-
org: string,
|
|
225
|
-
repo: string,
|
|
226
|
-
message: string,
|
|
227
|
-
currentTreeSha: string,
|
|
228
|
-
currentCommitSha: string
|
|
229
|
-
): Promise<any> {
|
|
230
|
-
const commit = await octokit.git.createCommit({
|
|
231
|
-
owner: org,
|
|
232
|
-
repo,
|
|
233
|
-
message,
|
|
234
|
-
tree: currentTreeSha,
|
|
235
|
-
parents: [currentCommitSha],
|
|
236
|
-
});
|
|
237
|
-
return commit.data;
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
async function setBranchToCommit(
|
|
242
|
-
octokit: InstanceType<typeof OctokitClass>,
|
|
243
|
-
org: string,
|
|
244
|
-
repo: string,
|
|
245
|
-
branch: string = "main",
|
|
246
|
-
commitSha: string
|
|
247
|
-
): Promise<any> {
|
|
248
|
-
return octokit.git.updateRef({
|
|
249
|
-
owner: org,
|
|
250
|
-
repo,
|
|
251
|
-
ref: `heads/${branch}`,
|
|
252
|
-
sha: commitSha,
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
publish();
|