-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove ability to import
/promise
types and throw when requ…
…ired." This reverts commit 2ac1d3f.
- Loading branch information
Showing
3 changed files
with
90 additions
and
5 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,69 @@ | ||
import * as SimpleGitTypes from 'simple-git'; | ||
|
||
/** | ||
* @deprecated | ||
* | ||
* simple-git has supported promises / async await since version 2.6.0. | ||
* Importing from 'simple-git/promise' has been deprecated and will be | ||
* removed by July 2022. | ||
* | ||
* To upgrade, change all 'simple-git/promise' imports to just 'simple-git' | ||
*/ | ||
declare const simplegit: simplegit.SimpleGitExport; | ||
|
||
declare namespace simplegit { | ||
type SimpleGitExport = ((basePath?: string) => simplegit.SimpleGit) & { | ||
CleanOptions: typeof SimpleGitTypes.CleanOptions; | ||
}; | ||
|
||
/** | ||
* @deprecated | ||
* | ||
* simple-git has supported promises / async await since version 2.6.0. | ||
* Importing from 'simple-git/promise' has been deprecated and will be | ||
* removed by July 2022. | ||
* | ||
* To upgrade, change all 'simple-git/promise' imports to just 'simple-git' | ||
*/ | ||
type SimpleGit = SimpleGitTypes.SimpleGit; | ||
|
||
// errors | ||
type GitError = SimpleGitTypes.GitError; | ||
type GitConstructError = SimpleGitTypes.GitConstructError; | ||
type GitResponseError<T> = SimpleGitTypes.GitResponseError<T>; | ||
type TaskConfigurationError = SimpleGitTypes.TaskConfigurationError; | ||
|
||
// responses | ||
type BranchSummary = SimpleGitTypes.BranchSummary; | ||
type CleanSummary = SimpleGitTypes.CleanSummary; | ||
type CleanMode = SimpleGitTypes.CleanMode; | ||
type DiffResult = SimpleGitTypes.DiffResult; | ||
type FetchResult = SimpleGitTypes.FetchResult; | ||
type CommitResult = SimpleGitTypes.CommitResult; | ||
type MergeResult = SimpleGitTypes.MergeResult; | ||
type PullResult = SimpleGitTypes.PullResult; | ||
type StatusResult = SimpleGitTypes.StatusResult; | ||
type TagResult = SimpleGitTypes.TagResult; | ||
|
||
// types | ||
type outputHandler = SimpleGitTypes.outputHandler; | ||
type LogOptions<T = SimpleGitTypes.DefaultLogFields> = SimpleGitTypes.LogOptions<T>; | ||
type Options = SimpleGitTypes.Options; | ||
|
||
// deprecated | ||
/** @deprecated use MergeResult */ | ||
type MergeSummary = SimpleGitTypes.MergeSummary; | ||
/** @deprecated use CommitResult */ | ||
type CommitSummary = SimpleGitTypes.CommitResult; | ||
} | ||
|
||
/** | ||
* @deprecated | ||
* | ||
* simple-git has supported promises / async await since version 2.6.0. | ||
* Importing from 'simple-git/promise' has been deprecated and will be | ||
* removed by July 2022. | ||
* | ||
* To upgrade, change all 'simple-git/promise' imports to just 'simple-git' | ||
*/ | ||
export = simplegit; |
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,8 +1,18 @@ | ||
throw new Error(`============================================= | ||
// TODO: deprecation warning | ||
console.warn(`============================================= | ||
simple-git has supported promises / async await since version 2.6.0. | ||
Importing from 'simple-git/promise' was deprecated in January 2022 | ||
and removed in August 2022. | ||
Importing from 'simple-git/promise' has been deprecated and will be | ||
removed by July 2022. | ||
Upgrading is simple though: | ||
change all 'simple-git/promise' imports to just 'simple-git' | ||
To upgrade, change all 'simple-git/promise' imports to just 'simple-git' | ||
=============================================`); | ||
|
||
const simpleGit = require('.'); | ||
|
||
module.exports = Object.assign( | ||
function () { | ||
return simpleGit.gitP.apply(null, arguments); | ||
}, | ||
simpleGit, | ||
{ default: simpleGit.gitP } | ||
); |