@ui5/cli 4.0.9 → 4.0.11

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 CHANGED
@@ -2,10 +2,20 @@
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-cli/compare/v4.0.9...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-cli/compare/v4.0.11...HEAD).
6
+
7
+ <a name="v4.0.11"></a>
8
+ ## [v4.0.11] - 2024-11-29
9
+ ### Dependency Updates
10
+ - Bump [@ui5](https://github.com/ui5)/project from 4.0.3 to 4.0.4 [`334e2e1`](https://github.com/SAP/ui5-cli/commit/334e2e1fee0e7ee6f9b8f0c536cd2f2efd4c3f15)
11
+ - Bump [@ui5](https://github.com/ui5)/builder from 4.0.3 to 4.0.4 [`ada646c`](https://github.com/SAP/ui5-cli/commit/ada646cb6668cc9ddc03ac99aef7b992d5f2bbec)
12
+
13
+
14
+ <a name="v4.0.10"></a>
15
+ ## [v4.0.10] - 2024-11-13
6
16
 
7
17
  <a name="v4.0.9"></a>
8
- ## [v4.0.9] - 2024-10-14
18
+ ## [v4.0.9] - 2024-10-15
9
19
 
10
20
  <a name="v4.0.8"></a>
11
21
  ## [v4.0.8] - 2024-09-12
@@ -1287,6 +1297,8 @@ Only Node.js v10 or higher is supported.
1287
1297
 
1288
1298
  <a name="v0.0.1"></a>
1289
1299
  ## v0.0.1 - 2018-06-06
1300
+ [v4.0.11]: https://github.com/SAP/ui5-cli/compare/v4.0.10...v4.0.11
1301
+ [v4.0.10]: https://github.com/SAP/ui5-cli/compare/v4.0.9...v4.0.10
1290
1302
  [v4.0.9]: https://github.com/SAP/ui5-cli/compare/v4.0.8...v4.0.9
1291
1303
  [v4.0.8]: https://github.com/SAP/ui5-cli/compare/v4.0.7...v4.0.8
1292
1304
  [v4.0.7]: https://github.com/SAP/ui5-cli/compare/v4.0.6...v4.0.7
@@ -1,4 +1,6 @@
1
1
  import baseMiddleware from "../middlewares/base.js";
2
+ import path from "node:path";
3
+ import {isLogLevelEnabled} from "@ui5/logger";
2
4
  import {createRequire} from "node:module";
3
5
 
4
6
  // Using CommonsJS require since JSON module imports are still experimental
@@ -14,7 +16,15 @@ const NOT_FOUND = "===(not installed)";
14
16
  versions.getVersion = (pkg) => {
15
17
  try {
16
18
  const packageInfo = require(`${pkg}/package.json`);
17
- return packageInfo.version || NOT_FOUND;
19
+ if (!packageInfo?.version) {
20
+ return NOT_FOUND;
21
+ }
22
+ let res = packageInfo.version;
23
+ if (isLogLevelEnabled("verbose")) {
24
+ const packageDir = path.dirname(require.resolve(`${pkg}/package.json`));
25
+ res += ` (from ${packageDir})`;
26
+ }
27
+ return res;
18
28
  } catch {
19
29
  return NOT_FOUND;
20
30
  }