-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
3,141 additions
and
5,938 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
#!/usr/bin/env node | ||
|
||
import { execSync } from "node:child_process" | ||
import { writeFile } from "node:fs/promises" | ||
import { argv } from "node:process" | ||
import { inc, parse } from "semver" | ||
|
||
import packageJson from "../package.json" assert { type: "json" } | ||
|
||
const run = async () => { | ||
const oldVersion = packageJson.version | ||
const version = parse(packageJson.version) | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers | ||
const newVersion = inc(version, argv[2] ?? "patch") | ||
const oldVersion = packageJson.version | ||
const version = parse(packageJson.version) | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers | ||
const newVersion = inc(version, argv[2] ?? "patch") | ||
|
||
packageJson.version = newVersion | ||
packageJson.version = newVersion | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(`Bumping version from ${oldVersion} to ${newVersion}`) | ||
// eslint-disable-next-line no-console | ||
console.log(`Bumping version from ${oldVersion} to ${newVersion}`) | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers | ||
await writeFile("./package.json", JSON.stringify(packageJson, undefined, 2)) | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-magic-numbers | ||
await writeFile("./package.json", JSON.stringify(packageJson, undefined, 2)) | ||
|
||
void run() | ||
execSync(`git tag v${newVersion}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.