@mauricioleon54/depclerk 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/bin/deppilot.js +71 -0
- package/package.json +37 -0
package/bin/deppilot.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
// This wrapper locates the platform-specific native binary installed
|
|
6
|
+
// as an optional dependency, then exec-spawns it with forwarded arguments.
|
|
7
|
+
// Pattern adapted from esbuild's npm distribution.
|
|
8
|
+
|
|
9
|
+
const path = require("path");
|
|
10
|
+
const childProcess = require("child_process");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
|
|
13
|
+
const PLATFORM_PACKAGES = {
|
|
14
|
+
"darwin-arm64": { pkg: "deppilot-darwin-arm64", bin: "deppilot" },
|
|
15
|
+
"darwin-x64": { pkg: "deppilot-darwin-x64", bin: "deppilot" },
|
|
16
|
+
"linux-arm64": { pkg: "deppilot-linux-arm64", bin: "deppilot" },
|
|
17
|
+
"linux-x64": { pkg: "deppilot-linux-x64", bin: "deppilot" },
|
|
18
|
+
"win32-x64": { pkg: "deppilot-windows-x64", bin: "deppilot.exe" },
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function resolveBinary() {
|
|
22
|
+
const key = `${process.platform}-${process.arch}`;
|
|
23
|
+
const entry = PLATFORM_PACKAGES[key];
|
|
24
|
+
|
|
25
|
+
if (!entry) {
|
|
26
|
+
throw new Error(
|
|
27
|
+
`DepPilot does not have a pre-built binary for ${key}.\n` +
|
|
28
|
+
`Supported platforms: ${Object.keys(PLATFORM_PACKAGES).join(", ")}.\n` +
|
|
29
|
+
`To build from source: cargo install deppilot`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 1. Try the optional dependency package (normal npm install path).
|
|
34
|
+
try {
|
|
35
|
+
return require.resolve(`${entry.pkg}/bin/${entry.bin}`);
|
|
36
|
+
} catch (_) {
|
|
37
|
+
// optional dependency not installed — fall through
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 2. Fall back to a binary placed next to this file (manual installs).
|
|
41
|
+
const local = path.join(__dirname, entry.bin);
|
|
42
|
+
if (fs.existsSync(local)) {
|
|
43
|
+
return local;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
throw new Error(
|
|
47
|
+
`DepPilot binary not found for ${key}.\n` +
|
|
48
|
+
`Expected optional dependency '${entry.pkg}' to be installed.\n` +
|
|
49
|
+
`Try reinstalling: npm install -g deppilot`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let binaryPath;
|
|
54
|
+
try {
|
|
55
|
+
binaryPath = resolveBinary();
|
|
56
|
+
} catch (err) {
|
|
57
|
+
process.stderr.write(`${err.message}\n`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const result = childProcess.spawnSync(binaryPath, process.argv.slice(2), {
|
|
62
|
+
stdio: "inherit",
|
|
63
|
+
windowsHide: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (result.error) {
|
|
67
|
+
process.stderr.write(`Failed to run DepPilot: ${result.error.message}\n`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
process.exitCode = result.status ?? 1;
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mauricioleon54/depclerk",
|
|
3
|
+
"version": "0.1.8",
|
|
4
|
+
"description": "Dependency update assistant for JavaScript/TypeScript projects",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/MauricioLeon54/DepPilot.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/MauricioLeon54/DepPilot",
|
|
11
|
+
"bugs": "https://github.com/MauricioLeon54/DepPilot/issues",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"dependencies",
|
|
14
|
+
"npm",
|
|
15
|
+
"yarn",
|
|
16
|
+
"pnpm",
|
|
17
|
+
"update",
|
|
18
|
+
"cli",
|
|
19
|
+
"dependency-management"
|
|
20
|
+
],
|
|
21
|
+
"bin": {
|
|
22
|
+
"depclerk": "./bin/deppilot.js"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/"
|
|
26
|
+
],
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=14"
|
|
29
|
+
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"deppilot-darwin-arm64": "0.1.8",
|
|
32
|
+
"deppilot-darwin-x64": "0.1.8",
|
|
33
|
+
"deppilot-linux-x64": "0.1.8",
|
|
34
|
+
"deppilot-linux-arm64": "0.1.8",
|
|
35
|
+
"deppilot-windows-x64": "0.1.8"
|
|
36
|
+
}
|
|
37
|
+
}
|