kampodra 0.0.0-stage → 0.7.0-beta.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/bin/kampodra.js +55 -0
- package/package.json +28 -4
- package/README.md +0 -3
package/bin/kampodra.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// kampodra bin shim (the esbuild-style platform-binary pattern): resolve
|
|
3
|
+
// this platform's native binary from the matching @talha7k/<platform>
|
|
4
|
+
// optionalDependency and hand it the argv verbatim. Clear, actionable error
|
|
5
|
+
// when the binary is missing — never a raw stack trace.
|
|
6
|
+
import { spawnSync } from "node:child_process";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
|
|
10
|
+
const SUPPORTED = new Set([
|
|
11
|
+
"darwin-arm64",
|
|
12
|
+
"darwin-x64",
|
|
13
|
+
"linux-arm64",
|
|
14
|
+
"linux-x64",
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const platform = `${process.platform}-${process.arch}`;
|
|
18
|
+
const require = createRequire(import.meta.url);
|
|
19
|
+
|
|
20
|
+
let bin;
|
|
21
|
+
try {
|
|
22
|
+
bin = require.resolve(`@talha7k/${platform}/bin/kampodra`);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(`kampodra: no native binary for ${platform}.`);
|
|
25
|
+
if (!SUPPORTED.has(platform)) {
|
|
26
|
+
console.error(
|
|
27
|
+
` ${platform} is not supported (supported: ${[...SUPPORTED].sort().join(", ")}).`,
|
|
28
|
+
);
|
|
29
|
+
} else {
|
|
30
|
+
console.error(
|
|
31
|
+
` The optionalDependency @talha7k/${platform} was not installed.`,
|
|
32
|
+
);
|
|
33
|
+
console.error(
|
|
34
|
+
` npm installs optional dependencies by default — check --omit=optional / "optional": false in your config, then reinstall.`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (process.env.KAMPODRA_DEBUG) {
|
|
38
|
+
console.error(` resolve error: ${err?.message ?? err}`);
|
|
39
|
+
}
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!existsSync(bin)) {
|
|
44
|
+
console.error(
|
|
45
|
+
`kampodra: @talha7k/${platform} is installed but ${bin} is missing — the package is broken, reinstall it.`,
|
|
46
|
+
);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
51
|
+
if (result.error) {
|
|
52
|
+
console.error(`kampodra: ${result.error.message}`);
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kampodra",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.7.0-beta.4",
|
|
4
|
+
"description": "Registry-free deployment CLI for single-VM container stacks over SSH (Podman + kamal-proxy)",
|
|
5
|
+
"license": "AGPL-3.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"kampodra": "bin/kampodra.js"
|
|
9
|
+
},
|
|
10
|
+
"optionalDependencies": {
|
|
11
|
+
"@talha7k/darwin-arm64": "0.7.0-beta.4",
|
|
12
|
+
"@talha7k/darwin-x64": "0.7.0-beta.4",
|
|
13
|
+
"@talha7k/linux-arm64": "0.7.0-beta.4",
|
|
14
|
+
"@talha7k/linux-x64": "0.7.0-beta.4"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"bin/"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/talha7k/kampodra.git"
|
|
25
|
+
},
|
|
26
|
+
"homepage": "https://github.com/talha7k/kampodra#readme",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/talha7k/kampodra/issues"
|
|
29
|
+
}
|
|
30
|
+
}
|
package/README.md
DELETED