@changesets/git
Advanced tools
Comparing version 1.3.2 to 1.4.0
# @changesets/git | ||
## 1.4.0 | ||
### Minor Changes | ||
- [#858](https://github.com/changesets/changesets/pull/858) [`dd9b76f`](https://github.com/changesets/changesets/commit/dd9b76f162a546ae8b412e0cb10277f971f3585e) Thanks [@dotansimha](https://github.com/dotansimha)! - Added a new helper function: `getCurrentCommitId` | ||
### Patch Changes | ||
- Updated dependencies [[`dd9b76f`](https://github.com/changesets/changesets/commit/dd9b76f162a546ae8b412e0cb10277f971f3585e)]: | ||
- @changesets/types@5.1.0 | ||
## 1.3.2 | ||
@@ -4,0 +15,0 @@ |
@@ -35,1 +35,4 @@ import { Package } from "@manypkg/get-packages"; | ||
}): Promise<Package[]>; | ||
export declare function getCurrentCommitId({ cwd }: { | ||
cwd: string; | ||
}): Promise<string>; |
@@ -255,2 +255,9 @@ 'use strict'; | ||
} | ||
async function getCurrentCommitId({ | ||
cwd | ||
}) { | ||
return (await spawn__default['default']("git", ["show", `--format="%h"`, "--no-patch"], { | ||
cwd | ||
})).stdout.toString().trim(); | ||
} | ||
@@ -266,4 +273,5 @@ exports.add = add; | ||
exports.getCommitsThatAddFiles = getCommitsThatAddFiles; | ||
exports.getCurrentCommitId = getCurrentCommitId; | ||
exports.getDivergedCommit = getDivergedCommit; | ||
exports.isRepoShallow = isRepoShallow; | ||
exports.tag = tag; |
@@ -160,2 +160,8 @@ "use strict"; | ||
async function getCurrentCommitId({cwd: cwd}) { | ||
return (await spawn__default.default("git", [ "show", '--format="%h"', "--no-patch" ], { | ||
cwd: cwd | ||
})).stdout.toString().trim(); | ||
} | ||
exports.add = add, exports.commit = commit, exports.deepenCloneBy = deepenCloneBy, | ||
@@ -165,3 +171,3 @@ exports.getAllTags = getAllTags, exports.getChangedChangesetFilesSinceRef = getChangedChangesetFilesSinceRef, | ||
exports.getCommitThatAddsFile = getCommitThatAddsFile, exports.getCommitsThatAddFiles = getCommitsThatAddFiles, | ||
exports.getDivergedCommit = getDivergedCommit, exports.isRepoShallow = isRepoShallow, | ||
exports.tag = tag; | ||
exports.getCurrentCommitId = getCurrentCommitId, exports.getDivergedCommit = getDivergedCommit, | ||
exports.isRepoShallow = isRepoShallow, exports.tag = tag; |
@@ -244,3 +244,10 @@ import spawn from 'spawndamnit'; | ||
} | ||
async function getCurrentCommitId({ | ||
cwd | ||
}) { | ||
return (await spawn("git", ["show", `--format="%h"`, "--no-patch"], { | ||
cwd | ||
})).stdout.toString().trim(); | ||
} | ||
export { add, commit, deepenCloneBy, getAllTags, getChangedChangesetFilesSinceRef, getChangedFilesSince, getChangedPackagesSinceRef, getCommitThatAddsFile, getCommitsThatAddFiles, getDivergedCommit, isRepoShallow, tag }; | ||
export { add, commit, deepenCloneBy, getAllTags, getChangedChangesetFilesSinceRef, getChangedFilesSince, getChangedPackagesSinceRef, getCommitThatAddsFile, getCommitsThatAddFiles, getCurrentCommitId, getDivergedCommit, isRepoShallow, tag }; |
{ | ||
"name": "@changesets/git", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"description": "Some git helpers that changesets use to get information", | ||
@@ -12,3 +12,3 @@ "main": "dist/git.cjs.js", | ||
"@changesets/errors": "^0.1.4", | ||
"@changesets/types": "^5.0.0", | ||
"@changesets/types": "^5.1.0", | ||
"@manypkg/get-packages": "^1.1.3", | ||
@@ -15,0 +15,0 @@ "is-subdir": "^1.1.1", |
@@ -289,1 +289,13 @@ import spawn from "spawndamnit"; | ||
} | ||
export async function getCurrentCommitId({ | ||
cwd | ||
}: { | ||
cwd: string; | ||
}): Promise<string> { | ||
return ( | ||
await spawn("git", ["show", `--format="%h"`, "--no-patch"], { cwd }) | ||
).stdout | ||
.toString() | ||
.trim(); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64707
1362
Updated@changesets/types@^5.1.0