@sap-ux/ui5-application-writer 0.14.4 → 0.14.5

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.
@@ -45,4 +45,11 @@ export declare const defaultUI5Libs: string[];
45
45
  * @returns {UI5} the updated copy of UI5 instance (does not change `ui5`)
46
46
  */
47
47
  export declare function mergeUi5(ui5: Partial<UI5>): UI5;
48
+ /**
49
+ * Retrieve the tag version of the @sap/ux-specification based on the given version.
50
+ *
51
+ * @param ui5Version UI5 version used in the project
52
+ * @returns version tag
53
+ */
54
+ export declare function getSpecTagVersion(ui5Version: string | undefined): string;
48
55
  //# sourceMappingURL=defaults.d.ts.map
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.mergeUi5 = exports.defaultUI5Libs = exports.UI5_DEFAULT = exports.mergeApp = exports.mergePackages = exports.packageDefaults = void 0;
6
+ exports.getSpecTagVersion = exports.mergeUi5 = exports.defaultUI5Libs = exports.UI5_DEFAULT = exports.mergeApp = exports.mergePackages = exports.packageDefaults = void 0;
7
7
  const version_to_descriptor_mapping_json_1 = __importDefault(require("./version-to-descriptor-mapping.json")); // from https://github.com/SAP/ui5-manifest/blob/master/mapping.json
8
8
  const ui5Libs_1 = require("./ui5Libs");
9
9
  const semver_1 = __importDefault(require("semver"));
@@ -216,4 +216,23 @@ function getLocalVersion({ framework, version, localVersion }) {
216
216
  }
217
217
  return result;
218
218
  }
219
+ /**
220
+ * Retrieve the tag version of the @sap/ux-specification based on the given version.
221
+ *
222
+ * @param ui5Version UI5 version used in the project
223
+ * @returns version tag
224
+ */
225
+ function getSpecTagVersion(ui5Version) {
226
+ if (ui5Version) {
227
+ if (semver_1.default.valid(ui5Version)) {
228
+ return `UI5-${semver_1.default.major(ui5Version)}.${semver_1.default.minor(ui5Version)}`;
229
+ }
230
+ else if (ui5Version.includes('snapshot') && ui5Version.includes('.')) {
231
+ const snaphotVersion = ui5Version.split('snapshot-')[1];
232
+ return `UI5-${snaphotVersion}`;
233
+ }
234
+ }
235
+ return 'latest';
236
+ }
237
+ exports.getSpecTagVersion = getSpecTagVersion;
219
238
  //# sourceMappingURL=defaults.js.map
@@ -16,6 +16,9 @@ function mergeWithDefaults(ui5App) {
16
16
  ui5App.appOptions = ui5App.appOptions || {};
17
17
  ui5App.ui5 = defaults_1.mergeUi5(ui5App.ui5 || {});
18
18
  ui5App.package = defaults_1.mergePackages(defaults_1.packageDefaults(ui5App.package.version, ui5App.app.description), ui5App.package);
19
+ if (ui5App.appOptions.sapux) {
20
+ ui5App.package.devDependencies['@sap/ux-specification'] = defaults_1.getSpecTagVersion(ui5App.ui5.version);
21
+ }
19
22
  return ui5App;
20
23
  }
21
24
  exports.mergeWithDefaults = mergeWithDefaults;
@@ -1,5 +1,10 @@
1
1
  {
2
- "latest": "1.40.0",
2
+ "latest": "1.45.0",
3
+ "1.105": "1.45.0",
4
+ "1.104": "1.44.0",
5
+ "1.103": "1.43.0",
6
+ "1.102": "1.42.0",
7
+ "1.101": "1.41.0",
3
8
  "1.100": "1.40.0",
4
9
  "1.99": "1.39.0",
5
10
  "1.98": "1.38.0",
package/dist/index.js CHANGED
@@ -70,7 +70,7 @@ function generate(basePath, ui5AppConfig, fs) {
70
70
  });
71
71
  }
72
72
  else {
73
- const add = JSON.parse(ejs_1.render(fs === null || fs === void 0 ? void 0 : fs.read(optTmplFilePath), ui5App));
73
+ const add = JSON.parse(ejs_1.render(fs === null || fs === void 0 ? void 0 : fs.read(optTmplFilePath), ui5App, {}));
74
74
  const existingFile = JSON.parse(fs === null || fs === void 0 ? void 0 : fs.read(outPath));
75
75
  const merged = json_merger_1.mergeObjects([existingFile, add], { defaultArrayMergeOperation: 'concat' });
76
76
  fs === null || fs === void 0 ? void 0 : fs.writeJSON(outPath, merged);
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "bugs": {
10
10
  "url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aui5-application-writer"
11
11
  },
12
- "version": "0.14.4",
12
+ "version": "0.14.5",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [