@twilio/flex-dev-utils 6.4.2-alpha.202405230649 → 6.4.2-alpha.202405271234

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.
@@ -1,6 +1,6 @@
1
- import updateNotifier from 'update-notifier';
1
+ import updateNotifier, { NotifyOptions, Settings } from 'update-notifier';
2
2
  export default updateNotifier;
3
3
  /**
4
4
  * Checks for update for the package
5
5
  */
6
- export declare const checkForUpdate: (customMessage?: updateNotifier.NotifyOptions | undefined) => void;
6
+ export declare const checkForUpdate: (settings?: Partial<Settings>, customMessage?: Partial<NotifyOptions>) => Promise<void>;
@@ -1,20 +1,92 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (_) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
2
49
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
51
  };
5
52
  Object.defineProperty(exports, "__esModule", { value: true });
6
53
  exports.checkForUpdate = void 0;
7
54
  var update_notifier_1 = __importDefault(require("update-notifier"));
55
+ var npm_get_package_info_1 = __importDefault(require("npm-get-package-info"));
8
56
  var fs_1 = require("./fs");
57
+ var _1 = require(".");
9
58
  exports.default = update_notifier_1.default;
10
59
  /**
11
60
  * Checks for update for the package
12
61
  */
13
62
  /* c8 ignore next */
14
63
  // eslint-disable-next-line import/no-unused-modules
15
- var checkForUpdate = function (customMessage) {
16
- var pkg = module.parent ? fs_1.readPackageJson(fs_1.findUp(module.parent.filename, 'package.json')) : fs_1.readAppPackageJson();
17
- update_notifier_1.default({ pkg: pkg }).notify(customMessage);
64
+ var checkForUpdate = function (settings, customMessage) {
65
+ if (settings === void 0) { settings = {}; }
66
+ if (customMessage === void 0) { customMessage = {}; }
67
+ return __awaiter(void 0, void 0, void 0, function () {
68
+ var pkg, pkgInfo, notifier, message;
69
+ var _a, _b;
70
+ return __generator(this, function (_c) {
71
+ switch (_c.label) {
72
+ case 0:
73
+ pkg = module.parent ? fs_1.readPackageJson(fs_1.findUp(module.parent.filename, 'package.json')) : fs_1.readAppPackageJson();
74
+ return [4 /*yield*/, npm_get_package_info_1.default({
75
+ name: pkg.name,
76
+ version: pkg.version,
77
+ info: ['deprecated'],
78
+ })];
79
+ case 1:
80
+ pkgInfo = _c.sent();
81
+ notifier = update_notifier_1.default(__assign({ pkg: pkg, updateCheckInterval: 1000 }, settings));
82
+ message = (pkgInfo.deprecated
83
+ ? _1.chalk.bgYellow.bold('You are currently using a deprecated version of Flex Plugin CLI') + "\n\n"
84
+ : '') + "Update available " + _1.chalk.dim((_a = notifier.update) === null || _a === void 0 ? void 0 : _a.current) + _1.chalk.reset(' → ') + _1.chalk.green((_b = notifier.update) === null || _b === void 0 ? void 0 : _b.latest) + " \nRun " + _1.chalk.cyan('twilio plugins:install @twilio-labs/plugin-flex') + " to update";
85
+ notifier.notify(__assign({ message: message }, customMessage));
86
+ return [2 /*return*/];
87
+ }
88
+ });
89
+ });
18
90
  };
19
91
  exports.checkForUpdate = checkForUpdate;
20
92
  //# sourceMappingURL=updateNotifier.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateNotifier.js","sourceRoot":"","sources":["../src/updateNotifier.ts"],"names":[],"mappings":";;;;;;AAAA,oEAAgE;AAEhE,2BAAmE;AAEnE,kBAAe,yBAAc,CAAC;AAE9B;;GAEG;AACH,oBAAoB;AACpB,oDAAoD;AAC7C,IAAM,cAAc,GAAG,UAAC,aAA6B;IAC1D,IAAM,GAAG,GAAG,MAA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AAC,SAAM;wBACjG,CAAC,CAAC,EAAE,0BACY,QAAK,CAAC,GAAG,CAAC,MAAA,QAAQ,CAAC,MAAM,0CAAE,OAAO,CAAC,GAAG,QAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,QAAK,CAAC,KAAK,CACxF,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM,CACxB,eAAU,QAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,eAAY,CAAC;oBAErF,QAAQ,CAAC,MAAM,YAAG,OAAO,SAAA,IAAK,aAAa,EAAG,CAAC;;;;;CAChD,CAAC;AAtBW,QAAA,cAAc,kBAsBzB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twilio/flex-dev-utils",
3
- "version": "6.4.2-alpha.202405230649",
3
+ "version": "6.4.2-alpha.202405271234",
4
4
  "description": "Common development utility for creating a Flex plugin",
5
5
  "keywords": [
6
6
  "flex",
@@ -35,8 +35,8 @@
35
35
  "dependencies": {
36
36
  "@k88/pipe-compose": "^2.5.0",
37
37
  "@segment/analytics-node": "^1.3.0",
38
- "@twilio/flex-plugins-utils-env": "6.4.2-alpha.202405230649",
39
- "@twilio/flex-plugins-utils-exception": "6.4.2-alpha.202405230649",
38
+ "@twilio/flex-plugins-utils-env": "6.4.2-alpha.202405271234",
39
+ "@twilio/flex-plugins-utils-exception": "6.4.2-alpha.202405271234",
40
40
  "address": "^1.1.2",
41
41
  "adm-zip": "0.5.10",
42
42
  "app-module-path": "^2.2.0",
@@ -58,6 +58,7 @@
58
58
  "log-symbols": "^4.1.0",
59
59
  "mkdirp": "^1.0.4",
60
60
  "net": "^1.0.2",
61
+ "npm-get-package-info": "2.0.2",
61
62
  "open": "^8.2.1",
62
63
  "ora": "^5.4.1",
63
64
  "package-json": "^7.0.0",
@@ -96,5 +97,5 @@
96
97
  "publishConfig": {
97
98
  "access": "public"
98
99
  },
99
- "gitHead": "cae2c660be207a3e29cbf11bc363ec4d35381226"
100
+ "gitHead": "7ce8e8bfc1ef0f6bdd8bae4d8878192f24282657"
100
101
  }