@sap-ux/ui5-application-writer 1.2.0 → 1.2.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.
@@ -26,11 +26,4 @@ export declare const defaultUI5Libs: string[];
26
26
  * @returns {UI5} the updated copy of UI5 instance (does not change `ui5`)
27
27
  */
28
28
  export declare function mergeUi5(ui5: Partial<UI5>, options?: Partial<AppOptions>): UI5;
29
- /**
30
- * Retrieve the tag version of the @sap/ux-specification based on the given version.
31
- *
32
- * @param ui5Version UI5 version used in the project
33
- * @returns version tag
34
- */
35
- export declare function getSpecTagVersion(ui5Version: string | undefined): string;
36
29
  //# sourceMappingURL=defaults.d.ts.map
@@ -3,7 +3,10 @@ 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.getSpecTagVersion = exports.mergeUi5 = exports.defaultUI5Libs = exports.mergeApp = exports.packageDefaults = void 0;
6
+ exports.defaultUI5Libs = void 0;
7
+ exports.packageDefaults = packageDefaults;
8
+ exports.mergeApp = mergeApp;
9
+ exports.mergeUi5 = mergeUi5;
7
10
  const ui5_config_1 = require("@sap-ux/ui5-config");
8
11
  const mapping_json_1 = __importDefault(require("@ui5/manifest/mapping.json")); // from https://github.com/SAP/ui5-manifest/blob/master/mapping.json
9
12
  const ui5Libs_1 = require("./ui5Libs");
@@ -43,7 +46,6 @@ function packageDefaults(version, description, isEdmxProjectType) {
43
46
  scripts: {}
44
47
  };
45
48
  }
46
- exports.packageDefaults = packageDefaults;
47
49
  /**
48
50
  * Returns an app instance merged with default properties.
49
51
  *
@@ -63,7 +65,6 @@ function mergeApp(app) {
63
65
  }
64
66
  }, app);
65
67
  }
66
- exports.mergeApp = mergeApp;
67
68
  // Required default libs
68
69
  exports.defaultUI5Libs = ['sap.m', 'sap.ui.core'];
69
70
  /**
@@ -96,7 +97,6 @@ function mergeUi5(ui5, options) {
96
97
  merged.ui5Libs = (0, ui5Libs_1.getUI5Libs)(ui5.ui5Libs);
97
98
  return Object.assign({}, ui5, merged);
98
99
  }
99
- exports.mergeUi5 = mergeUi5;
100
100
  /**
101
101
  * Gets the miminum UI5 version based on the specified version.
102
102
  *
@@ -190,23 +190,4 @@ function getLocalVersion({ framework, version, localVersion }) {
190
190
  return minVersion;
191
191
  }
192
192
  }
193
- /**
194
- * Retrieve the tag version of the @sap/ux-specification based on the given version.
195
- *
196
- * @param ui5Version UI5 version used in the project
197
- * @returns version tag
198
- */
199
- function getSpecTagVersion(ui5Version) {
200
- if (ui5Version) {
201
- if (semver_1.default.valid(ui5Version)) {
202
- return `UI5-${semver_1.default.major(ui5Version)}.${semver_1.default.minor(ui5Version)}`;
203
- }
204
- else if (ui5Version.includes('snapshot') && ui5Version.includes('.')) {
205
- const snaphotVersion = ui5Version.split('snapshot-')[1];
206
- return `UI5-${snaphotVersion}`;
207
- }
208
- }
209
- return 'latest';
210
- }
211
- exports.getSpecTagVersion = getSpecTagVersion;
212
193
  //# sourceMappingURL=defaults.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mergeWithDefaults = void 0;
3
+ exports.mergeWithDefaults = mergeWithDefaults;
4
4
  const ui5_config_1 = require("@sap-ux/ui5-config");
5
5
  const defaults_1 = require("./defaults");
6
6
  const validators_1 = require("./validators");
@@ -27,12 +27,6 @@ function mergeWithDefaults(ui5App) {
27
27
  // sapuxLayer is not defined for cap projects
28
28
  ui5App.package.sapuxLayer = undefined;
29
29
  }
30
- if (ui5App.appOptions.sapux && isEdmxProjectType) {
31
- // Add @sap/ux-specification to devDependencies only for non-CAP projects
32
- ui5App.package.devDependencies = ui5App.package.devDependencies || {};
33
- ui5App.package.devDependencies['@sap/ux-specification'] = (0, defaults_1.getSpecTagVersion)(ui5App.ui5.version);
34
- }
35
30
  return ui5App;
36
31
  }
37
- exports.mergeWithDefaults = mergeWithDefaults;
38
32
  //# sourceMappingURL=index.js.map
@@ -3,7 +3,9 @@ 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.validate = exports.validateUI5Version = exports.validateAppId = void 0;
6
+ exports.validateAppId = validateAppId;
7
+ exports.validateUI5Version = validateUI5Version;
8
+ exports.validate = validate;
7
9
  const semver_1 = __importDefault(require("semver"));
8
10
  const i18n_1 = require("../i18n");
9
11
  /**
@@ -23,7 +25,6 @@ function validateAppId(appId) {
23
25
  }
24
26
  return true;
25
27
  }
26
- exports.validateAppId = validateAppId;
27
28
  /**
28
29
  * Validates by throwing if the specified version does not have a coercible semantic version.
29
30
  * Currently we have special handling for empty string and undefined otherwise see: https://github.com/npm/node-semver#coercion.
@@ -38,7 +39,6 @@ function validateUI5Version(version) {
38
39
  }
39
40
  return true;
40
41
  }
41
- exports.validateUI5Version = validateUI5Version;
42
42
  /**
43
43
  * Validates the specified ui5App.
44
44
  *
@@ -52,5 +52,4 @@ function validate(ui5App) {
52
52
  validateUI5Version(ui5App.ui5?.localVersion) &&
53
53
  validateUI5Version(ui5App.ui5?.minUI5Version));
54
54
  }
55
- exports.validate = validate;
56
55
  //# sourceMappingURL=validators.js.map
package/dist/i18n.js CHANGED
@@ -3,7 +3,8 @@ 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.t = exports.initI18n = void 0;
6
+ exports.initI18n = initI18n;
7
+ exports.t = t;
7
8
  const i18next_1 = __importDefault(require("i18next"));
8
9
  const ui5_application_writer_i18n_json_1 = __importDefault(require("./translations/ui5-application-writer.i18n.json"));
9
10
  const NS = 'ui5-application-writer';
@@ -23,7 +24,6 @@ async function initI18n() {
23
24
  ns: [NS]
24
25
  });
25
26
  }
26
- exports.initI18n = initI18n;
27
27
  /**
28
28
  * Helper function facading the call to i18next.
29
29
  *
@@ -34,7 +34,6 @@ exports.initI18n = initI18n;
34
34
  function t(key, options) {
35
35
  return i18next_1.default.t(key, options);
36
36
  }
37
- exports.t = t;
38
37
  initI18n().catch(() => {
39
38
  // Ignore any errors since the write will still work
40
39
  });
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTypescriptEnabled = exports.enableTypescript = exports.generate = void 0;
3
+ exports.generate = generate;
4
+ exports.enableTypescript = enableTypescript;
5
+ exports.isTypescriptEnabled = isTypescriptEnabled;
4
6
  const path_1 = require("path");
5
7
  const mem_fs_1 = require("mem-fs");
6
8
  const mem_fs_editor_1 = require("mem-fs-editor");
@@ -76,7 +78,6 @@ async function generate(basePath, ui5AppConfig, fs) {
76
78
  fs.write(ui5ConfigPath, ui5Config.toString());
77
79
  return fs;
78
80
  }
79
- exports.generate = generate;
80
81
  /**
81
82
  * Check if Typescript is enabled for the given path.
82
83
  *
@@ -98,7 +99,6 @@ async function isTypescriptEnabled(basePath, fs) {
98
99
  }
99
100
  return true;
100
101
  }
101
- exports.isTypescriptEnabled = isTypescriptEnabled;
102
102
  /**
103
103
  * Enable typescript in an existing valid UI5 project.
104
104
  *
@@ -135,5 +135,4 @@ async function enableTypescript(basePath, fs) {
135
135
  fs.write(ui5ConfigPath, ui5Config.toString());
136
136
  return fs;
137
137
  }
138
- exports.enableTypescript = enableTypescript;
139
138
  //# sourceMappingURL=index.js.map
package/dist/options.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getTemplateOptions = exports.applyOptionalFeatures = exports.enableNpmPackageConsumption = exports.enableTypescript = void 0;
3
+ exports.enableTypescript = enableTypescript;
4
+ exports.enableNpmPackageConsumption = enableNpmPackageConsumption;
5
+ exports.applyOptionalFeatures = applyOptionalFeatures;
6
+ exports.getTemplateOptions = getTemplateOptions;
4
7
  const path_1 = require("path");
5
8
  const ejs_1 = require("ejs");
6
9
  const project_access_1 = require("@sap-ux/project-access");
@@ -72,7 +75,6 @@ async function enableTypescript(input, keepOldComponent = false) {
72
75
  input.fs.delete(compPath);
73
76
  }
74
77
  }
75
- exports.enableTypescript = enableTypescript;
76
78
  /**
77
79
  * Enable npm module import for the given input.
78
80
  *
@@ -85,7 +87,6 @@ async function enableNpmPackageConsumption(input) {
85
87
  ui5Config.addCustomTasks([ui5Libs_1.ui5NPMSupport.task]);
86
88
  });
87
89
  }
88
- exports.enableNpmPackageConsumption = enableNpmPackageConsumption;
89
90
  /**
90
91
  * Check if the ui5 app config requires optional features to be enabled and if yes, enable them.
91
92
  *
@@ -104,7 +105,6 @@ async function applyOptionalFeatures(ui5App, fs, basePath, tmplPath, ui5Configs)
104
105
  }
105
106
  }
106
107
  }
107
- exports.applyOptionalFeatures = applyOptionalFeatures;
108
108
  /**
109
109
  * Generates the resource URL based on the project type and ui5 framework details.
110
110
  *
@@ -129,5 +129,4 @@ function getTemplateOptions(isEdmxProjectType, frameworkUrl, version) {
129
129
  return url;
130
130
  }
131
131
  }
132
- exports.getTemplateOptions = getTemplateOptions;
133
132
  //# sourceMappingURL=options.js.map
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": "1.2.0",
12
+ "version": "1.2.1",
13
13
  "license": "Apache-2.0",
14
14
  "main": "dist/index.js",
15
15
  "files": [
@@ -38,7 +38,7 @@
38
38
  "@types/semver": "7.5.2",
39
39
  "fs-extra": "10.0.0",
40
40
  "@sap-ux/eslint-plugin-fiori-tools": "0.5.0",
41
- "@sap-ux/project-access": "1.27.4"
41
+ "@sap-ux/project-access": "1.28.2"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=18.x"