@flowscripter/dynamic-cli-framework 5.3.0 → 5.3.2
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultUpgradeService.d.ts","sourceRoot":"","sources":["../../../../src/service/upgrade/DefaultUpgradeService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,cAAc,EACpB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultUpgradeService.d.ts","sourceRoot":"","sources":["../../../../src/service/upgrade/DefaultUpgradeService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EAEZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,KAAK,cAAc,EACpB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAS1E,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAkB5C,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,cAAc;;gBAO/C,MAAM,EAAE,sBAAsB,EAAE,SAAS,EAAE,SAAS;IAKhE,eAAe,CACpB,YAAY,EAAE,YAAY,GAAG,SAAS,EACtC,YAAY,EAAE,YAAY,GAAG,SAAS,GACrC,IAAI;IAKA,qBAAqB,CAAC,aAAa,UAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA4BzE,QAAQ,IAAI,WAAW,GAAG,SAAS;IAanC,UAAU,IAAI,aAAa,GAAG,SAAS;IAWjC,mBAAmB,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;IAgBxE,eAAe,CAC1B,UAAU,CAAC,EAAE,WAAW,EACxB,YAAY,CAAC,EAAE,aAAa,EAC5B,qBAAqB,CAAC,EAAE,aAAa,GACpC,OAAO,CAAC,kBAAkB,CAAC;IAwCjB,OAAO,CAClB,UAAU,CAAC,EAAE,WAAW,EACxB,YAAY,CAAC,EAAE,aAAa,EAC5B,qBAAqB,CAAC,EAAE,aAAa,GACpC,OAAO,CAAC,aAAa,CAAC;CAsU1B"}
|
|
@@ -4,6 +4,8 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { InstallMethod, SupportedArch, SupportedOs, } from "@flowscripter/dynamic-cli-framework-api";
|
|
6
6
|
import semver from "semver";
|
|
7
|
+
import getLogger from "../../util/logger.js";
|
|
8
|
+
const logger = getLogger("DefaultUpgradeService");
|
|
7
9
|
// checkForUpgrade() runs opportunistically on every CLI invocation (via BannerServiceProvider),
|
|
8
10
|
// so that opportunistic call is raced against this timeout so it never stalls CLI startup.
|
|
9
11
|
// A deliberate caller (waitForResult=true, e.g. the `upgrade` command) awaits checkForUpgrade()
|
|
@@ -35,6 +37,7 @@ export default class DefaultUpgradeService {
|
|
|
35
37
|
}
|
|
36
38
|
getUpgradeCheckResult(waitForResult = false) {
|
|
37
39
|
if (!this.#upgradeCheckPromise) {
|
|
40
|
+
logger.debug(() => "Starting upgrade check");
|
|
38
41
|
// Only cache a non-"failed" result. A "failed" result can come from a transient issue
|
|
39
42
|
// (e.g. a network blip, or the opportunistic startup check racing past
|
|
40
43
|
// VERSION_CHECK_TIMEOUT_MS before checkForUpgrade() itself resolves) - caching that would
|
|
@@ -42,6 +45,7 @@ export default class DefaultUpgradeService {
|
|
|
42
45
|
// waiting via waitForResult=true) any chance of a fresh attempt for the rest of this
|
|
43
46
|
// process's lifetime.
|
|
44
47
|
this.#upgradeCheckPromise = this.checkForUpgrade().then((result) => {
|
|
48
|
+
logger.debug(() => `Upgrade check result: ${JSON.stringify(result)}`);
|
|
45
49
|
if (result.status === "failed") {
|
|
46
50
|
this.#upgradeCheckPromise = undefined;
|
|
47
51
|
}
|
package/package.json
CHANGED
|
@@ -18,6 +18,9 @@ import {
|
|
|
18
18
|
} from "@flowscripter/dynamic-cli-framework-api";
|
|
19
19
|
import semver from "semver";
|
|
20
20
|
import type { UpgradeLocationsConfig } from "./UpgradeLocationsConfig.ts";
|
|
21
|
+
import getLogger from "../../util/logger.ts";
|
|
22
|
+
|
|
23
|
+
const logger = getLogger("DefaultUpgradeService");
|
|
21
24
|
|
|
22
25
|
// checkForUpgrade() runs opportunistically on every CLI invocation (via BannerServiceProvider),
|
|
23
26
|
// so that opportunistic call is raced against this timeout so it never stalls CLI startup.
|
|
@@ -63,6 +66,7 @@ export default class DefaultUpgradeService implements UpgradeService {
|
|
|
63
66
|
|
|
64
67
|
public getUpgradeCheckResult(waitForResult = false): Promise<UpgradeCheckResult> {
|
|
65
68
|
if (!this.#upgradeCheckPromise) {
|
|
69
|
+
logger.debug(() => "Starting upgrade check");
|
|
66
70
|
// Only cache a non-"failed" result. A "failed" result can come from a transient issue
|
|
67
71
|
// (e.g. a network blip, or the opportunistic startup check racing past
|
|
68
72
|
// VERSION_CHECK_TIMEOUT_MS before checkForUpgrade() itself resolves) - caching that would
|
|
@@ -70,6 +74,7 @@ export default class DefaultUpgradeService implements UpgradeService {
|
|
|
70
74
|
// waiting via waitForResult=true) any chance of a fresh attempt for the rest of this
|
|
71
75
|
// process's lifetime.
|
|
72
76
|
this.#upgradeCheckPromise = this.checkForUpgrade().then((result) => {
|
|
77
|
+
logger.debug(() => `Upgrade check result: ${JSON.stringify(result)}`);
|
|
73
78
|
if (result.status === "failed") {
|
|
74
79
|
this.#upgradeCheckPromise = undefined;
|
|
75
80
|
}
|