@involvex/syncstuff-cli 0.0.3 → 0.0.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/cli.js CHANGED
@@ -9641,7 +9641,7 @@ function createTable(data, headers) {
9641
9641
  });
9642
9642
  }
9643
9643
  function printHeader() {
9644
- const packagePath = join(__dirname, "../../../../package.json");
9644
+ const packagePath = join(__dirname, "../../package.json");
9645
9645
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
9646
9646
  const version = packageJson.version;
9647
9647
  const header = source_default.cyan.bold(`
@@ -31460,6 +31460,14 @@ var init_transfer = __esm(() => {
31460
31460
  init_ui();
31461
31461
  });
31462
31462
 
31463
+ // src/core.ts
31464
+ var DebugMode;
31465
+ var init_core = __esm(() => {
31466
+ DebugMode = {
31467
+ enabled: false
31468
+ };
31469
+ });
31470
+
31463
31471
  // src/cli/commands/version.ts
31464
31472
  var exports_version = {};
31465
31473
  __export(exports_version, {
@@ -31474,6 +31482,11 @@ function showversion() {
31474
31482
  const packagePath = join3(__dirname2, "../../../package.json");
31475
31483
  const packageJson = JSON.parse(readFileSync4(packagePath, "utf-8"));
31476
31484
  const version = packageJson.version;
31485
+ if (DebugMode.enabled === true) {
31486
+ console.log(source_default.yellow("Debug mode enabled"));
31487
+ console.log("Package path: " + packagePath);
31488
+ console.log("Version: " + version);
31489
+ }
31477
31490
  const versionBox = createBox(source_default.cyan.bold(`Syncstuff CLI
31478
31491
 
31479
31492
  `) + source_default.bold("Version:") + ` ${source_default.green(version)}
@@ -31484,12 +31497,19 @@ function showversion() {
31484
31497
  console.log(versionBox);
31485
31498
  printSeparator();
31486
31499
  } catch {
31500
+ if (DebugMode.enabled === true) {
31501
+ const packagePath = join3(__dirname2, "../../../package.json");
31502
+ console.log(source_default.yellow("Debug mode enabled"));
31503
+ console.log("Packagepath: " + packagePath);
31504
+ console.log(source_default.yellow("Version: 0.0.1 (unable to read package.json)"));
31505
+ }
31487
31506
  console.log(source_default.yellow("Version: 0.0.1 (unable to read package.json)"));
31488
31507
  }
31489
31508
  }
31490
31509
  var __filename2, __dirname2;
31491
31510
  var init_version = __esm(() => {
31492
31511
  init_source();
31512
+ init_core();
31493
31513
  init_ui();
31494
31514
  __filename2 = fileURLToPath(import.meta.url);
31495
31515
  __dirname2 = dirname(__filename2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@involvex/syncstuff-cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "homepage": "https://syncstuff-web.involvex.workers.dev/",
6
6
  "sponsor": {
@@ -1,7 +1,7 @@
1
- import type { DebugMode } from "../../core";
1
+ import { DebugMode } from "../../core";
2
2
 
3
- export const showDebug = (debugMode: DebugMode) => {
4
- if (!debugMode.enabled) {
3
+ export const showDebug = () => {
4
+ if (!DebugMode.enabled) {
5
5
  return;
6
6
  } else {
7
7
  console.log("Debug mode enabled");
@@ -2,6 +2,7 @@ import chalk from "chalk";
2
2
  import { readFileSync } from "fs";
3
3
  import { dirname, join } from "path";
4
4
  import { fileURLToPath } from "url";
5
+ import { DebugMode } from "../../core.js";
5
6
  import { createBox, printHeader, printSeparator } from "../../utils/ui.js";
6
7
 
7
8
  const __filename = fileURLToPath(import.meta.url);
@@ -15,6 +16,12 @@ export function showversion() {
15
16
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
16
17
  const version = packageJson.version;
17
18
 
19
+ if (DebugMode.enabled === true) {
20
+ console.log(chalk.yellow("Debug mode enabled"));
21
+ console.log("Package path: " + packagePath);
22
+ console.log("Version: " + version);
23
+ }
24
+
18
25
  const versionBox = createBox(
19
26
  chalk.cyan.bold("Syncstuff CLI\n\n") +
20
27
  chalk.bold("Version:") +
@@ -30,6 +37,12 @@ export function showversion() {
30
37
  console.log(versionBox);
31
38
  printSeparator();
32
39
  } catch {
40
+ if (DebugMode.enabled === true) {
41
+ const packagePath = join(__dirname, "../../../package.json");
42
+ console.log(chalk.yellow("Debug mode enabled"));
43
+ console.log("Packagepath: " + packagePath);
44
+ console.log(chalk.yellow("Version: 0.0.1 (unable to read package.json)"));
45
+ }
33
46
  console.log(chalk.yellow("Version: 0.0.1 (unable to read package.json)"));
34
47
  }
35
48
  }
package/src/core.ts CHANGED
@@ -8,6 +8,6 @@ export interface Device {
8
8
  is_online: boolean;
9
9
  }
10
10
 
11
- export type DebugMode = {
12
- enabled: boolean;
11
+ export const DebugMode = {
12
+ enabled: false,
13
13
  };
package/src/utils/ui.ts CHANGED
@@ -71,7 +71,7 @@ export function animateText(text: string, delay: number = 50): Promise<void> {
71
71
  }
72
72
 
73
73
  export function printHeader(): void {
74
- const packagePath = join(__dirname, "../../../../package.json");
74
+ const packagePath = join(__dirname, "../../package.json");
75
75
  const packageJson = JSON.parse(readFileSync(packagePath, "utf-8"));
76
76
  const version = packageJson.version;
77
77
  const header = chalk.cyan.bold(`