#!/usr/bin/env node import { writeFileSync, readFileSync } from 'node:fs' import { join } from 'node:path' // Get version from package.json const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) const version = packageJson.version const versionFileContent = `export const version = '${version}'\n // This is automatically generated by the update-version.js script don't edit it manually\n` const versionPaths = [ join('supabase', 'functions', '_backend', 'utils', 'version.ts'), join('supabase', 'functions', '_backend', 'plugin_runtime', 'utils', 'version.ts'), ] for (const versionFilePath of versionPaths) { writeFileSync(versionFilePath, versionFileContent) console.log(`Updated ${versionFilePath} with version ${version}`) }