@ artsy/ changelog
Arty的PR-description changlog Convention的共享解析器. 使用单一的真相来源
两者 基根语name (危险+) generate-changelog和
释放- 注意 (发布-认证PR描述).
Artsy PRs 声明释放笔记为 四 ####- 公关机构的头部:
#### Cross-platform user-facing changes
#### iOS user-facing changes
#### Android user-facing changes
#### Dev changes
此套件将原始的PR正文分解为结构化的结果. 这是故意的 免费 I/O —— 说 获取 PR / 确定范围由每个消费者决定 .
使用量
import { parsePRDescription, changelogTemplateSections } from "@artsy/changelog"
const result = parsePRDescription(pr.body)
switch (result.type) {
case "no_changes": // PR contains `#nochangelog`
break
case "error": // no changelog sections found / all empty
break
case "changes":
result.crossPlatformUserFacingChanges // string[]
result.iOSUserFacingChanges
result.androidUserFacingChanges
result.devChanges
break
}
API 密码
parsePRDescription(body: string): ParseResult- 分析一个公关机构.ParseResult—— 说{ type: "no_changes" } | { type: "error" } | ({ type: "changes" } & ParseResultChanges)。 。 。 .changelogTemplateSections——节-键-节-标题地图.
发展
yarn # install
yarn test # jest
yarn build # tsc → dist