@nikero/updep 0.1.0 → 0.1.8

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/README.md CHANGED
Binary file
package/bin/updep.js CHANGED
@@ -4,10 +4,11 @@ const { spawn } = require("child_process");
4
4
  const path = require("path");
5
5
  const os = require("os");
6
6
 
7
- const binName = os.platform() === "win32" ? "updep.exe" : "updep";
8
- const binaryPath = path.join(__dirname, binName);
7
+ const binaryPath = path.join(
8
+ __dirname,
9
+ `updep${os.platform() === "win32" ? ".exe" : ""}`
10
+ );
9
11
 
10
- // Spawn the binary with all arguments
11
12
  const child = spawn(binaryPath, process.argv.slice(2), {
12
13
  stdio: "inherit",
13
14
  windowsHide: true,
@@ -21,7 +22,7 @@ child.on("exit", (code, signal) => {
21
22
  }
22
23
  });
23
24
 
24
- child.on("error", (err) => {
25
+ child.on("error", err => {
25
26
  console.error(`Failed to start updep: ${err.message}`);
26
27
  process.exit(1);
27
28
  });
package/install.js CHANGED
@@ -4,19 +4,18 @@ const fs = require("fs");
4
4
  const path = require("path");
5
5
  const os = require("os");
6
6
 
7
- // Platform mapping
8
7
  const PLATFORM_MAP = {
9
8
  darwin: {
10
- arm64: "@updep/darwin-arm64",
11
- x64: "@updep/darwin-x64",
9
+ arm64: "@nikero/updep-darwin-arm64",
10
+ x64: "@nikero/updep-darwin-x64",
12
11
  },
13
12
  linux: {
14
- arm64: "@updep/linux-arm64",
15
- x64: "@updep/linux-x64",
13
+ arm64: "@nikero/updep-linux-arm64",
14
+ x64: "@nikero/updep-linux-x64",
16
15
  },
17
16
  win32: {
18
- arm64: "@updep/win32-arm64",
19
- x64: "@updep/win32-x64",
17
+ arm64: "@nikero/updep-win32-arm64",
18
+ x64: "@nikero/updep-win32-x64",
20
19
  },
21
20
  };
22
21
 
@@ -24,33 +23,28 @@ function getPlatformPackage() {
24
23
  const platform = os.platform();
25
24
  const arch = os.arch();
26
25
 
27
- // Handle architecture aliases
28
- const normalizedArch = arch === "aarch64" ? "arm64" : arch;
29
-
30
- if (!PLATFORM_MAP[platform]) {
26
+ if (!(platform in PLATFORM_MAP)) {
31
27
  throw new Error(
32
- `Unsupported platform: ${platform}. updep supports darwin, linux, and win32.`
28
+ `Unsupported platform: ${platform}. updep supports ${Object.keys(PLATFORM_MAP).join(", ")}.`
33
29
  );
34
30
  }
35
-
36
- if (!PLATFORM_MAP[platform][normalizedArch]) {
31
+ if (!PLATFORM_MAP[platform][arch]) {
37
32
  throw new Error(
38
- `Unsupported architecture: ${normalizedArch} on ${platform}. updep supports x64 and arm64.`
33
+ `Unsupported architecture: ${arch} on ${platform}. updep supports ${Object.keys(PLATFORM_MAP[platform]).join(", ")}.`
39
34
  );
40
35
  }
41
36
 
42
- return PLATFORM_MAP[platform][normalizedArch];
37
+ return PLATFORM_MAP[platform][arch];
43
38
  }
44
39
 
45
40
  function install() {
46
41
  try {
47
42
  const packageName = getPlatformPackage();
48
- const binName = os.platform() === "win32" ? "updep.exe" : "updep";
49
-
50
- // Try to find the platform-specific package
43
+ const binName = `updep${os.platform() === "win32" ? ".exe" : ""}`;
44
+
51
45
  let binaryPath;
52
46
  try {
53
- binaryPath = require.resolve(`${packageName}/${binName}`);
47
+ binaryPath = require.resolve(`${packageName}/bin/${binName}`);
54
48
  } catch (e) {
55
49
  console.warn(
56
50
  `Warning: Could not find platform-specific package ${packageName}.`
@@ -61,18 +55,14 @@ function install() {
61
55
  return;
62
56
  }
63
57
 
64
- // Create bin directory
65
- const binDir = path.join(__dirname, "bin");
66
- if (!fs.existsSync(binDir)) {
67
- fs.mkdirSync(binDir, { recursive: true });
68
- }
69
-
70
58
  // Copy binary to bin directory
71
- const targetPath = path.join(binDir, binName);
59
+ const targetPath = path.join(__dirname, "bin", binName);
72
60
  fs.copyFileSync(binaryPath, targetPath);
73
61
  fs.chmodSync(targetPath, 0o755);
74
62
 
75
- console.log(`✓ updep installed successfully for ${os.platform()}-${os.arch()}`);
63
+ console.log(
64
+ `✓ updep installed successfully for ${os.platform()}-${os.arch()}`
65
+ );
76
66
  } catch (error) {
77
67
  console.error("Error installing updep:", error.message);
78
68
  process.exit(1);
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@nikero/updep",
3
- "version": "0.1.0",
3
+ "version": "0.1.8",
4
4
  "description": "Interactive TUI for updating JavaScript dependencies",
5
- "author": "Stavros Nikolopoulos",
5
+ "author": "Stavros Nikolopoulos <snikoletopoulos@hotmail.com>",
6
6
  "license": "MIT",
7
- "repository": "github:snikoletopoulos/updep",
7
+ "repository": "github:nikero41/updep",
8
+ "bugs": "https://github.com/nikero41/updep/issues",
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
8
12
  "keywords": [
9
13
  "npm",
10
14
  "yarn",
@@ -23,15 +27,15 @@
23
27
  "postinstall": "node install.js"
24
28
  },
25
29
  "optionalDependencies": {
26
- "@updep/darwin-arm64": "0.1.0",
27
- "@updep/darwin-x64": "0.1.0",
28
- "@updep/linux-arm64": "0.1.0",
29
- "@updep/linux-x64": "0.1.0",
30
- "@updep/win32-arm64": "0.1.0",
31
- "@updep/win32-x64": "0.1.0"
30
+ "@nikero/updep-darwin-arm64": "0.1.8",
31
+ "@nikero/updep-darwin-x64": "0.1.8",
32
+ "@nikero/updep-linux-arm64": "0.1.8",
33
+ "@nikero/updep-linux-x64": "0.1.8",
34
+ "@nikero/updep-win32-arm64": "0.1.8",
35
+ "@nikero/updep-win32-x64": "0.1.8"
32
36
  },
33
37
  "engines": {
34
- "node": ">=14"
38
+ "node": ">=18"
35
39
  },
36
40
  "files": [
37
41
  "bin",