conductor-node 11.6.0 → 11.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.6.0",
3
+ "version": "11.6.1",
4
4
  "description": "QuickBooks Desktop API for Node.js and TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks",
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createFramedMessage = exports.checkForUpdates = void 0;
7
7
  const package_json_1 = __importDefault(require("../../package.json"));
8
8
  const env_1 = require("../utils/env");
9
- const node_child_process_1 = __importDefault(require("node:child_process"));
9
+ const axios_1 = __importDefault(require("axios"));
10
10
  function checkForUpdates() {
11
11
  if (process.env.NODE_ENV === "test") {
12
12
  return;
@@ -16,32 +16,27 @@ function checkForUpdates() {
16
16
  if ((0, env_1.isEnvironmentVariableTruthy)("CONDUCTOR_HIDE_UPDATE_MESSAGE")) {
17
17
  return;
18
18
  }
19
- // Exit early if `npm` is not installed.
20
- try {
21
- node_child_process_1.default.execSync("npm --version", {
22
- // Prevent the shell from internally logging the error message.
23
- stdio: "ignore",
24
- });
25
- }
26
- catch {
27
- return;
28
- }
29
19
  const currentVersion = package_json_1.default.version;
30
- const latestVersion = node_child_process_1.default
31
- .execSync(`npm view ${package_json_1.default.name} version --silent`)
32
- .toString()
33
- .trim();
34
- if (currentVersion !== latestVersion) {
35
- const updateCommand = process.env["npm_execpath"]?.includes("yarn") === true
36
- ? "yarn add"
37
- : "npm install";
38
- console.warn(createFramedMessage([
39
- `🟡 Update available for Conductor! ${currentVersion} -> ${latestVersion}`,
40
- "",
41
- "Run the following to update:",
42
- ` ${updateCommand} ${package_json_1.default.name}@latest`,
43
- ]));
44
- }
20
+ const packageName = encodeURIComponent(package_json_1.default.name);
21
+ axios_1.default
22
+ .get(`https://registry.npmjs.org/-/package/${packageName}/dist-tags`)
23
+ .then((response) => {
24
+ const latestVersion = response.data.latest;
25
+ if (currentVersion !== latestVersion) {
26
+ const updateCommand = process.env["npm_execpath"]?.includes("yarn") === true
27
+ ? "yarn add"
28
+ : "npm install";
29
+ console.warn(createFramedMessage([
30
+ `🟡 Update available for Conductor! ${currentVersion} -> ${latestVersion}`,
31
+ "",
32
+ "Run the following to update:",
33
+ ` ${updateCommand} ${packageName}@latest`,
34
+ ]));
35
+ }
36
+ })
37
+ .catch((error) => {
38
+ console.debug("Failed to check for updates:", error);
39
+ });
45
40
  }
46
41
  exports.checkForUpdates = checkForUpdates;
47
42
  function createFramedMessage(messageLines) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "11.6.0",
3
+ "version": "11.6.1",
4
4
  "description": "QuickBooks Desktop API for Node.js and TypeScript",
5
5
  "keywords": [
6
6
  "QuickBooks",