当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript conventional-changelog类代码示例

本文整理汇总了TypeScript中conventional-changelog的典型用法代码示例。如果您正苦于以下问题:TypeScript conventional-changelog类的具体用法?TypeScript conventional-changelog怎么用?TypeScript conventional-changelog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了conventional-changelog类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: task

task('release.prepareChangelog', () => {
  const changelog = require('gulp-conventional-changelog');
  return src(`${PROJECT_ROOT}/CHANGELOG.md`)
    .pipe(changelog({
      preset: 'angular'
    }))
    .pipe(dest(`${PROJECT_ROOT}`));
});
开发者ID:HugoHeneault,项目名称:ionic,代码行数:8,代码来源:release.ts

示例2: changelog

task('release.publishGithubRelease', (done: Function) => {
  const packageJSON = require('../../../package.json');

  const github = new GithubApi({
    version: '3.0.0'
  });

  github.authenticate({
    type: 'oauth',
    token: process.env.GH_TOKEN
  });

  return changelog({
    preset: 'angular'
  })
  .pipe(obj(function(file, enc, cb) {
    github.releases.createRelease({
      owner: 'ionic-team',
      repo: 'ionic',
      target_commitish: 'master',
      tag_name: 'v' + packageJSON.version,
      name: packageJSON.version,
      body: file.toString(),
      prerelease: false
    }, done);
  }));
});
开发者ID:HugoHeneault,项目名称:ionic,代码行数:27,代码来源:release.ts

示例3: async

	return new Promise<string>( async( resolve: ( changelogContent: string ) => void, reject: ( error: Error ) => void ) => {

		// Read in changelog template files
		const changelogChunks: Array<string> = [];

		// Header information
		changelogChunks.push( '# Changelog\n\n' ); // Title
		changelogChunks.push( `Also see the **[release page](${ repositoryUrl }/releases)**.\n` ); // Sub-title (Github-specific)

		// Generate changelog
		const changelogStream: stream.Readable = conventionalChangelog( { // package.json file has to be updated before
			pkg: {
				path: path.resolve( process.cwd(), 'package.json' )
			},
			preset: 'angular',
			releaseCount: 0 // Regenerate the whole thing every time
		}, {
			linkCompare: false // We use a custom link
		}, {}, {}, {
			commitGroupsSort: changelogCommitGroupsSort,
			commitPartial: changelogTemplates.commitTemplate,
			footerPartial: changelogTemplates.footerTemplate,
			headerPartial: changelogTemplates.headerTemplate,
			mainTemplate: changelogTemplates.mainTemplate,
			transform: changelogTransformer( repositoryUrl ) // Custom transform (shows all commit types)
		} );

		// Handle errors
		changelogStream.on( 'error', ( error: Error ) => {
			reject( new Error( `An error occured while generating the changelog. [${ error.message }]` ) );
			return;
		} );

		// Handle incoming data
		changelogStream.on( 'data', ( dataChunk: string ) => {
			changelogChunks.push( dataChunk );
		} );

		// Handle finish
		changelogStream.on( 'end', () => {

			// Footer information
			changelogChunks.push( '\n<br>\n\n---\n\n<sup>*Changelog generated automatically by [automatic-release](https://github.com/dominique-mueller/automatic-release).*</sup>\n' );

			// Create the full changelog
			const changelog: string = changelogChunks.join( '' );
			resolve( changelog );

		} );

	} );
开发者ID:dominique-mueller,项目名称:automatic-release,代码行数:51,代码来源:changelog.ts


注:本文中的conventional-changelog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。