@ui5/task-adaptation 1.5.3 → 1.6.0-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 (53) hide show
  1. package/.hyperspace/pull_request_bot.json +19 -0
  2. package/CHANGELOG.md +18 -9
  3. package/dist/adapters/abapAdapter.d.ts +3 -0
  4. package/dist/adapters/abapAdapter.js +4 -0
  5. package/dist/adapters/adapter.d.ts +10 -0
  6. package/dist/adapters/adapter.js +11 -0
  7. package/dist/adapters/cfAdapter.d.ts +8 -0
  8. package/dist/adapters/cfAdapter.js +20 -0
  9. package/dist/appVariantManager.js +1 -1
  10. package/dist/baseAppManager.js +3 -3
  11. package/dist/buildStrategy.d.ts +0 -3
  12. package/dist/buildStrategy.js +0 -7
  13. package/dist/bundle.d.ts +4 -3
  14. package/dist/bundle.js +3663 -3606
  15. package/dist/cache/cacheHolder.d.ts +1 -1
  16. package/dist/cache/cacheHolder.js +8 -6
  17. package/dist/index.js +8 -2
  18. package/dist/model/authenticationError.d.ts +3 -0
  19. package/dist/model/authenticationError.js +8 -0
  20. package/dist/model/types.d.ts +12 -0
  21. package/dist/previewManager.d.ts +13 -0
  22. package/dist/previewManager.js +131 -0
  23. package/dist/processors/abapProcessor.d.ts +3 -0
  24. package/dist/processors/abapProcessor.js +7 -0
  25. package/dist/processors/cfProcessor.d.ts +4 -1
  26. package/dist/processors/cfProcessor.js +15 -1
  27. package/dist/processors/processor.d.ts +4 -1
  28. package/dist/repositories/html5RepoManager.d.ts +3 -2
  29. package/dist/repositories/html5RepoManager.js +18 -5
  30. package/dist/util/cf/xsAppJsonUtil.d.ts +23 -0
  31. package/dist/util/cf/xsAppJsonUtil.js +36 -0
  32. package/dist/util/cfUtil.d.ts +8 -1
  33. package/dist/util/cfUtil.js +16 -8
  34. package/dist/util/movingHandler/changeFileMoveHandler.d.ts +8 -0
  35. package/dist/util/movingHandler/changeFileMoveHandler.js +77 -0
  36. package/dist/util/resourceUtil.d.ts +11 -3
  37. package/dist/util/resourceUtil.js +83 -18
  38. package/eslint.config.js +4 -3
  39. package/package.json +15 -16
  40. package/rollup/amdToEsm.ts +22 -0
  41. package/rollup/bundle.d.ts +25 -0
  42. package/rollup/bundleDefinition.js +19 -0
  43. package/rollup/bundler.ts +35 -0
  44. package/rollup/overrides/sap/base/config.js +59 -0
  45. package/rollup/overrides/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +68 -0
  46. package/rollup/overrides/sap/ui/performance/Measurement.js +4 -0
  47. package/rollup/project/package.json +4 -0
  48. package/rollup/project/ui5.yaml +13 -0
  49. package/rollup/project/webapp/manifest.json +5 -0
  50. package/rollup/rollup.ts +133 -0
  51. package/rollup/ui5Resolve.ts +145 -0
  52. package/scripts/publish.ts +256 -0
  53. package/scripts/test-integration-prep.sh +4 -0
@@ -0,0 +1,77 @@
1
+ import path from "path";
2
+ import { isManifestChange } from "../commonUtil.js";
3
+ const EXT_DIR = "ext/";
4
+ const CHANGES_DIR = "changes/";
5
+ const nameSpaceRegex = new RegExp(`(?<=ControllerExtension.extend\\(")([^"]*)(?=")`);
6
+ /**
7
+ * 2p. We move to appVariantFolder (prefix) only files that go along the
8
+ * change files, like js or fragments. Changes are renamed in resources,
9
+ * packed in flexibility-bundle and removed.
10
+ * @param filename - The filename relative to the root
11
+ */
12
+ function shouldMove(filename, content) {
13
+ //TODO: is it more reliable to check change/fileType?
14
+ if (isManifestChange(filename, content)) {
15
+ return true;
16
+ }
17
+ return filename.startsWith(CHANGES_DIR) && [".change", ".variant", ".ctrl_variant", ".ctrl_variant_change", ".ctrl_variant_management_change"].every(ext => !filename.endsWith(ext))
18
+ || filename.startsWith(EXT_DIR);
19
+ }
20
+ /**
21
+ * For controller extension the namespace needs a prefix
22
+ * The namespace needs to be unique for clear identification
23
+ * If controller extension have the same namespace the last one will be used
24
+ * @param filename - The filename relative to the root
25
+ * @returns
26
+ */
27
+ function shouldNamespaceRenamed(filename) {
28
+ return filename.startsWith(CHANGES_DIR) && filename.endsWith(".js");
29
+ }
30
+ /**
31
+ * Returns path without first directory (which is usually "changes" or
32
+ * "ext") and without file extension. For example, for
33
+ * "changes/coding/FixingDay.js" it returns "coding/FixingDay", for
34
+ * "changes/customer_app_variant5/fragments/hello_world_fixing_day.fragment.xml"
35
+ * it returns
36
+ * "changes/customer_app_variant5/fragments/hello_world_fixing_day". We
37
+ * remove all extensions not to rename it with slashes instead of dots. And
38
+ * we also exclude "changes" or "ext" include the prefix after them and then
39
+ * the filename. Without 'changes' or 'ext' directory, we need to replace
40
+ * only rest: coding/FixingDay.js to app_var_id1/coding/FixingDay.js
41
+ * @param filename
42
+ * @returns
43
+ */
44
+ function getPathWithoutExtensions(filename) {
45
+ const [_dir, ...rest] = filename.split("/");
46
+ const restWOExt = [...rest];
47
+ restWOExt[restWOExt.length - 1] = restWOExt[restWOExt.length - 1].split(".")[0];
48
+ return restWOExt.join("/");
49
+ }
50
+ export const moveFiles = (inputFiles, prefix, id) => {
51
+ const files = new Map();
52
+ let renamingPaths = new Map();
53
+ inputFiles.forEach((content, filename) => {
54
+ const { newFilename, renamingPath } = moveFile(filename, content, prefix, id);
55
+ files.set(newFilename, content);
56
+ renamingPaths = new Map([...renamingPaths, ...renamingPath]);
57
+ });
58
+ return { files, renamingPaths };
59
+ };
60
+ export const moveFile = (filename, content, prefix, id) => {
61
+ let newFilename = filename;
62
+ let renamingPath = new Map();
63
+ if (shouldMove(filename, content)) {
64
+ const [dir, ...rest] = filename.split("/");
65
+ newFilename = path.join(dir, prefix, rest.join("/"));
66
+ const restWOExtPath = getPathWithoutExtensions(filename);
67
+ renamingPath.set(restWOExtPath, path.join(prefix, restWOExtPath));
68
+ }
69
+ if (shouldNamespaceRenamed(filename)) {
70
+ const namespaceMatch = nameSpaceRegex.exec(content.trim());
71
+ const controllerExtensionPath = namespaceMatch ? namespaceMatch[0] : "";
72
+ const fileName = controllerExtensionPath.replace(id, "");
73
+ renamingPath.set(controllerExtensionPath, `${id}.${prefix}${fileName}`);
74
+ }
75
+ return { newFilename, renamingPath };
76
+ };
77
+ //# sourceMappingURL=changeFileMoveHandler.js.map
@@ -3,11 +3,19 @@ export default class ResourceUtil {
3
3
  static relativeToRoot(resourcePath: string, projectNamespace?: string): string;
4
4
  static getResourcePath(projectNamespace?: string, ...paths: string[]): string;
5
5
  static write(dir: string, files: Map<string, string>): Promise<void[]>;
6
- private static _read;
7
- static read(folder: string): Map<string, string>;
6
+ static writeInProject(dir: string, files: Map<string, string>): Promise<void[]>;
7
+ static byGlob(dir: string, pattern: string, excludes?: string[]): Promise<Map<string, string>>;
8
+ static byGlobInProject(pattern: string, excludes?: string[]): Promise<Map<string, string>>;
9
+ static readInProject(filepath: string): Promise<string>;
8
10
  static getString(resource: any): Promise<string>;
9
11
  static getJson(resource: any): Promise<any>;
10
12
  static setString(resource: any, str: string): void;
13
+ /**
14
+ * Check whether a file or directory exists (non-throwing).
15
+ * @param filePath Absolute or relative path
16
+ * @returns true if the path exists, false if not
17
+ */
18
+ private static fileExists;
11
19
  static createResource(filename: string, projectNamespace: string, content: string): any;
12
- static toFileMap(resources: ReadonlyArray<Resource>, projectNamespace: string): Promise<Map<string, string>>;
20
+ static toFileMap(resources: ReadonlyArray<Resource>, projectNamespace?: string): Promise<Map<string, string>>;
13
21
  }
@@ -1,6 +1,6 @@
1
- import * as fs from "fs";
2
1
  import * as resourceFactory from "@ui5/fs/resourceFactory";
3
2
  import { posix as path } from "path";
3
+ import * as fs from "fs/promises";
4
4
  const UTF8 = "utf8";
5
5
  export default class ResourceUtil {
6
6
  static getRootFolder(projectNamespace) {
@@ -17,6 +17,14 @@ export default class ResourceUtil {
17
17
  static getResourcePath(projectNamespace, ...paths) {
18
18
  return path.join(this.getRootFolder(projectNamespace), ...paths);
19
19
  }
20
+ /*
21
+ * Write files to the specified folder.
22
+ * NOTE: to write in project folder (folder where 'webapp',
23
+ * 'package.json', 'ui5.yaml' located), use writeInProject method.
24
+ * @param dir The directory to write files to.
25
+ * @param files A Map of file paths and their contents.
26
+ * @returns A promise that resolves when all files have been written.
27
+ */
20
28
  static write(dir, files) {
21
29
  const fsTarget = resourceFactory.createAdapter({
22
30
  fsBasePath: dir,
@@ -29,25 +37,65 @@ export default class ResourceUtil {
29
37
  });
30
38
  return Promise.all(promises);
31
39
  }
32
- static _read(rootFolder, folder, files, exclude = []) {
33
- const entries = fs.readdirSync(folder);
34
- for (let entry of entries) {
35
- const entryPath = path.join(folder, entry);
36
- const stats = fs.lstatSync(entryPath);
37
- if (stats.isFile() && !exclude.some(filepath => entryPath.endsWith(filepath))) {
38
- const normalized = entryPath.substring(rootFolder.length + 1);
39
- files.set(normalized, fs.readFileSync(entryPath, { encoding: "utf-8" }));
40
- }
41
- else if (stats.isDirectory()) {
42
- this._read(rootFolder, entryPath, files, exclude);
40
+ /*
41
+ * Write files to the project folder (folder where 'webapp',
42
+ * 'package.json', 'ui5.yaml' located), use writeInProject method.
43
+ * @param dir The directory to write files to.
44
+ * @param files A Map of file paths and their contents.
45
+ * @returns A promise that resolves when all files have been written.
46
+ */
47
+ static writeInProject(dir, files) {
48
+ return ResourceUtil.write(path.join("./", dir), files);
49
+ }
50
+ /*
51
+ * Search files in the given folder, excluding specified glob patterns.
52
+ * NOTE: to search in project folder (folder where 'webapp',
53
+ * 'package.json', 'ui5.yaml' located), use byGlobInProject method.
54
+ * @param dir The directory to search in.
55
+ * @param pattern The glob pattern to match files, e.g., "/ui5AppInfo.json".
56
+ * @param excludes An array of glob patterns to exclude from the search.
57
+ * @returns A promise that resolves to a Map of file paths and their contents.
58
+ */
59
+ static byGlob(dir, pattern, excludes = []) {
60
+ const adapter = resourceFactory.createAdapter({
61
+ fsBasePath: dir,
62
+ virBasePath: "/",
63
+ excludes
64
+ });
65
+ return adapter.byGlob(pattern).then((resources) => this.toFileMap(resources));
66
+ }
67
+ /*
68
+ * Search files in the adaptation project (folder where 'webapp',
69
+ * 'package.json', 'ui5.yaml' located), excluding specified glob patterns.
70
+ * @param pattern The glob pattern to match files, e.g., "/ui5AppInfo.json".
71
+ * @param excludes An array of glob patterns to exclude from the search.
72
+ * @returns A promise that resolves to a Map of file paths and their contents.
73
+ */
74
+ static byGlobInProject(pattern, excludes = []) {
75
+ return ResourceUtil.byGlob("./", pattern, [
76
+ "/node_modules",
77
+ "/dist",
78
+ "/.adp/reuse"
79
+ ].concat(excludes));
80
+ }
81
+ /*
82
+ * Read the file by filepath from the project root (folder where 'webapp',
83
+ * 'package.json', 'ui5.yaml' located).
84
+ * @param filepath The relative file path from the project root (e.g. 'ui5AppInfo.json').
85
+ * @returns A promise that resolves to the file content as a string.
86
+ */
87
+ static async readInProject(filepath) {
88
+ try {
89
+ return await fs.readFile(path.resolve(process.cwd(), filepath), UTF8);
90
+ }
91
+ catch (error) {
92
+ const isProjectRoot = await ResourceUtil.fileExists(path.join(process.cwd(), "ui5.yaml"));
93
+ if (!isProjectRoot) {
94
+ throw new Error(`Please make sure that build has been started from the project root: ${error?.message ?? ""}`);
43
95
  }
96
+ throw error;
44
97
  }
45
98
  }
46
- static read(folder) {
47
- const files = new Map();
48
- this._read(folder, folder, files);
49
- return files;
50
- }
51
99
  static getString(resource) {
52
100
  return resource.getBuffer().then((buffer) => buffer.toString(UTF8));
53
101
  }
@@ -57,6 +105,23 @@ export default class ResourceUtil {
57
105
  static setString(resource, str) {
58
106
  resource.setBuffer(Buffer.from(str, UTF8));
59
107
  }
108
+ /**
109
+ * Check whether a file or directory exists (non-throwing).
110
+ * @param filePath Absolute or relative path
111
+ * @returns true if the path exists, false if not
112
+ */
113
+ static async fileExists(filePath) {
114
+ try {
115
+ await fs.access(filePath);
116
+ return true;
117
+ }
118
+ catch (e) {
119
+ if (e?.code === "ENOENT") {
120
+ return false;
121
+ }
122
+ throw e;
123
+ }
124
+ }
60
125
  static createResource(filename, projectNamespace, content) {
61
126
  return resourceFactory.createResource({
62
127
  path: this.getResourcePath(projectNamespace, filename),
@@ -65,7 +130,7 @@ export default class ResourceUtil {
65
130
  }
66
131
  static async toFileMap(resources, projectNamespace) {
67
132
  const files = new Map();
68
- const rootFolderLength = ResourceUtil.getRootFolder(projectNamespace).length;
133
+ const rootFolderLength = projectNamespace ? ResourceUtil.getRootFolder(projectNamespace).length : 0;
69
134
  for (const resource of resources) {
70
135
  files.set(resource.getPath().substring(rootFolderLength + 1), await ResourceUtil.getString(resource));
71
136
  }
package/eslint.config.js CHANGED
@@ -3,7 +3,7 @@ import * as eslintimport from "eslint-plugin-import";
3
3
  import eslint from "@eslint/js";
4
4
  import tseslint from "typescript-eslint";
5
5
 
6
- export default tseslint.config(
6
+ export default tseslint.config([
7
7
  eslint.configs.recommended,
8
8
  ...tseslint.configs.recommendedTypeChecked,
9
9
  {
@@ -12,7 +12,8 @@ export default tseslint.config(
12
12
  project: [
13
13
  "./tsconfig.json",
14
14
  "./test/lib/tsconfig.json",
15
- "./scripts/tsconfig.json"
15
+ "./scripts/tsconfig.json",
16
+ "./rollup/tsconfig.json"
16
17
  ],
17
18
  tsconfigRootDir: import.meta.dirname,
18
19
  },
@@ -65,4 +66,4 @@ export default tseslint.config(
65
66
  "@typescript-eslint/no-unused-expressions": "off"
66
67
  },
67
68
  }
68
- );
69
+ ]);
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@ui5/task-adaptation",
3
- "version": "1.5.3",
3
+ "version": "1.6.0-rc.1",
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": {
7
7
  "test": "npm run lint && npm run build && npm run coverage",
8
8
  "lint": "eslint ./src ./test/lib",
9
- "dev": "UI5_LOG_LVL=error mocha --no-timeouts --no-warnings --import=tsx --loader=esmock 'test/lib/**/*.spec.ts'",
10
- "perf": "UI5_LOG_LVL=error mocha --no-timeouts --no-warnings --import=tsx --loader=esmock 'test/lib/**/*.perf.ts'",
9
+ "dev": "UI5_LOG_LVL=error mocha --no-timeouts --no-warnings --import=tsx 'test/lib/**/*.spec.ts'",
10
+ "perf": "UI5_LOG_LVL=error mocha --no-timeouts --no-warnings --import=tsx 'test/lib/**/*.perf.ts'",
11
11
  "coverage": "c8 npm run dev",
12
12
  "preversion": "npm test",
13
13
  "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
14
14
  "prepublishOnly": "git push --follow-tags",
15
15
  "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
16
- "rollup": "tsx scripts/rollup.ts",
16
+ "rollup": "tsx rollup/rollup.ts",
17
17
  "build": "npm run rollup && tsc -p ./",
18
18
  "download-metadata": "tsx scripts/metadataDownloadHelper.ts"
19
19
  },
@@ -46,12 +46,11 @@
46
46
  "dotenv": "^16.0.3",
47
47
  "filenamify": "^6.0.0",
48
48
  "jsdom": "^23.0.1",
49
- "temp-dir": "^2.0.0",
50
49
  "transliteration": "^2.3.5",
51
50
  "xml-js": "^1.6.11"
52
51
  },
53
52
  "devDependencies": {
54
- "@buxlabs/amd-to-es6": "^0.16.3",
53
+ "@buxlabs/amd-to-es6": "^0.16.4",
55
54
  "@octokit/plugin-retry": "^8.0.1",
56
55
  "@octokit/rest": "^22.0.0",
57
56
  "@rollup/plugin-node-resolve": "^15.3.0",
@@ -65,29 +64,29 @@
65
64
  "@types/semver": "^7.3.8",
66
65
  "@types/sinon": "^10.0.16",
67
66
  "@types/yargs": "^17.0.33",
68
- "@ui5/builder": "^4.0.3",
69
- "@ui5/project": "^4.0.3",
67
+ "@ui5/builder": "^4.1.3",
68
+ "@ui5/project": "^4.0.9",
70
69
  "amdextract": "^3.0.0",
71
70
  "builtin-modules": "^3.2.0",
72
71
  "c8": "^10.1.3",
73
- "chai": "^4.3.4",
74
- "chai-as-promised": "^7.1.1",
72
+ "chai": "^6.2.1",
73
+ "chai-as-promised": "^8.0.2",
75
74
  "eslint": "^9.22.0",
76
75
  "eslint-plugin-import": "^2.31.0",
77
- "esmock": "^2.6.3",
78
- "glob": "^10.3.10",
76
+ "esmock": "^2.7.3",
77
+ "glob": "^13.0.0",
79
78
  "js-yaml": "^4.1.0",
80
79
  "meriyah": "^6.0.3",
81
80
  "minimatch": "^9.0.3",
82
- "mocha": "^11.1.0",
81
+ "mocha": "^11.7.5",
83
82
  "mock-require": "^3.0.3",
84
83
  "rollup": "^4.24.0",
85
84
  "semver": "^7.3.5",
86
85
  "sinon": "^18.0.1",
87
86
  "source-map-support": "^0.5.19",
88
- "tsx": "^4.7.1",
89
- "typescript": "^5.4.2",
90
- "typescript-eslint": "^8.26.1",
87
+ "tsx": "^4.21.0",
88
+ "typescript": "^5.9.3",
89
+ "typescript-eslint": "^8.48.1",
91
90
  "yargs": "^17.7.2"
92
91
  },
93
92
  "c8": {
@@ -0,0 +1,22 @@
1
+ import { parse } from "meriyah";
2
+ import { traverse } from "../src/util/commonUtil.js";
3
+
4
+ export default function convert(content: string) {
5
+ return [
6
+ extractEsmClass
7
+ ].reduce((result, converter) => converter(result), content);
8
+ }
9
+
10
+ function extractEsmClass(content: string) {
11
+ const result = parse(content, { ranges: true });
12
+ let classCode: { start: number, end: number } | undefined;
13
+ traverse(result, [], (json, key) => {
14
+ if (key === "type" && json[key] === "ClassDeclaration") {
15
+ if (classCode) {
16
+ throw new Error("Only one class declaration per module is allowed");
17
+ }
18
+ classCode = json;
19
+ }
20
+ });
21
+ return classCode && "export default " + content.substring(classCode.start, classCode.end) || content;
22
+ }
@@ -0,0 +1,25 @@
1
+ export declare const RegistrationBuild: any;
2
+
3
+ export declare class RawApplier {
4
+ static applyChanges(changeHandlers: any[], manifest: any, changes: AppDescriptorChange[], strategy: any): Promise<void>;
5
+ }
6
+
7
+ export declare class AppDescriptorChange {
8
+ constructor(change: any);
9
+ getLayer(): string;
10
+ getChangeType(): string;
11
+ }
12
+
13
+ export declare class V2MetadataConverter {
14
+ convertXMLMetadata(jsdom: any): any;
15
+ }
16
+
17
+ export declare class V4MetadataConverter {
18
+ convertXMLMetadata(jsdom: any): any;
19
+ }
20
+
21
+ export declare class URI {
22
+ constructor(relativeUrl: string);
23
+ absoluteTo(url: string): string;
24
+ static parse(url: string): { path: string };
25
+ }
@@ -0,0 +1,19 @@
1
+ //Flex
2
+ import AppDescriptorChange from "sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange";
3
+ import RawApplier from "sap/ui/fl/apply/_internal/changes/descriptor/RawApplier";
4
+ import RegistrationBuild from "sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild";
5
+ //OData
6
+ import URI from "sap/ui/thirdparty/URI";
7
+ import V2MetadataConverter from "sap/ui/model/odata/v4/lib/_V2MetadataConverter";
8
+ import V4MetadataConverter from "sap/ui/model/odata/v4/lib/_V4MetadataConverter";
9
+
10
+ export {
11
+ //Flex
12
+ AppDescriptorChange,
13
+ RawApplier,
14
+ RegistrationBuild,
15
+ //OData
16
+ URI,
17
+ V4MetadataConverter,
18
+ V2MetadataConverter
19
+ };
@@ -0,0 +1,35 @@
1
+ import * as rollup from "rollup";
2
+ import * as builtins from "builtin-modules";
3
+ import ui5 from "./ui5Resolve.js";
4
+ import { nodeResolve } from "@rollup/plugin-node-resolve";
5
+
6
+
7
+ export default abstract class Bundler {
8
+
9
+ static async run(resources: Map<string, any>, input: string, output: string, skipTransformation: string[] = []): Promise<void> {
10
+ if (!skipTransformation.includes(input)) {
11
+ skipTransformation.push(input);
12
+ }
13
+ const inputOptions = <rollup.RollupOptions>{
14
+ input,
15
+ plugins: [
16
+ ui5({
17
+ resources,
18
+ skipTransformation,
19
+ output
20
+ }),
21
+ nodeResolve({
22
+ preferBuiltins: true
23
+ })
24
+ ],
25
+ external: builtins
26
+ };
27
+ const bundle = await rollup.rollup(inputOptions);
28
+ const outputOptions = <rollup.RollupOptions>{
29
+ file: output,
30
+ format: "esm"
31
+ };
32
+ await bundle.write(outputOptions);
33
+ await bundle.close();
34
+ }
35
+ }
@@ -0,0 +1,59 @@
1
+ /*!
2
+ * ${copyright}
3
+ */
4
+ sap.ui.define([
5
+ ], (
6
+ ) => {
7
+ "use strict";
8
+
9
+ /**
10
+ * The base Configuration.
11
+ *
12
+ * @author SAP SE
13
+ * @version ${version}
14
+ * @private
15
+ * @ui5-restricted sap.ui.core, sap.fl, sap.ui.intergration, sap.ui.export
16
+ * @alias module:sap/base/config
17
+ * @borrows module:sap/base/config/_Configuration.get as get
18
+ * @borrows module:sap/base/config/_Configuration.Type as Type
19
+ * @namespace
20
+ */
21
+
22
+ const _Configuration = { _: {} };
23
+
24
+ const internalConfig = new Map();
25
+
26
+ /**
27
+ * Returns a writable base configuration instance
28
+ * @returns {module:sap/base/config} The writable base configuration
29
+ * @private
30
+ * @ui5-restricted sap.ui.core, sap.fl
31
+ */
32
+ _Configuration.getWritableInstance = () => {
33
+ return {
34
+ get(obj) {
35
+ internalConfig.get(obj.name);
36
+ },
37
+ set(name, obj) {
38
+ internalConfig.set(name, obj);
39
+ }
40
+ }
41
+ };
42
+
43
+ /**
44
+ * Attaches the <code>fnFunction</code> event handler to the {@link #event:invalidated invalidated} event
45
+ *
46
+ * @param {function} fnFunction The function to be called when the event occurs
47
+ * @private
48
+ */
49
+ function attachInvalidated() {
50
+ }
51
+ _Configuration._.attachInvalidated = attachInvalidated;
52
+
53
+ const origInvalidate = _Configuration._.invalidate;
54
+ _Configuration._.invalidate = () => {
55
+ origInvalidate();
56
+ };
57
+
58
+ return _Configuration;
59
+ });
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2020 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ ], function (
9
+ ) {
10
+ "use strict";
11
+
12
+ /**
13
+ * Flexibility change class. Stores change content and related information.
14
+ *
15
+ * @param {object} oFile - File content and admin data
16
+ *
17
+ * @class sap.ui.fl.Change
18
+ * @private
19
+ * @ui5-restricted
20
+ * @experimental Since 1.25.0
21
+ */
22
+ var AppDescriptorChange = function (content) {
23
+ this.content = content;
24
+ };
25
+
26
+ /**
27
+ * Returns the change type.
28
+ *
29
+ * @returns {String} Change type of the file, for example <code>LabelChange</code>
30
+ * @public
31
+ */
32
+ AppDescriptorChange.prototype.getChangeType = function () {
33
+ return this.content?.flexObjectMetadata?.changeType || this.content?.changeType;
34
+ };
35
+
36
+ /**
37
+ * Gets the layer type for the change.
38
+ * @returns {string} Layer of the change file
39
+ *
40
+ * @public
41
+ */
42
+ AppDescriptorChange.prototype.getLayer = function () {
43
+ return this.content.layer;
44
+ };
45
+
46
+ /**
47
+ * Returns the content section of the change.
48
+ * @returns {string} Content of the change file. The content structure can be any JSON.
49
+ *
50
+ * @public
51
+ */
52
+ AppDescriptorChange.prototype.getContent = function () {
53
+ return this.content.content;
54
+ };
55
+
56
+ /**
57
+ * Returns all texts.
58
+ *
59
+ * @returns {object} All texts
60
+ *
61
+ * @function
62
+ */
63
+ AppDescriptorChange.prototype.getTexts = function () {
64
+ return this.content.texts;
65
+ };
66
+
67
+ return AppDescriptorChange;
68
+ }, true);
@@ -0,0 +1,4 @@
1
+ export default class PerfMeasurement {
2
+ static average() {}
3
+ static end() {}
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "rollup",
3
+ "version": "1.0.0"
4
+ }
@@ -0,0 +1,13 @@
1
+ ---
2
+ specVersion: "2.2"
3
+ type: application
4
+ metadata:
5
+ name: rollup
6
+ allowSapInternal: true
7
+ framework:
8
+ name: SAPUI5
9
+ version: 0.0.0
10
+ libraries:
11
+ - name: sap.ui.fl
12
+ - name: sap.suite.ui.generic.template
13
+ - name: sap.fe.core
@@ -0,0 +1,5 @@
1
+ {
2
+ "sap.app": {
3
+ "id": "rollup"
4
+ }
5
+ }