From ea210b0ed967d44b4100075b744fcd7cb72ffa53 Mon Sep 17 00:00:00 2001 From: bipproduction Date: Mon, 17 Nov 2025 17:42:03 +0800 Subject: [PATCH] build --- .env.example | 1 + bin/build.ts | 1 - bin/version_update.ts | 27 +++++++++++++++++++++++++++ package.json | 7 ++++--- src/package.json | 4 ++-- 5 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 .env.example create mode 100644 bin/version_update.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1d43ad3 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +NAMESPACE= \ No newline at end of file diff --git a/bin/build.ts b/bin/build.ts index b3532bb..396296e 100644 --- a/bin/build.ts +++ b/bin/build.ts @@ -83,6 +83,5 @@ async function build() { execSync("git add -A", { stdio: 'inherit' }) execSync("git commit -m 'build'", { stdio: 'inherit' }) -execSync("cd src && npm version patch", { stdio: 'inherit' }) build() diff --git a/bin/version_update.ts b/bin/version_update.ts new file mode 100644 index 0000000..cbaa719 --- /dev/null +++ b/bin/version_update.ts @@ -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)); diff --git a/package.json b/package.json index c114423..f16fa37 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { - "name": "n8n-mcp-server", + "name": "n8n-mcp-server-hoock", "type": "module", "private": true, "version": "1.0.6", "scripts": { "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": {}, "devDependencies": { @@ -25,4 +26,4 @@ "peerDependencies": { "typescript": "^5" } -} +} \ No newline at end of file diff --git a/src/package.json b/src/package.json index 84102a8..68bc898 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-openapi-mcp-server", - "version": "1.1.19", + "version": "1.1.20", "keywords": [ "n8n", "n8n-nodes" @@ -20,4 +20,4 @@ "credentials/OpenapiMcpServerCredentials.credentials.js" ] } -} \ No newline at end of file +}