#!/usr/bin/env node const path = require('path'); const fs = require('fs'); const { generateNodeDefinitions, } = require('@n8n/workflow-sdk/dist/generate-types/generate-node-defs-cli'); const cwd = process.cwd(); const nodesJsonPath = path.join(cwd, 'dist', 'types', 'nodes.json'); const outputDir = path.join(cwd, 'dist', 'node-definitions'); const packageJsonPath = path.join(cwd, 'package.json'); const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8')); generateNodeDefinitions({ nodesJsonPath, outputDir, packageName: packageJson.name, }).catch((error) => { console.error('Node definition generation failed:', error); process.exit(1); });