Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: phodal/adr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 44eb858e815d7c068a5a115f6fbc3cfe292485dc
Choose a base ref
...
head repository: phodal/adr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 704551b03360391196cef3186ebdead9e05def59
Choose a head ref
  • 4 commits
  • 5 files changed
  • 2 contributors

Commits on Aug 23, 2024

  1. Fix update command

    jygastaud committed Aug 23, 2024
    Copy the full SHA
    599fd33 View commit details
  2. Merge pull request #56 from jygastaud/52-asciidoc-support

    Fix update command
    phodal authored Aug 23, 2024
    Copy the full SHA
    17a3cda View commit details
  3. fix: fix test for #58 and #52

    phodal committed Aug 23, 2024
    Copy the full SHA
    a51687e View commit details
  4. chore(release): 1.5.1

    phodal committed Aug 23, 2024
    Copy the full SHA
    704551b View commit details
Showing with 9 additions and 6 deletions.
  1. +5 −2 CHANGELOG.md
  2. +1 −1 package.json
  3. +1 −1 src/lib/generate.ts
  4. +1 −1 src/lib/update.ts
  5. +1 −1 src/tests/generate.spec.ts
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,9 +2,12 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

=== [Unreleased]
### [1.5.1](https://github.com/phodal/adr/compare/v1.4.6...v1.5.1) (2024-08-23)

* Add support of Asciidoc

### Bug Fixes

* fix test for [#58](https://github.com/phodal/adr/issues/58) and [#52](https://github.com/phodal/adr/issues/52) ([a51687e](https://github.com/phodal/adr/commit/a51687e90b78977b859ff56dcd0031ff9bb27088))

### [1.4.5](https://github.com/phodal/adr/compare/v1.4.2...v1.4.5) (2023-05-19)

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adr",
"version": "1.5.0",
"version": "1.5.1",
"description": "轻量级架构记录工具 - Command-line tools for working with Architecture Decision Records",
"main": "build/main/index.js",
"bin": "build/main/cli.js",
2 changes: 1 addition & 1 deletion src/lib/generate.ts
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ function generateToc (options?: {output: boolean}) {
function generateAsciidocToc (options?: {output: boolean}) {
let path = Config.getSavePath()
let graphGenerate = new GenerateBuilder(path)
let header = '= ' + getI18n().tocHeader + '\n'
let header = '.' + getI18n().tocHeader + '\n'
let results = graphGenerate
.setStart(header)
.setEnd('')
2 changes: 1 addition & 1 deletion src/lib/update.ts
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ function updateNameByTitle (): void {
let fileName = file.relativePath
let fileExt = Config.getDocExtension()
let startChar = fileExt === 'adoc' ? '=' : '#'
let fileData = fs.readFileSync(savePath + fileName, 'let fileExt = Config.getDocExtension()utf8')
let fileData = fs.readFileSync(savePath + fileName, 'utf8')
let firstLine = fileData.split('\n')[0]
let indexRegexValue = new RegExp(String.raw`${startChar}\s(\d+)\.\s`, '')
let title = firstLine.replace(indexRegexValue, '')
2 changes: 1 addition & 1 deletion src/tests/generate.spec.ts
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ test('ADR: generate toc with asciodoc', t => {
let results = ADR.generate('toc')
console.log(results)
t.deepEqual(results,
`= 架构决策记录
`.架构决策记录
* xref:001-编写完整的单元测试.adoc[1. 编写完整的单元测试]
* xref:002-编写完整的单元测试.adoc[2. 编写完整的单元测试]`)