build
This commit is contained in:
1
.env.example
Normal file
1
.env.example
Normal file
@@ -0,0 +1 @@
|
|||||||
|
NAMESPACE=
|
||||||
@@ -83,6 +83,5 @@ async function build() {
|
|||||||
|
|
||||||
execSync("git add -A", { stdio: 'inherit' })
|
execSync("git add -A", { stdio: 'inherit' })
|
||||||
execSync("git commit -m 'build'", { stdio: 'inherit' })
|
execSync("git commit -m 'build'", { stdio: 'inherit' })
|
||||||
execSync("cd src && npm version patch", { stdio: 'inherit' })
|
|
||||||
build()
|
build()
|
||||||
|
|
||||||
|
|||||||
27
bin/version_update.ts
Normal file
27
bin/version_update.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { execSync } from "node:child_process";
|
||||||
|
import fs from "node:fs";
|
||||||
|
const NAMESPACE = process.env.NAMESPACE
|
||||||
|
|
||||||
|
if (!NAMESPACE) {
|
||||||
|
throw new Error('NAMESPACE is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. Ambil versi remote dari npm
|
||||||
|
const remoteVersion = execSync(`npm view n8n-nodes-${NAMESPACE} version`)
|
||||||
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
console.log("🔍 Remote version:", remoteVersion);
|
||||||
|
|
||||||
|
// 2. Pecah versi → major.minor.patch
|
||||||
|
const [major, minor, patch] = remoteVersion.split(".").map(Number);
|
||||||
|
|
||||||
|
// 3. Generate versi baru: remote + 1 patch
|
||||||
|
const newLocalVersion = `${major}.${minor}.${patch + 1}`;
|
||||||
|
|
||||||
|
const pkgPath = "src/package.json";
|
||||||
|
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
|
||||||
|
|
||||||
|
pkg.version = newLocalVersion;
|
||||||
|
|
||||||
|
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2));
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "n8n-mcp-server",
|
"name": "n8n-mcp-server-hoock",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "bun bin/build.ts",
|
"build": "bun bin/build.ts",
|
||||||
"publish": "bun bin/publish.ts"
|
"version:update": "bun bin/version_update.ts",
|
||||||
|
"publish": "bun bin/build.ts && bun bin/version_update.ts && bun bin/publish.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -25,4 +26,4 @@
|
|||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "n8n-nodes-openapi-mcp-server",
|
"name": "n8n-nodes-openapi-mcp-server",
|
||||||
"version": "1.1.19",
|
"version": "1.1.20",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"n8n",
|
"n8n",
|
||||||
"n8n-nodes"
|
"n8n-nodes"
|
||||||
@@ -20,4 +20,4 @@
|
|||||||
"credentials/OpenapiMcpServerCredentials.credentials.js"
|
"credentials/OpenapiMcpServerCredentials.credentials.js"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user