mirror of
https://github.com/forketyfork/obsidian-food-tracker.git
synced 2026-07-22 05:51:38 +00:00
- Switch package manager to pnpm 10.33.4: regenerate the lockfile, update package.json scripts, justfile, release.mjs, README, and CLAUDE.md. - Use the hoisted node-modules layout via .npmrc to preserve the resolution behavior the project relied on under yarn's nodeLinker: node-modules. - Replace yarn with pnpm in the nix flake's dev shell. - Update CI workflows to use pnpm/action-setup and pnpm install --frozen-lockfile. - Run dependabot weekly instead of daily and require a 7-day cooldown on any update.
30 lines
908 B
JavaScript
30 lines
908 B
JavaScript
import { execFileSync } from "node:child_process";
|
|
|
|
const [versionArg] = process.argv.slice(2).filter(arg => arg !== "--");
|
|
|
|
if (!versionArg) {
|
|
console.error("Release version or strategy is required. Example: pnpm release -- patch");
|
|
process.exit(1);
|
|
}
|
|
|
|
const run = (command, args) => {
|
|
execFileSync(command, args, { stdio: "inherit" });
|
|
};
|
|
|
|
try {
|
|
run("npm", ["version", "--no-git-tag-version", versionArg]);
|
|
run("pnpm", ["run", "version"]);
|
|
|
|
const version = execFileSync("node", ["-p", "require('./package.json').version"], {
|
|
encoding: "utf8",
|
|
}).trim();
|
|
|
|
run("git", ["add", "."]);
|
|
run("git", ["commit", "-m", `v${version}`]);
|
|
run("git", ["checkout", "-b", `release/${version}`]);
|
|
run("git", ["push", "origin", `release/${version}`]);
|
|
} catch (error) {
|
|
const message = error instanceof Error ? error.message : "Unknown error";
|
|
console.error(`Release failed: ${message}`);
|
|
process.exit(1);
|
|
}
|