Skip to content

Commit b14d8f4

Browse files
committed
fix(npm): should behave like a binary
1 parent 227b9a7 commit b14d8f4

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
.npmrc
44
kubernetes-mcp-server
5+
kubernetes-mcp-server/README.md
56
kubernetes-mcp-server-darwin-amd64
67
!npm/kubernetes-mcp-server-darwin-amd64/
78
kubernetes-mcp-server-darwin-arm64

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ CLEAN_TARGETS :=
2727
CLEAN_TARGETS += '$(BINARY_NAME)'
2828
CLEAN_TARGETS += $(foreach os,$(OSES),$(foreach arch,$(ARCHS),$(BINARY_NAME)-$(os)-$(arch)$(if $(findstring windows,$(os)),.exe,)))
2929
CLEAN_TARGETS += $(foreach os,$(OSES),$(foreach arch,$(ARCHS),./npm/$(BINARY_NAME)-$(os)-$(arch)/bin/))
30-
CLEAN_TARGETS += ./npm/.npmrc
30+
CLEAN_TARGETS += ./npm/.npmrc ./npm/bin ./npm/README.md
3131
CLEAN_TARGETS += $(foreach os,$(OSES),$(foreach arch,$(ARCHS),./npm/$(BINARY_NAME)-$(os)-$(arch)/.npmrc))
3232

3333
# The help will print out all targets with their descriptions organized bellow their categories. The categories are represented by `##@` and the target descriptions by `##`.
@@ -76,6 +76,9 @@ npm-publish: npm ## Publish the npm packages
7676
npm publish; \
7777
cd ../..; \
7878
))
79+
cp README.md ./npm/README.md
80+
mkdir -p ./npm/bin
81+
cp ./npm/index.js ./npm/bin/cli
7982
echo '//registry.npmjs.org/:_authToken=$(NPM_TOKEN)' >> ./npm/.npmrc
8083
jq '.version = "$(NPM_VERSION)"' ./npm/package.json > tmp.json && mv tmp.json ./npm/package.json; \
8184
jq '.optionalDependencies |= with_entries(.value = "$(NPM_VERSION)")' ./npm/package.json > tmp.json && mv tmp.json ./npm/package.json; \

npm/bin/kubernetes-mcp-server.js renamed to npm/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env node
2+
13
const childProcess = require("child_process");
24

35
const BINARY_MAP = {

npm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"name": "kubernetes-mcp-server",
33
"version": "0.0.0",
44
"description": "Model Context Protocol (MCP) server for Kubernetes and OpenShift",
5-
"main": "bin/kubernetes-mcp-server.js",
5+
"main": "./index.js",
66
"bin": {
7-
"kubernetes-mcp-server": "bin/kubernetes-mcp-server.js"
7+
"kubernetes-mcp-server": "bin/cli"
88
},
99
"optionalDependencies": {
1010
"kubernetes-mcp-server-darwin-amd64": "0.0.0",

0 commit comments

Comments
 (0)