mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
feat(typings): add semantic-release interfaces
This commit is contained in:
Vendored
+46
@@ -0,0 +1,46 @@
|
||||
// Type definitions for semantic-release 15.13
|
||||
// Project: https://github.com/semantic-release/semantic-release#readme
|
||||
// Definitions by: Leonardo Gatica <https://github.com/lgaticaq>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The semantic release configuration itself.
|
||||
*/
|
||||
export interface GlobalConfig {
|
||||
/** The full prepare step configuration. */
|
||||
prepare?: any;
|
||||
/** The branch on which releases should happen. */
|
||||
branch: string;
|
||||
/** The Git repository URL, in any supported format. */
|
||||
repositoryUrl: string;
|
||||
/** The Git tag format used by semantic-release to identify releases. */
|
||||
tagFormat: string;
|
||||
}
|
||||
|
||||
export interface LastRelease {
|
||||
/** The version name of the release */
|
||||
version: string;
|
||||
/** The Git tag of the release. */
|
||||
gitTag: string;
|
||||
/** The Git checksum of the last commit of the release. */
|
||||
gitHead: string;
|
||||
}
|
||||
|
||||
export interface NextRelease extends LastRelease {
|
||||
/** The release notes of the next release. */
|
||||
notes: string;
|
||||
}
|
||||
|
||||
export interface Context {
|
||||
/** The semantic release configuration itself. */
|
||||
options?: GlobalConfig;
|
||||
/** The previous release details. */
|
||||
lastRelease?: LastRelease;
|
||||
/** The next release details. */
|
||||
nextRelease?: NextRelease;
|
||||
/** The shared logger instance of semantic release. */
|
||||
logger: {
|
||||
log: (message: string, ...vars: any[]) => void,
|
||||
error: (message: string, ...vars: any[]) => void,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import * as lib from 'semantic-release';
|
||||
|
||||
function publish(pluginConfig: any, context: lib.Context) {
|
||||
const version = context.nextRelease && context.nextRelease.version;
|
||||
context.logger.log(`New version ${version}`);
|
||||
}
|
||||
|
||||
const context = {
|
||||
nextRelease: {
|
||||
version: '1.0.0',
|
||||
gitTag: '1.0.0',
|
||||
gitHead: 'f1eed296d2ffe184fb15f52b1c5ad778f5c87645',
|
||||
notes: 'New release'
|
||||
},
|
||||
logger: console
|
||||
};
|
||||
publish({}, context);
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"semantic-release-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user