定制 decodelabs/chronicle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

decodelabs/chronicle

Composer 安装命令:

composer require decodelabs/chronicle

包简介

Release notes generator

README 文档

README

PHP from Packagist Latest Version Total Downloads GitHub Workflow Status PHPStan License

Release notes generator

Chronicle provides a set of tools for parsing, generating and rendering release notes and change logs.

Installation

This package requires PHP 8.4 or higher.

Install via Composer:

composer require decodelabs/chronicle

Usage

Open a Repository in the root of your project and pass in a Systemic service instance.

use DecodeLabs\Chronicle\Repository;
use DecodeLabs\Monarch;
use DecodeLabs\Systemic;

$repo = new Repository(
    '/path/to/your/repo',
    Monarch::getService(Systemic::class)
);

Parse your existing change log file - name defaults to CHANGELOG.md. Set rewrite to true to reformat release headers and layout in Chronicle's format - useful for converting existing change logs.

If your change log file doesn't exist, an empty template document will be created.

$doc = $repo->parseChangeLog(
    fileName: 'CHANGELOG.md',
    rewrite: true
);

Structure

The parser expects three main sections in the change log file:

  • Preamble: This is the first section of the file, which contains general information about the change log
  • Unreleased: This section contains unreleased changes, which are not yet assigned to a specific version
  • Releases: This section contains the list of released versions, each with its own set of changes
# Changelog

All notable changes to this project will be documented in this file.<br>
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

- This is a block of unreleased changes
- It is used to generate the next release

It doesn't have a version number, and can be in list or free text format. It just requires an "Unreleased" header.


## [v0.2.0](https://github.com/decodelabs/chronicle/commits/v0.2.0) - 16th May 2025

- Added a new feature

[Full list of changes](https://github.com/decodelabs/chronicle/compare/v0.1.0...v0.2.0)


## [v0.1.0](https://github.com/decodelabs/chronicle/commits/v0.1.0) - 15th May 2025

- Implemented basic ChangeLog parser
- Implemented ChangeLog document renderer
- Built GitHub issue and pull request fetchers

Next release

You can add unreleased changes to the change log in the Unreleased section as you work on your project. When you're ready to release a new version, you can use the generateNextRelease() method to turn those changes into a new release.

$doc->generateNextRelease(
    version: 'patch', // major, minor, patch, preRelease, breaking, feature or v0.2.0
    date: '2025-05-16', // optional, defaults to today
    repository: $repo
);

if your project is hosted on GitHub, generateNextRelease() will automatically fetch the latest issues and pull requests from the repository and add them to the release notes.

if your project is private or you hit the API rate limit, you can place your access token in your .env file with the key GITHUB_TOKEN. Chronicle will automatically authenticate with the GitHub API using this token.

## [v0.2.0](https://github.com/decodelabs/chronicle/commits/v0.2.0) - 16th May 2025

- Added a new feature

### Merged Pull Requests
- [#123](https://github.com/decodelabs/chronicle/pull/123) - Fixed an issue
- [#456](https://github.com/decodelabs/chronicle/pull/456) - Added another new feature

### Issues
- [#789](https://github.com/decodelabs/chronicle/issues/789) - Fixed a bug

Rendering

You can render the change log document to a string using the render() method, or back to the original file using save(). When you call either of these methods, you can specify a Renderer implementation which you can use to customize the output format. If ommitted, the default renderer will be used.

use DecodeLabs\Chronicle\ChangeLog\Renderer;
use MyApp\Chronicle\ChangeLog\Renderer\MyCustomRenderer;

$doc->render(
    renderer: new MyCustomRenderer() // Instance of Renderer
);

Licensing

Chronicle is licensed under the MIT License. See LICENSE for the full license text.

decodelabs/chronicle 适用场景与选型建议

decodelabs/chronicle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.61k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 16 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 decodelabs/chronicle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 decodelabs/chronicle 我们能提供哪些服务?
定制开发 / 二次开发

基于 decodelabs/chronicle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 4.61k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 21
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-05-16