-
Notifications
You must be signed in to change notification settings - Fork 17
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
39 changed files
with
142 additions
and
104 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": false, | ||
"trailingComma": "none", | ||
"arrowParens": "avoid" | ||
} |
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
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,32 +1,37 @@ | ||
const { execSync } = require("child_process"); | ||
const { version } = require("./package"); | ||
const exec = command => execSync(command, { encoding: "utf8" }).trim(); | ||
import { execSync } from "child_process" | ||
import packageJson from "./package.json" | ||
import { fileURLToPath } from "url" | ||
import { dirname } from "path" | ||
|
||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = dirname(__filename) | ||
const exec = command => execSync(command, { encoding: "utf8" }).trim() | ||
|
||
const exitWithError = error => { | ||
process.stderr.write(`\x1b[1;31m${error}\x1b[0m\n\n`); | ||
process.exit(1); | ||
}; | ||
process.stderr.write(`\x1b[1;31m${error}\x1b[0m\n\n`) | ||
process.exit(1) | ||
} | ||
|
||
const gitBranchName = exec("git rev-parse --abbrev-ref HEAD"); | ||
const gitBranchName = exec("git rev-parse --abbrev-ref HEAD") | ||
if (gitBranchName !== "master") { | ||
exitWithError("please checkout the master branch to make a release!"); | ||
exitWithError("please checkout the master branch to make a release!") | ||
} | ||
|
||
const workingCopyChanges = exec("git status --porcelain"); | ||
const workingCopyChanges = exec("git status --porcelain") | ||
if (workingCopyChanges) { | ||
exitWithError("please commit your changes before making a release!"); | ||
exitWithError("please commit your changes before making a release!") | ||
} | ||
|
||
const tagExists = exec(`git tag -l "${version}"`); | ||
const tagExists = exec(`git tag -l "${packageJson.version}"`) | ||
if (tagExists) { | ||
exitWithError(`${version} has already been released!`); | ||
exitWithError(`${packageJson.version} has already been released!`) | ||
} | ||
|
||
execSync( | ||
`npm run release:dry && git tag ${version} && git push && git push --tags && npm publish`, | ||
`npm run release:dry && git tag ${packageJson.version} && git push && git push --tags && npm publish`, | ||
{ | ||
shell: true, | ||
stdio: "inherit", | ||
cwd: __dirname | ||
} | ||
); | ||
) |
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
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
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
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.