2021-11-11 03:28:10 +00:00
|
|
|
<?php
|
2021-11-16 02:01:50 +00:00
|
|
|
|
|
|
|
namespace Automattic\WooCommerce\MonorepoTools\Changelogger;
|
|
|
|
|
|
|
|
use Automattic\Jetpack\Changelogger\FormatterPlugin;
|
|
|
|
|
2021-11-11 03:28:10 +00:00
|
|
|
/**
|
|
|
|
* Jetpack Changelogger Formatter for WooCommerce packages
|
|
|
|
*/
|
|
|
|
|
|
|
|
require_once 'Formatter.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Jetpack Changelogger Formatter for WooCommerce Packages
|
|
|
|
*
|
|
|
|
* Class Formatter
|
|
|
|
*/
|
2021-11-16 02:01:50 +00:00
|
|
|
class PackageFormatter extends Formatter implements FormatterPlugin {
|
2021-11-11 03:28:10 +00:00
|
|
|
/**
|
|
|
|
* Prologue text.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $prologue = "# Changelog \n\nThis project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).";
|
|
|
|
|
|
|
|
/**
|
2022-06-29 20:09:46 +00:00
|
|
|
* Return the epilogue string based on the package being released.
|
2021-11-11 03:28:10 +00:00
|
|
|
*/
|
2022-06-29 20:09:46 +00:00
|
|
|
public function getEpilogue() {
|
|
|
|
$cwd = getcwd();
|
|
|
|
$pos = stripos( $cwd, 'packages/js/' );
|
|
|
|
$package = substr( $cwd, $pos + 12 );
|
|
|
|
|
|
|
|
return '[See legacy changelogs for previous versions](https://github.com/woocommerce/woocommerce/blob/68581955106947918d2b17607a01bdfdf22288a9/packages/js/' . $package . '/CHANGELOG.md).';
|
|
|
|
}
|
2021-11-11 03:28:10 +00:00
|
|
|
}
|