mirror of
https://github.com/containers/kubernetes-mcp-server.git
synced 2025-10-23 01:22:57 +03:00
refactor(npm): final polishing for the npm distribution
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const path = require('path')
|
||||
const childProcess = require('child_process');
|
||||
|
||||
const BINARY_MAP = {
|
||||
@@ -12,14 +11,13 @@ const BINARY_MAP = {
|
||||
win32_arm64: {name: 'kubernetes-mcp-server-windows-arm64', suffix: '.exe'},
|
||||
};
|
||||
|
||||
const binary = BINARY_MAP[`${process.platform}_${process.arch}`];
|
||||
|
||||
// Resolving will fail if the optionalDependency was not installed or the platform/arch is not supported
|
||||
const resolveBinaryPath = () => {
|
||||
try {
|
||||
// Resolving will fail if the optionalDependency was not installed
|
||||
return require.resolve(`${binary.name}/bin/${binary.name}${binary.suffix}`)
|
||||
const binary = BINARY_MAP[`${process.platform}_${process.arch}`];
|
||||
return require.resolve(`${binary.name}/bin/${binary.name}${binary.suffix}`);
|
||||
} catch (e) {
|
||||
return path.join(__dirname, '..', `${binary.name}${binary.suffix}`)
|
||||
throw new Error(`Could not resolve binary path for platform/arch: ${process.platform}/${process.arch}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
24
npm/kubernetes-mcp-server/package-lock.json
generated
24
npm/kubernetes-mcp-server/package-lock.json
generated
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"name": "kubernetes-mcp-server",
|
||||
"version": "0.0.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "kubernetes-mcp-server",
|
||||
"version": "0.0.0",
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"kubernetes-mcp-server": "bin/kubernetes-mcp-server.js"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"kubernetes-mcp-server-darwin-amd64": "0.0.0",
|
||||
"kubernetes-mcp-server-darwin-arm64": "0.0.0",
|
||||
"kubernetes-mcp-server-linux-amd64": "0.0.0",
|
||||
"kubernetes-mcp-server-linux-arm64": "0.0.0",
|
||||
"kubernetes-mcp-server-win32-amd64": "0.0.0",
|
||||
"kubernetes-mcp-server-win32-arm64": "0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
"mcp",
|
||||
"kubernetes",
|
||||
"openshift",
|
||||
"model context protocol",
|
||||
"model",
|
||||
"context",
|
||||
"protocol"
|
||||
|
||||
Reference in New Issue
Block a user