@sap-ux/project-access 1.25.1 → 1.25.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.
@@ -57,10 +57,10 @@ async function hasSpecificationDevDependency(root) {
57
57
  async function getSpecificationModule(root, options) {
58
58
  const logger = options?.logger;
59
59
  let specification;
60
- const distTag = await getProjectDistTag(root, { logger });
60
+ const version = await getSpecificationVersion(root, { logger });
61
61
  try {
62
- specification = await getSpecificationByDistTag(distTag, { logger });
63
- logger?.debug(`Specification loaded from cache using dist-tag '${distTag}'`);
62
+ specification = await getSpecificationByVersion(version, { logger });
63
+ logger?.debug(`Specification loaded from cache using version '${version}'`);
64
64
  }
65
65
  catch (error) {
66
66
  logger?.error(`Failed to load specification: ${error}`);
@@ -128,16 +128,15 @@ async function refreshSpecificationDistTags(options) {
128
128
  }
129
129
  exports.refreshSpecificationDistTags = refreshSpecificationDistTags;
130
130
  /**
131
- * Loads and return specification from cache by dist-tag.
131
+ * Loads and return specification from cache by version.
132
132
  *
133
- * @param distTag - dist-tag of the specification, like 'latest' or 'UI5-1.71'
133
+ * @param version - version of the specification
134
134
  * @param [options] - optional options
135
135
  * @param [options.logger] - optional logger instance
136
136
  * @returns - specification instance
137
137
  */
138
- async function getSpecificationByDistTag(distTag, options) {
138
+ async function getSpecificationByVersion(version, options) {
139
139
  const logger = options?.logger;
140
- const version = await convertDistTagToVersion(distTag, { logger });
141
140
  const specification = await (0, module_loader_1.getModule)('@sap/ux-specification', version, { logger });
142
141
  return specification;
143
142
  }
@@ -187,14 +186,14 @@ async function getSpecificationPath(root, options) {
187
186
  if (await hasSpecificationDevDependency(root)) {
188
187
  const modulePath = await (0, module_loader_1.getModulePath)(root, moduleName);
189
188
  logger?.debug(`Specification root found in project '${root}'`);
190
- return modulePath.slice(0, modulePath.lastIndexOf(moduleName) + moduleName.length);
189
+ return modulePath.slice(0, modulePath.lastIndexOf((0, path_1.join)(moduleName)) + (0, path_1.join)(moduleName).length);
191
190
  }
192
- logger?.debug(`Specification not found in project '${root}', trying to find in cache`);
193
191
  await getSpecificationModule(root, { logger });
194
192
  const version = await getSpecificationVersion(root, { logger });
193
+ logger?.debug(`Specification not found in project '${root}', using path from cache with version '${version}'`);
195
194
  const moduleRoot = (0, path_1.join)(constants_1.moduleCacheRoot, moduleName, version);
196
195
  const modulePath = await (0, module_loader_1.getModulePath)(moduleRoot, moduleName);
197
- return modulePath.slice(0, modulePath.lastIndexOf(moduleName) + moduleName.length);
196
+ return modulePath.slice(0, modulePath.lastIndexOf((0, path_1.join)(moduleName)) + (0, path_1.join)(moduleName).length);
198
197
  }
199
198
  exports.getSpecificationPath = getSpecificationPath;
200
199
  //# sourceMappingURL=specification.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap-ux/project-access",
3
- "version": "1.25.1",
3
+ "version": "1.25.3",
4
4
  "description": "Library to access SAP Fiori tools projects",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "mem-fs-editor": "9.4.0",
31
31
  "semver": "7.5.4",
32
32
  "@sap-ux/i18n": "0.1.0",
33
- "@sap-ux/ui5-config": "0.23.0"
33
+ "@sap-ux/ui5-config": "0.23.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/mem-fs": "1.1.2",