1+ #! /bin/bash
2+
3+ # Script to prepare packages for public npm with appropriate naming
4+ # Usage: ./prepare-fork-npm.sh VERSION_SUFFIX
5+
6+ set -e
7+
8+ if [ -z " $1 " ]; then
9+ echo " Usage: $0 VERSION_SUFFIX"
10+ echo " Example: $0 openshift-ai"
11+ echo " Example: $0 macayaven-fork"
12+ exit 1
13+ fi
14+
15+ VERSION_SUFFIX=" $1 "
16+ REPO_NAME=" openshift-mcp-server"
17+
18+ echo " Preparing npm packages for public npm registry with suffix: $VERSION_SUFFIX "
19+ echo " "
20+
21+ # First, let's manually set the correct optionalDependencies
22+ echo " Setting up main package..."
23+ cat > npm/kubernetes-mcp-server/package.json << EOF
24+ {
25+ "name": "kubernetes-mcp-server-$VERSION_SUFFIX ",
26+ "version": "0.0.53-127-gee20cd9",
27+ "description": "Model Context Protocol (MCP) server for Kubernetes and OpenShift (fork with OpenShift AI support)",
28+ "main": "./bin/index.js",
29+ "bin": {
30+ "kubernetes-mcp-server": "bin/index.js"
31+ },
32+ "optionalDependencies": {
33+ "kubernetes-mcp-server-$VERSION_SUFFIX -darwin-amd64": "0.0.53-127-gee20cd9",
34+ "kubernetes-mcp-server-$VERSION_SUFFIX -darwin-arm64": "0.0.53-127-gee20cd9",
35+ "kubernetes-mcp-server-$VERSION_SUFFIX -linux-amd64": "0.0.53-127-gee20cd9",
36+ "kubernetes-mcp-server-$VERSION_SUFFIX -linux-arm64": "0.0.53-127-gee20cd9",
37+ "kubernetes-mcp-server-$VERSION_SUFFIX -windows-amd64": "0.0.53-127-gee20cd9",
38+ "kubernetes-mcp-server-$VERSION_SUFFIX -windows-arm64": "0.0.53-127-gee20cd9"
39+ },
40+ "repository": {
41+ "type": "git",
42+ "url": "git+https://github.com/macayaven/$REPO_NAME .git"
43+ },
44+ "keywords": [
45+ "mcp",
46+ "kubernetes",
47+ "openshift",
48+ "model context protocol",
49+ "model",
50+ "context",
51+ "protocol"
52+ ],
53+ "author": {
54+ "name": "Marc Nuri (Original), macayaven (OpenShift AI fork)",
55+ "url": "https://www.marcnuri.com"
56+ },
57+ "license": "Apache-2.0",
58+ "bugs": {
59+ "url": "https://github.com/macayaven/$REPO_NAME .git/issues"
60+ },
61+ "homepage": "https://github.com/macayaven/$REPO_NAME #readme"
62+ }
63+ EOF
64+
65+ # Update platform packages
66+ platforms=(" darwin-amd64" " darwin-arm64" " linux-amd64" " linux-arm64" " windows-amd64" " windows-arm64" )
67+
68+ for platform in " ${platforms[@]} " ; do
69+ package_name=" kubernetes-mcp-server-$platform "
70+ fork_name=" kubernetes-mcp-server-$VERSION_SUFFIX -$platform "
71+ package_file=" npm/$package_name /package.json"
72+
73+ echo " Updating $package_file ..."
74+
75+ cat > " $package_file " << EOF
76+ {
77+ "name": "$fork_name ",
78+ "version": "0.0.53-127-gee20cd9",
79+ "description": "Model Context Protocol (MCP) server for Kubernetes and OpenShift (fork with OpenShift AI support)",
80+ "repository": {
81+ "type": "git",
82+ "url": "git+https://github.com/macayaven/$REPO_NAME .git"
83+ },
84+ "os": [
85+ "$( echo $platform | cut -d' -' -f1) "
86+ ],
87+ "cpu": [
88+ "$( echo $platform | cut -d' -' -f2) "
89+ ],
90+ "bugs": {
91+ "url": "https://github.com/macayaven/$REPO_NAME .git/issues"
92+ },
93+ "homepage": "https://github.com/macayaven/$REPO_NAME #readme"
94+ }
95+ EOF
96+
97+ echo " ✓ Updated $package_file as $fork_name "
98+ done
99+
100+ echo " "
101+ echo " ✅ All packages prepared for public npm registry!"
102+ echo " "
103+ echo " Next steps:"
104+ echo " 1. Login to npm: npm login"
105+ echo " 2. Publish: make npm-publish"
106+ echo " "
107+ echo " Packages will be published as:"
108+ echo " - kubernetes-mcp-server-$VERSION_SUFFIX "
109+ echo " - kubernetes-mcp-server-$VERSION_SUFFIX -darwin-amd64"
110+ echo " - kubernetes-mcp-server-$VERSION_SUFFIX -darwin-arm64"
111+ echo " - etc."
112+ echo " "
113+ echo " Users can install with: npm install kubernetes-mcp-server-$VERSION_SUFFIX "
114+ echo " "
115+ echo " This naming clearly indicates it's a fork while giving credit to the original project."
0 commit comments