Skip to content

Commit

Permalink
fix: delete success
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Jan 8, 2024
1 parent 206cd55 commit 146fd89
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 52 deletions.
3 changes: 2 additions & 1 deletion src/command/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ async function resolveAuthorInfo(options: ChangelogOption, info: AuthorInfo) {
try {
const data = await ofetch (`https://api.github.com/repos/${options.github}/commits/${commit}`, { headers })
info.login = data.author.login
globalAuthorsError.delete(info.name ?? info.email)
break
}
catch (e: any) {
Expand Down Expand Up @@ -185,7 +186,7 @@ async function generate({ fromToList, titleMap, options }: {
}

console.log(pc.green('\nContent preview:'))
console.log(pc.gray(md.replaceAll(/\n|\r/g, '').slice(0, 300)))
console.log(pc.gray(md.replaceAll(/\n|\r/g, '').slice(0, 400)))

return md
}
Expand Down
51 changes: 1 addition & 50 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,10 @@ import { loadConfig } from 'unconfig'
import lodashMerge from 'lodash.merge'
import pc from 'picocolors'
import { getGitHubRepo } from '.'
import type { BumpOption, ChangelogOption, CliOption, MarkdownOption } from '.'

const cwd = process.cwd()

export interface BumpOption {
all?: boolean
pkg?: boolean
prompt?: boolean
major?: boolean
minor?: boolean
patch?: boolean
premajor?: string
preminor?: string
prepatch?: string
prerelease?: string
}

export interface ChangelogOption {
tag?: string
verbose?: boolean
token?: string
github?: string
}

export interface CliOption {
yml?: boolean
commit?: string
tag?: string
push?: string
dry?: boolean
mainPkg?: boolean
cwd: string
debug?: boolean
from?: string
}

export interface MarkdownOption {
/**
* **Optional**
* Resolved by `git config --get remote.origin.url'` for generating a detailed CHANGELOG.md.
*/
github?: string

types: Record<string, {
title: string
}>

titles: {
breakingChanges: string
}
}

export const MarkdownOptionDefaults: MarkdownOption = {
types: {
feat: { title: '✨ Enhancements' },
Expand All @@ -77,8 +30,6 @@ export const MarkdownOptionDefaults: MarkdownOption = {
const CliOptionDefaults: CliOption = {
commit: 'Release {r}',
cwd,
// tag: '',
// push: '',
}

export type AllOption = BumpOption & ChangelogOption & CliOption & MarkdownOption
Expand Down
48 changes: 48 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
import type conventionalRecommendedBump from 'conventional-recommended-bump'

export type ReleaseType = conventionalRecommendedBump.Recommendation.ReleaseType | 'prerelease' | 'premajor' | 'preminor' | 'prepatch'

export interface BumpOption {
all?: boolean
pkg?: boolean
prompt?: boolean
major?: boolean
minor?: boolean
patch?: boolean
premajor?: string
preminor?: string
prepatch?: string
prerelease?: string
}

export interface ChangelogOption {
tag?: string
verbose?: boolean
token?: string
github?: string
}

export interface CliOption {
yml?: boolean
commit?: string
tag?: string
push?: string
dry?: boolean
mainPkg?: boolean
cwd: string
debug?: boolean
from?: string
}

export interface MarkdownOption {
/**
* **Optional**
* Resolved by `git config --get remote.origin.url'` for generating a detailed CHANGELOG.md.
*/
github?: string

types: Record<string, {
title: string
}>

titles: {
breakingChanges: string
}
}
2 changes: 1 addition & 1 deletion test/resolaveTagSection.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolveChangelogSection } from '../src'

describe.skip('`resolveChangelogSection` test cases', () => {
describe('`resolveChangelogSection` test cases', () => {
it('single changelog', () => {
const res = resolveChangelogSection(`# Changelog
Expand Down

0 comments on commit 146fd89

Please sign in to comment.