Release packaging

This commit is contained in:
Mateusz Tymek
2026-02-02 18:37:57 +01:00
parent cd5e8f9165
commit 5b96a239f2
13 changed files with 514 additions and 10 deletions

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bun
/**
* Sync manifest.json version with package.json version
* This script is run during the 'version' lifecycle hook after package.json is updated
*/
import { readFileSync, writeFileSync } from "fs";
import { join } from "path";
const rootDir = process.cwd();
// Read package.json to get the new version
const packageJsonPath = join(rootDir, "package.json");
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
const newVersion = packageJson.version;
if (!newVersion) {
console.error("Error: No version found in package.json");
process.exit(1);
}
// Read manifest.json
const manifestPath = join(rootDir, "manifest.json");
const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
// Update version
manifest.version = newVersion;
// Write back with proper formatting (2-space indent, trailing newline)
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + "\n");
console.log(`Updated manifest.json version to ${newVersion}`);