@coveo/semantic-monorepo-tools
Advanced tools
Comparing version 1.7.2 to 2.0.0
@@ -0,1 +1,19 @@ | ||
# 2.0.0 (2023-04-11) | ||
* feat(git)!: add support for push-force (#149) ([1322ca8](https://github.com/coveo/semantic-monorepo-tools/commits/1322ca8995d9c25d756f186f2db5cbf6b6d789b1)), closes [#149](https://github.com/coveo/semantic-monorepo-tools/issues/149) | ||
### BREAKING CHANGES | ||
* Add front parameter to better reflect git doc and not break refspec spread param. | ||
* ci: update usage | ||
* apply review | ||
* jsdoc | ||
## 1.7.2 (2023-04-11) | ||
@@ -2,0 +20,0 @@ |
@@ -1,1 +0,25 @@ | ||
export default function (remote?: string, ...refs: string[]): Promise<void>; | ||
/** | ||
* Parameters of `gitPush` | ||
*/ | ||
interface GitPushParams { | ||
/** | ||
* Use `--force` flag if true | ||
* @type {boolean} | ||
* @default [false] | ||
*/ | ||
force?: boolean; | ||
/** | ||
* Which remote to push to | ||
* @see https://git-scm.com/docs/git-push#_remotes | ||
* @default {'origin'} | ||
*/ | ||
remote?: string; | ||
/** | ||
* Which refs to push | ||
* @see {@link https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203| Git-SCM, git push, refspec} | ||
* @default {[]} @see {@link https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault| git config, push.default}} | ||
*/ | ||
refs?: string[]; | ||
} | ||
export default function (opts?: GitPushParams): Promise<void>; | ||
export {}; |
import spawn from "../utils/spawn.js"; | ||
import gitLogger from "./utils/gitLogger.js"; | ||
export default async function (remote = "origin", ...refs) { | ||
await spawn("git", ["push", remote, ...refs], gitLogger); | ||
const defaultGitPushParams = { | ||
force: false, | ||
remote: "origin", | ||
refs: [], | ||
}; | ||
export default async function (opts = defaultGitPushParams) { | ||
const { force, remote, refs } = { ...defaultGitPushParams, ...opts }; | ||
await spawn("git", ["push"].concat(force ? ["--force"] : []).concat([remote, ...refs]), gitLogger); | ||
} |
{ | ||
"name": "@coveo/semantic-monorepo-tools", | ||
"version": "1.7.2", | ||
"version": "2.0.0", | ||
"description": "A library of helper functions to do SemVer2 compliant releases from Conventional Commits in monorepos", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/coveo/semantic-monorepo-tools#readme", |
import spawn from "../utils/spawn.js"; | ||
import gitLogger from "./utils/gitLogger.js"; | ||
export default async function (remote = "origin", ...refs: string[]) { | ||
await spawn("git", ["push", remote, ...refs], gitLogger); | ||
/** | ||
* Parameters of `gitPush` | ||
*/ | ||
interface GitPushParams { | ||
/** | ||
* Use `--force` flag if true | ||
* @type {boolean} | ||
* @default [false] | ||
*/ | ||
force?: boolean; | ||
/** | ||
* Which remote to push to | ||
* @see https://git-scm.com/docs/git-push#_remotes | ||
* @default {'origin'} | ||
*/ | ||
remote?: string; | ||
/** | ||
* Which refs to push | ||
* @see {@link https://git-scm.com/docs/git-push#Documentation/git-push.txt-ltrefspecgt82308203| Git-SCM, git push, refspec} | ||
* @default {[]} @see {@link https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault| git config, push.default}} | ||
*/ | ||
refs?: string[]; | ||
} | ||
const defaultGitPushParams: GitPushParams = { | ||
force: false, | ||
remote: "origin", | ||
refs: [], | ||
}; | ||
export default async function (opts: GitPushParams = defaultGitPushParams) { | ||
const { force, remote, refs } = { ...defaultGitPushParams, ...opts }; | ||
await spawn( | ||
"git", | ||
["push"].concat(force ? ["--force"] : []).concat([remote, ...refs]), | ||
gitLogger | ||
); | ||
} |
Sorry, the diff of this file is not supported yet
128088
2573