當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。