@nikero/updep 0.1.0 → 0.1.7
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/bin/updep.js +5 -4
- package/install.js +18 -28
- package/package.json +14 -10
- package/README.md +0 -76
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
|
|
8
|
-
|
|
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",
|
|
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
|
|
11
|
-
x64: "@updep
|
|
9
|
+
arm64: "@nikero/updep-darwin-arm64",
|
|
10
|
+
x64: "@nikero/updep-darwin-x64",
|
|
12
11
|
},
|
|
13
12
|
linux: {
|
|
14
|
-
arm64: "@updep
|
|
15
|
-
x64: "@updep
|
|
13
|
+
arm64: "@nikero/updep-linux-arm64",
|
|
14
|
+
x64: "@nikero/updep-linux-x64",
|
|
16
15
|
},
|
|
17
16
|
win32: {
|
|
18
|
-
arm64: "@updep
|
|
19
|
-
x64: "@updep
|
|
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
|
-
|
|
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
|
|
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: ${
|
|
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][
|
|
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" ? "
|
|
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(
|
|
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(
|
|
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.
|
|
3
|
+
"version": "0.1.7",
|
|
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:
|
|
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
|
|
27
|
-
"@updep
|
|
28
|
-
"@updep
|
|
29
|
-
"@updep
|
|
30
|
-
"@updep
|
|
31
|
-
"@updep
|
|
30
|
+
"@nikero/updep-darwin-arm64": "0.1.7",
|
|
31
|
+
"@nikero/updep-darwin-x64": "0.1.7",
|
|
32
|
+
"@nikero/updep-linux-arm64": "0.1.7",
|
|
33
|
+
"@nikero/updep-linux-x64": "0.1.7",
|
|
34
|
+
"@nikero/updep-win32-arm64": "0.1.7",
|
|
35
|
+
"@nikero/updep-win32-x64": "0.1.7"
|
|
32
36
|
},
|
|
33
37
|
"engines": {
|
|
34
|
-
"node": ">=
|
|
38
|
+
"node": ">=18"
|
|
35
39
|
},
|
|
36
40
|
"files": [
|
|
37
41
|
"bin",
|
package/README.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# updep
|
|
2
|
-
|
|
3
|
-
Interactive TUI for updating JavaScript dependencies. Works with npm, yarn, pnpm, and bun.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
### Using npx (no installation needed)
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npx updep
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
### Using other package managers
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# Bun
|
|
17
|
-
bunx updep
|
|
18
|
-
|
|
19
|
-
# Yarn
|
|
20
|
-
yarn dlx updep
|
|
21
|
-
|
|
22
|
-
# pnpm
|
|
23
|
-
pnpm dlx updep
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Install globally
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm install -g updep
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Then run from any project:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
updep
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Usage
|
|
39
|
-
|
|
40
|
-
Navigate to your JavaScript project directory and run:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npx updep
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Keybindings
|
|
47
|
-
|
|
48
|
-
- `↑/↓` or `j/k` - Navigate between packages
|
|
49
|
-
- `Space` - Toggle package selection
|
|
50
|
-
- `w` - Select wanted version
|
|
51
|
-
- `l` - Select latest version
|
|
52
|
-
- `q` or `Ctrl+C` - Quit
|
|
53
|
-
|
|
54
|
-
## Platform Support
|
|
55
|
-
|
|
56
|
-
updep provides pre-built binaries for:
|
|
57
|
-
|
|
58
|
-
- macOS (Apple Silicon & Intel)
|
|
59
|
-
- Linux (ARM64 & x64)
|
|
60
|
-
- Windows (ARM64 & x64)
|
|
61
|
-
|
|
62
|
-
## Requirements
|
|
63
|
-
|
|
64
|
-
- Node.js 14 or higher
|
|
65
|
-
- npm, yarn, pnpm, or bun installed
|
|
66
|
-
- A JavaScript project with a `package.json` file
|
|
67
|
-
|
|
68
|
-
## License
|
|
69
|
-
|
|
70
|
-
MIT - see [LICENSE](https://github.com/snikoletopoulos/updep/blob/main/LICENSE)
|
|
71
|
-
|
|
72
|
-
## Links
|
|
73
|
-
|
|
74
|
-
- [GitHub Repository](https://github.com/snikoletopoulos/updep)
|
|
75
|
-
- [Report Issues](https://github.com/snikoletopoulos/updep/issues)
|
|
76
|
-
- [Discussions](https://github.com/snikoletopoulos/updep/discussions)
|