@ui5/cli 2.14.8 → 2.14.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,7 +2,22 @@
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/v2.14.8...HEAD).
5
+ A list of unreleased changes can be found [here](https://github.com/SAP/ui5-cli/compare/v2.14.11...HEAD).
6
+
7
+ <a name="v2.14.11"></a>
8
+ ## [v2.14.11] - 2022-09-05
9
+ ### Bug Fixes
10
+ - Upgrade update-notifier to solve security vulnerabilities ([#533](https://github.com/SAP/ui5-cli/issues/533)) [`5b7cfcf`](https://github.com/SAP/ui5-cli/commit/5b7cfcf62c37492c4072c69f400512ef59aab502)
11
+
12
+
13
+ <a name="v2.14.10"></a>
14
+ ## [v2.14.10] - 2022-07-25
15
+
16
+ <a name="v2.14.9"></a>
17
+ ## [v2.14.9] - 2022-05-04
18
+ ### Dependency Updates
19
+ - Bump [@ui5](https://github.com/ui5)/builder from 2.11.4 to 2.11.5 [`aa90039`](https://github.com/SAP/ui5-cli/commit/aa9003933bb6f5e71e9ce968ab5cc6202f805256)
20
+
6
21
 
7
22
  <a name="v2.14.8"></a>
8
23
  ## [v2.14.8] - 2022-04-14
@@ -729,6 +744,9 @@ Only Node.js v10 or higher is supported.
729
744
  <a name="v0.0.1"></a>
730
745
  ## v0.0.1 - 2018-06-06
731
746
 
747
+ [v2.14.11]: https://github.com/SAP/ui5-cli/compare/v2.14.10...v2.14.11
748
+ [v2.14.10]: https://github.com/SAP/ui5-cli/compare/v2.14.9...v2.14.10
749
+ [v2.14.9]: https://github.com/SAP/ui5-cli/compare/v2.14.8...v2.14.9
732
750
  [v2.14.8]: https://github.com/SAP/ui5-cli/compare/v2.14.7...v2.14.8
733
751
  [v2.14.7]: https://github.com/SAP/ui5-cli/compare/v2.14.6...v2.14.7
734
752
  [v2.14.6]: https://github.com/SAP/ui5-cli/compare/v2.14.5...v2.14.6
package/bin/ui5.js CHANGED
@@ -38,7 +38,7 @@ if (
38
38
  console.log("=====================================================================");
39
39
  }
40
40
  // Timeout is required to log info when importing from local installation
41
- setTimeout(() => {
41
+ setTimeout(async () => {
42
42
  if (!process.env.UI5_CLI_NO_LOCAL) {
43
43
  const importLocal = require("import-local");
44
44
  // Prefer a local installation of @ui5/cli.
@@ -57,14 +57,26 @@ if (
57
57
  }
58
58
  }
59
59
 
60
- const updateNotifier = require("update-notifier");
61
- updateNotifier({
62
- pkg,
63
- updateCheckInterval: 1000 * 60 * 60 * 24, // 1 day
64
- shouldNotifyInNpmScript: true
65
- }).notify();
66
- // Remove --no-update-notifier from argv as it's not known to yargs, but we still want to support using it
60
+ // Only import update-notifier when it's not disabled
61
+ // See https://github.com/yeoman/update-notifier/blob/3046d0f61a57f8270291b6ab271f8a12df8421a6/update-notifier.js#L57-L60
62
+ // The "is-ci" check is not executed, but will be checked by update-notifier itself then
67
63
  const NO_UPDATE_NOTIFIER = "--no-update-notifier";
64
+ const disableUpdateNotifier =
65
+ "NO_UPDATE_NOTIFIER" in process.env ||
66
+ process.env.NODE_ENV === "test" ||
67
+ process.argv.includes(NO_UPDATE_NOTIFIER);
68
+
69
+ // Update notifier requires dynamic imports (ES Module) and therefore is loaded via a separate file
70
+ if (
71
+ !disableUpdateNotifier &&
72
+
73
+ // Node.js versions supporting ES modules
74
+ semver.satisfies(nodeVersion, "^12.20 || ^14.14 || >= 16.0", {includePrerelease: true})
75
+ ) {
76
+ const updateNotifier = require("../lib/cli/update-notifier");
77
+ await updateNotifier({pkg});
78
+ }
79
+ // Remove --no-update-notifier from argv as it's not known to yargs, but we still want to support using it
68
80
  if (process.argv.includes(NO_UPDATE_NOTIFIER)) {
69
81
  process.argv = process.argv.filter((v) => v !== NO_UPDATE_NOTIFIER);
70
82
  }
@@ -0,0 +1,12 @@
1
+ // update-notifier is an ES module and therefore needs to be loaded via "import".
2
+ // It is important to have this code in a separate file as this module also
3
+ // supports Node.js versions without dynamic import support (e.g. v10).
4
+ // Otherwise it will lead to syntax errors.
5
+ module.exports = async function({pkg}) {
6
+ const updateNotifier = (await import("update-notifier")).default;
7
+ updateNotifier({
8
+ pkg,
9
+ updateCheckInterval: 1000 * 60 * 60 * 24, // 1 day
10
+ shouldNotifyInNpmScript: true
11
+ }).notify();
12
+ };