@mablhq/mabl-cli 1.43.11 → 1.43.16

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/middleware.js ADDED
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ var _a;
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.CLI_MIDDLEWARE = void 0;
8
+ const chalk_1 = __importDefault(require("chalk"));
9
+ const os_1 = require("os");
10
+ const versionUtil_1 = require("./commands/commandUtil/versionUtil");
11
+ const logLineMessaging_1 = require("./core/messaging/logLineMessaging");
12
+ const messaging_1 = require("./core/messaging/messaging");
13
+ const loggingProvider_1 = require("./providers/logging/loggingProvider");
14
+ const analytics_1 = require("./util/analytics");
15
+ const pureUtil_1 = require("./util/pureUtil");
16
+ const updateNotifier = require('update-notifier');
17
+ const cliPackage = require('./package.json');
18
+ const UPDATE_CHECK_INTERVAL_MILLISECONDS = 24 * 60 * 60 * 1000;
19
+ const MIN_SUPPORTED_NODE_VERSION = (0, versionUtil_1.extractNodeVersionTuple)((_a = cliPackage === null || cliPackage === void 0 ? void 0 : cliPackage.engines) === null || _a === void 0 ? void 0 : _a.node);
20
+ const MIN_APPLE_SILICON_NODE_VERSION = (0, versionUtil_1.extractNodeVersionTuple)('16.0.0');
21
+ exports.CLI_MIDDLEWARE = [
22
+ () => {
23
+ (0, logLineMessaging_1.registerConsoleLoggerForOutput)(messaging_1.mablEventEmitter);
24
+ },
25
+ warnOnUnsupportedNodeVersion,
26
+ warnOnNonNativeAppleSiliconVersion,
27
+ async (argv) => (0, analytics_1.trackCliEvent)(argv._, (0, pureUtil_1.extractKeyCountsFromArgs)(argv)),
28
+ runUpdateCheck,
29
+ ];
30
+ function warnOnUnsupportedNodeVersion() {
31
+ const nodeVersion = (0, versionUtil_1.extractNodeVersionTuple)(process.version);
32
+ if ((0, versionUtil_1.compareNodeVersions)(nodeVersion, MIN_SUPPORTED_NODE_VERSION) < 0) {
33
+ loggingProvider_1.logger.info(chalk_1.default.bgYellow.black(`WARNING: Unsupported Node.js detected (`) +
34
+ chalk_1.default.bgYellow.bold.white((0, versionUtil_1.nodeVersionToString)(nodeVersion)) +
35
+ chalk_1.default.bgYellow.black(`). \nmabl-cli functionality may be limited, please update to `) +
36
+ chalk_1.default.bgYellow.bold.white((0, versionUtil_1.nodeVersionToString)(MIN_SUPPORTED_NODE_VERSION)) +
37
+ chalk_1.default.bgYellow.black(' or later.\n'));
38
+ }
39
+ }
40
+ function warnOnNonNativeAppleSiliconVersion() {
41
+ const nodeVersion = (0, versionUtil_1.extractNodeVersionTuple)(process.version);
42
+ const isRunningOnAppleSilicon = (0, os_1.cpus)().some((cpu) => { var _a; return (_a = cpu.model) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes('apple'); });
43
+ if (isRunningOnAppleSilicon &&
44
+ (0, versionUtil_1.compareNodeVersions)(nodeVersion, MIN_APPLE_SILICON_NODE_VERSION) < 0) {
45
+ loggingProvider_1.logger.info(`WARNING: Node.js version ${chalk_1.default.bold((0, versionUtil_1.nodeVersionToString)(nodeVersion))} does not provide native support for Apple silicon.\nFor improved mabl-cli performance, consider upgrading to ${chalk_1.default.bold((0, versionUtil_1.nodeVersionToString)(MIN_APPLE_SILICON_NODE_VERSION))} or later.\n`);
46
+ }
47
+ }
48
+ function runUpdateCheck() {
49
+ updateNotifier({
50
+ pkg: cliPackage,
51
+ updateCheckInterval: UPDATE_CHECK_INTERVAL_MILLISECONDS,
52
+ }).notify({
53
+ isGlobal: true,
54
+ boxenOptions: {
55
+ padding: 1,
56
+ margin: 0,
57
+ align: 'center',
58
+ borderColor: 'cyan',
59
+ borderStyle: 'round',
60
+ },
61
+ });
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mablhq/mabl-cli",
3
- "version": "1.43.11",
3
+ "version": "1.43.16",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "The official mabl command line interface tool",
6
6
  "main": "index.js",