Skip to content

Commit

Permalink
chore: bump version helper
Browse files Browse the repository at this point in the history
  • Loading branch information
yy4382 committed Oct 22, 2024
1 parent 7bade03 commit 2563080
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"test": "vitest --run",
"version": "node version-bump.mjs && git add manifest.json versions.json"
"version": "node version-bump.mjs && git add manifest.json versions.json manifest-beta.json"
},
"keywords": [],
"author": "",
Expand Down
12 changes: 10 additions & 2 deletions version-bump.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ const targetVersion = process.env.npm_package_version;
let manifest = JSON.parse(readFileSync("manifest.json", "utf8"));
const { minAppVersion } = manifest;
manifest.version = targetVersion;
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t"));
writeFileSync("manifest.json", JSON.stringify(manifest, null, "\t") + "\n");

// read minAppVersion from manifest.json and bump version to target version
let manifestBeta = JSON.parse(readFileSync("manifest-beta.json", "utf8"));
manifestBeta.version = targetVersion;
writeFileSync(
"manifest-beta.json",
JSON.stringify(manifestBeta, null, "\t") + "\n",
);

// update versions.json with target version and minAppVersion from manifest.json
let versions = JSON.parse(readFileSync("versions.json", "utf8"));
versions[targetVersion] = minAppVersion;
writeFileSync("versions.json", JSON.stringify(versions, null, "\t"));
writeFileSync("versions.json", JSON.stringify(versions, null, "\t") + "\n");

0 comments on commit 2563080

Please sign in to comment.