@automattic/vip 3.20.2 → 3.20.4

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/dist/bin/vip.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
 
4
+ require("../lib/node-version-check");
4
5
  var _chalk = _interopRequireDefault(require("chalk"));
5
6
  var _debug = _interopRequireDefault(require("debug"));
6
7
  var _enquirer = require("enquirer");
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _nodeFs = require("node:fs");
4
+ var _nodePath = require("node:path");
5
+ var _semver = require("semver");
6
+ const boldRed = process.stdout.isTTY ? '\x1b[1;31m' : '';
7
+ const reset = process.stdout.isTTY ? '\x1b[0m' : '';
8
+ try {
9
+ const json = (0, _nodeFs.readFileSync)((0, _nodePath.join)(__dirname, '..', '..', 'package.json'), 'utf8');
10
+ const {
11
+ name,
12
+ engines
13
+ } = JSON.parse(json);
14
+ const version = engines.node;
15
+ if (version && !(0, _semver.satisfies)(process.version, version)) {
16
+ console.warn(`${boldRed}WARNING: The current version of Node (${process.version}) does not meet the minimum requirements; ` + `${name} requires Node version ${version}.\n\n` + `Please follow the installation instructions at https://nodejs.org/en/download/ to upgrade.${reset}\n`);
17
+ }
18
+ } catch {
19
+ // Do nothing
20
+ }