update version

This commit is contained in:
bipproduction
2025-11-17 16:40:37 +08:00
parent fcc85101fd
commit 87e77ced60
8 changed files with 1502 additions and 94 deletions

View File

@@ -80,7 +80,8 @@ async function build() {
console.log("🎉 Build complete!");
}
execSync("cd src && npm version patch", { stdio: 'inherit' })
const version = execSync('npm view lodash version').toString().trim();
console.log("🚀 Version:", version);
execSync("cd src && npm version ", { stdio: 'inherit' })
build()

View File

@@ -34,7 +34,7 @@ async function loadOpenAPI(): Promise<OpenAPI> {
// convert operation to value
function operationValue(tag: string, operationId: string) {
return `${safe(tag)}_${safe(operationId)}`;
return _.snakeCase(`${safe(tag)}_${safe(operationId)}`);
}
// build properties for dropdown + dynamic inputs
@@ -55,7 +55,7 @@ function buildPropertiesBlock(ops: Array<any>) {
options: [
${options.join(',\n ')}
],
default: '${operationValue(ops[0].tag, ops[0].operationId)}',
default: '${operationValue(ops[0].tag, ops[0].operationId).replace(/_/g, ' ')}',
description: 'Pilih endpoint yang akan dipanggil'
}
`;
@@ -328,6 +328,10 @@ function packageText({ name, className }: { name: string, className: string }) {
async function run() {
await fs.rm('src', { recursive: true }).catch(() => { })
await fs.mkdir('src/credentials', { recursive: true })
await fs.mkdir('src/nodes', { recursive: true })
console.log('💡 Loading OpenAPI...');
const api = await loadOpenAPI();

26
bin/version_update.ts Normal file
View File

@@ -0,0 +1,26 @@
import { execSync } from "node:child_process";
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}`;
console.log("⬆️ New local version:", newLocalVersion);
// 4. Update package.json di folder src
execSync(`cd src && npm version ${newLocalVersion} --allow-all --force`, {
stdio: "inherit",
});