Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#71795 feat!: update types for git-raw-comm…
Browse files Browse the repository at this point in the history
…its, conventional-changelog-core, conventional-changelog, conventional-changelog-preset-loader by @okuryu
  • Loading branch information
okuryu authored Feb 4, 2025
1 parent b0b4185 commit 95b103b
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 228 deletions.
4 changes: 4 additions & 0 deletions notNeededPackages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,10 @@
"libraryName": "contentstack",
"asOfVersion": "3.11.0"
},
"conventional-changelog-preset-loader": {
"libraryName": "conventional-changelog-preset-loader",
"asOfVersion": "5.0.0"
},
"conventional-recommended-bump": {
"libraryName": "conventional-recommended-bump",
"asOfVersion": "10.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
"use strict";

import conventionalChangelogCore from "conventional-changelog-core";
import gitRawCommits from "git-raw-commits";

namespace Module {
declare const context: conventionalChangelogCore.Context;
declare const gitRawCommitsOpts: conventionalChangelogCore.GitRawCommitsOptions;
declare const options: conventionalChangelogCore.Options;
declare const parserOpts: conventionalChangelogCore.ParserOptions;
declare const writerOpts: conventionalChangelogCore.WriterOptions;
declare const execOpts: gitRawCommits.ExecOptions;
// $ExpectType Readable
conventionalChangelogCore();
// $ExpectType Readable
Expand All @@ -23,6 +21,4 @@ namespace Module {
conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts);
// $ExpectType Readable
conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts);
// $ExpectType Readable
conventionalChangelogCore(options, context, gitRawCommitsOpts, parserOpts, writerOpts, execOpts);
}
5 changes: 2 additions & 3 deletions types/conventional-changelog-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as Stream from "stream";

import { Context as BaseContext, Options as BaseWriterOptions } from "conventional-changelog-writer";
import { Commit, Options as BaseParserOptions } from "conventional-commits-parser";
import { ExecOptions as GitRawExecOptions, GitOptions as BaseGitRawCommitsOptions } from "git-raw-commits";
import { GitOptions as BaseGitRawCommitsOptions } from "git-raw-commits";

import { Package } from "normalize-package-data";

Expand All @@ -23,7 +23,6 @@ declare function conventionalChangelogCore<TCommit extends Commit = Commit, TCon
gitRawCommitsOpts?: GitRawCommitsOptions,
parserOpts?: ParserOptions,
writerOpts?: WriterOptions<TCommit, TContext>,
execOpts?: GitRawExecOptions,
): Stream.Readable;

declare namespace conventionalChangelogCore {
Expand Down Expand Up @@ -481,4 +480,4 @@ type ParserOptions = conventionalChangelogCore.ParserOptions;
type WriterOptions<TCommit extends Commit = Commit, TContext extends BaseContext = BaseContext> =
conventionalChangelogCore.WriterOptions<TCommit, TContext>;

export = conventionalChangelogCore;
export default conventionalChangelogCore;
3 changes: 2 additions & 1 deletion types/conventional-changelog-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@types/conventional-changelog-core",
"version": "4.2.9999",
"type": "module",
"version": "8.0.9999",
"projects": [
"https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#readme"
],
Expand Down
5 changes: 0 additions & 5 deletions types/conventional-changelog-preset-loader/.npmignore

This file was deleted.

This file was deleted.

50 changes: 0 additions & 50 deletions types/conventional-changelog-preset-loader/index.d.ts

This file was deleted.

22 changes: 0 additions & 22 deletions types/conventional-changelog-preset-loader/package.json

This file was deleted.

19 changes: 0 additions & 19 deletions types/conventional-changelog-preset-loader/tsconfig.json

This file was deleted.

26 changes: 11 additions & 15 deletions types/conventional-changelog/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
/// <reference types="node" />

import * as Stream from "stream";

import {
Context,
GitRawCommitsOptions,
Options as BaseOptions,
ParserOptions,
WriterOptions,
} from "conventional-changelog-core";
import conventionalChangelogCore from "conventional-changelog-core";
import { Context as WriterContext } from "conventional-changelog-writer";
import { Commit } from "conventional-commits-parser";
import * as Stream from "stream";

/**
* Returns a readable stream.
Expand All @@ -21,12 +14,15 @@ import { Commit } from "conventional-commits-parser";
* @param parserOpts
* @param writerOpts
*/
declare function conventionalChangelog<TCommit extends Commit = Commit, TContext extends WriterContext = Context>(
declare function conventionalChangelog<
TCommit extends Commit = Commit,
TContext extends WriterContext = conventionalChangelogCore.Context,
>(
options?: Options<TCommit, TContext>,
context?: Partial<TContext>,
gitRawCommitsOpts?: GitRawCommitsOptions,
parserOpts?: ParserOptions,
writerOpts?: WriterOptions<TCommit, TContext>,
gitRawCommitsOpts?: conventionalChangelogCore.GitRawCommitsOptions,
parserOpts?: conventionalChangelogCore.ParserOptions,
writerOpts?: conventionalChangelogCore.WriterOptions<TCommit, TContext>,
): Stream.Readable;

declare namespace conventionalChangelog {
Expand All @@ -35,7 +31,7 @@ declare namespace conventionalChangelog {
* docs. The API is the same with the following changes or additions:
*/
interface Options<TCommit extends Commit = Commit, TContext extends WriterContext = WriterContext>
extends BaseOptions<TCommit, TContext>
extends conventionalChangelogCore.Options<TCommit, TContext>
{
/**
* It's recommended to use a preset so you don't have to define everything
Expand All @@ -55,4 +51,4 @@ declare namespace conventionalChangelog {
type Options<TCommit extends Commit = Commit, TContext extends WriterContext = WriterContext> =
conventionalChangelog.Options<TCommit, TContext>;

export = conventionalChangelog;
export default conventionalChangelog;
3 changes: 2 additions & 1 deletion types/conventional-changelog/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"private": true,
"name": "@types/conventional-changelog",
"version": "3.1.9999",
"type": "module",
"version": "6.0.9999",
"projects": [
"https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog#readme"
],
Expand Down
17 changes: 5 additions & 12 deletions types/git-raw-commits/git-raw-commits-tests.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
"use strict";

import gitRawCommits from "git-raw-commits";
import { getRawCommits, getRawCommitsStream, GitOptions } from "git-raw-commits";

declare const execOptions: gitRawCommits.ExecOptions;
declare const gitOptions: gitRawCommits.GitOptions;
declare const gitOptions: GitOptions;

// $ExpectType Readable
gitRawCommits(gitOptions);
// $ExpectType AsyncGenerator<string, void, unknown>
getRawCommits(gitOptions);

// $ExpectType Readable
gitRawCommits(gitOptions, execOptions);

// @ts-expect-error
gitRawCommits();

// @ts-expect-error
gitRawCommits(execOptions, gitOptions);
getRawCommitsStream(gitOptions);
Loading

0 comments on commit 95b103b

Please sign in to comment.