Git Product home page Git Product logo

phodal / adr Goto Github PK

View Code? Open in Web Editor NEW
252.0 6.0 49.0 3.04 MB

Architecture Decision Records in Node.js with Reporter, supported Windows, GNU/Linux, macOS - 轻量级架构决策记录工具

Home Page: https://phodal.github.io/adr/

License: MIT License

JavaScript 4.33% TypeScript 70.94% HTML 24.73%
architecture-decision-records adr architecture-decision decision-records architecture-doc architecture-visualization architecture-guidelines

adr's Introduction

ADR - Architecture Decision Records(轻量级架构决策记录工具)

ADR - Architecture Decision Records(轻量级架构决策记录工具)

Build Status codecov.io Maintainability

Markdown Improve node npm

Inspired by https://github.com/npryce/adr-tools, but supported Windows.

ADR Blogpost: Documenting Architecture Decisions

A good material about Architecture decision record

中文翻译:架构决策记录

功能特性

  • 支持 Windows, GNU/Linux, Mac OS
  • Markdown 目录生成
  • 为项目经理、业务人员等非开发人员,生成报表:HTML,CSV, JSON
  • 兼容 adr-tools
  • 国际化支持:English、中文、Brazilian Portuguese (pt-br), Standard Italian (it-IT)
  • 状态历史
  • 状态查询
  • 更好的列表展示
  • 兼容 adr-tools

查看本项目的架构决策记录

Features

  • Supported Windows, GNU/Linux, Mac OS
  • report for PM, BA: html, csv, json
  • generate markdown toc(see in docs/adr
  • i18n: English (en), 中文(zh-cn), Brazilian Portuguese (pt-br), Standard Italian (it-IT), Farsi (fa), French (fr)
  • status logs
  • status query
  • better list view
  • compatible adr-tools
  • custom templates: add a template.md file in the save path

HTML Reporter Example

Screenshots

ADR List

List Examples

ADR Reporter

Reporter Examples

Install

  1. install
npm install -g adr
  1. init
adr init <language>

e.x: adr init en

new

adr new <decision>

e.x: adr new "create project". It will open the new file with your config editor

list

adr list

result:

╔══════════════════════════════════════╤══════════════╤═══════════════════╗
║ Decision                             │ Last Modified│ Last Status       ║
╟──────────────────────────────────────┼──────────────┼───────────────────╢
║ 1.编写完整的单元测试                    │ 2017-11-26   │ 2017-11-26 已完成  ║
╟──────────────────────────────────────┼──────────────┼───────────────────╢
║ 2.添加目录生成                         │ 2017-11-26   │ 2017-11-25 已完成  ║
╟──────────────────────────────────────┼──────────────┼───────────────────╢
║ 3.图形生成功能                         │ 2017-11-26   │ 2017-11-24 已完成  ║
╟──────────────────────────────────────┼──────────────┼───────────────────╢
║ 4.生成在线图形                         │ 2017-11-26   │ 2017-11-22 提议    ║
╚══════════════════════════════════════╧══════════════╧═══════════════════╝

generate toc

adr generate toc

results:

# Architecture Decision Records

* [1. 编写完整的单元测试](001-编写完整的单元测试.md)
* [2. 添加目录生成](002-添加目录生成.md)
* [3. 图形生成](003-图形生成.md)

generate graph

adr generate graph

results:

digraph {
  node [shape=plaintext];
  _1 [label="1.编写完整的单元测试"; URL="001-编写完整的单元测试.md"]
  _2 [label="2.添加目录生成"; URL="002-添加目录生成.md"]
  _1 -> _2 [style="dotted"];
  _3 [label="3.图形生成"; URL="003-图形生成.md"]
  _2 -> _3 [style="dotted"];
}

update filename by title

adr update

decisions change logs

adr logs <index>

e.x. adr logs 9

╔════════════╤══════╗
║  -         │  -   ║
╟────────────┼──────╢
║ 2017-11-23 │ 提议 ║
╟────────────┼──────╢
║ 2017-11-24 │ 通过 ║
╚════════════╧══════╝

export adr

support: json, csv, html, markdown

adr export <type>

e.x. adr export csv

Index, 决策, 上次修改时间, 最后状态
1, 编写完整的单元测试, 2017-11-26, 2017-11-26 已完成
2, 添加目录生成, 2017-11-26, 2017-11-25 已完成
3, 图形生成功能, 2017-11-26, 2017-11-24 已完成

search adr

adr search <keyword>

e.x. adr search 测试

╔══════════════════════╤══════════════════╗
║ 决策                 │ 最后状态         ║
╟──────────────────────┼──────────────────╢
║ 19.添加-e2e-测试     │ 2017-11-28 提议  ║
╟──────────────────────┼──────────────────╢
║ 1.编写完整的单元测试 │ 2017-11-26 完成  ║
╚══════════════════════╧══════════════════╝

Config

current:

  • language, language
  • path, save path
  • digits, the index length, e.x. digits:3 001-index.md
  • prefix, the prefix of files, e.x. adr-0001
  • editor, the editor to open file, e.x. code, more information, and you can also use the editor by setting the program path, such as /System/Applications/TextEdit.app/Contents/MacOS/TextEdit
  • force_nfc, whether to normalize the names of files generated by adr commands in NFC (Normalization Form Canonical Composition) format, e.x. true

example config:

{
  "path":"doc/adr/",
  "language":"zh-cn",
  "prefix": "",
  "digits": 4,
  "editor": "code",
  "force_nfc": true
}

License

Phodal's Idea

@ 2017~2021 A Phodal Huang's Idea. This code is distributed under the MIT license. See LICENSE in this directory.

adr's People

Contributors

amirasghary avatar bdukes avatar dependabot[bot] avatar drakasan avatar mathieulavignecc avatar matmilbury avatar molingyu avatar phodal avatar reply2future avatar rindrics avatar silentscripter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adr's Issues

How to properly use command syntax

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

I do not know how to use the command syntax from the CLI.

For instance, when I use this syntax :

adr -n "Title"

It works. But when I use that one :

adr new "Title"

I get no result at all, no error, no file created. I use Ubuntu 20.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

It seems to me that the commander options, for instance this one :

.option('-n, new <title...>', 'create new ADR', create)

should be replaced with that :

.option('-n', 'create new ADR', create)
.command('new <title>')
  .description('create new ADR')
  .action(create)

I must be wrong because people may have already noticed it, but I don't know then, which is the good syntax.

Add trailing newline to TOC

  • I'm submitting a ...
    [ X] feature request

  • Summary
    The autogenerated TOC has no trailing newline.

This is problematic if you run a markdown linter that lints according to the commonmark spec. Since we autogenerate (adr -u) the TOC and we do linting in a continuous integration context this always fails.

A flag for adr -u to add a newline after generation would be useful.

README.md:3 MD047/single-trailing-newline Files should end with a single newline character

As a workaround I changed line 47 to following:

fs.writeFileSync(savePath + 'README.md', toc + "\n");

This is not very elegant and maybe not be platform independent.

As reference I filed an issue in the wrong repo first see

Custom template.md is included in the html export

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Custom template.md is included in the html export

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

No such file docs/adr/undefined

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    I have just one DR.

I execute yarn adr list 2

I get an error Error: ENOENT: no such file or directory, open 'docs/adr/undefined'

Want to force name of generated files normalized in NFC format

  • I'm submitting a ...
    [ ] language request
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

    • use case:
      • I have a CI set up on GitHub that ensures an adr update is run against the ADR directories in my repository
        • Specifically, when I push a branch, CI executes adr update command on ADR directories
          • CI fails if there is any difference
      • The problem is when I commit an ADRs with NFD-typed characters in their titles
        • Currently, the file name generated by adr update also contains NFD characters
        • However, if I push this branch to GitHub, "only" the filenames are implicitly converted to NFC type, so adr update on CI continues to generate NFC -> NFD filename diffs
      • I want to force nam of generated files normalized in NFC format
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

HTML Comments not having the right language

  • I'm submitting a ...
    [x] language request
    [ ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Please remove HTML comments in Cantonese: When exported to HTML, the language is not being picked up.

adr detail CLI

  • I'm submitting a ...
    [ ] language request
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

Show detail information in terminal

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

$ adr command not found in version 1.4.2

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

  • npm i adr -g

  • adr

Expected

  • $adr -> shows info

Actual

image

'strict-type-predicates' error occurs on `yarn test`

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

I encountered the error below when I executed yarn test on 7da4097:

❯ yarn test
yarn run v1.22.19
$ yarn lint && yarn unit && nyc report --reporter=lcov && yarn check-coverage
$ tslint --project . src/**/*.ts
/Users/akirahayashi/dev/adr/src/lib/cache.ts:47:12
ERROR: 47:12  strict-type-predicates  Expression is always true.
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

I avoided the error on my branch: https://github.com/Rindrics/adr/tree/avoid-strict-type-predicates-error

bug report: export command error

adr export csv and adr export json error!

csv:

adr export CSV
{ Error: ENOENT: no such file or directory, open 'undefined0001-test.md'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.readFileSync (fs.js:568:33)
    at getAllStatus (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/StatusHelper.js:37:23)
    at Object.getLatestStatus (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/StatusHelper.js:56:21)
    at buildFunc (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output/CSVBuilder.js:13:49)
    at /home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/base/GenerateBuilder.js:23:17
    at Array.forEach (<anonymous>)
    at GenerateBuilder.setBody (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/base/GenerateBuilder.js:15:20)
    at CSVBuilder.buildContent (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output/CSVBuilder.js:25:14)
    at output (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output.js:26:26)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'undefined0001-test.md' }

json:

adr -o json
{ Error: ENOENT: no such file or directory, open 'undefined0001-test.md'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.readFileSync (fs.js:568:33)
    at getAllStatus (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/StatusHelper.js:37:23)
    at Object.getLatestStatus (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/StatusHelper.js:56:21)
    at buildFunc (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output/JSONBuilder.js:12:49)
    at /home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/base/GenerateBuilder.js:23:17
    at Array.forEach (<anonymous>)
    at JsonGenerateBuilder.setBody (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/base/GenerateBuilder.js:15:20)
    at JSONBuilder.buildContent (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output/JSONBuilder.js:25:14)
    at output (/home/shitake/.nvm/versions/node/v9.3.0/lib/node_modules/adr/build/main/lib/output.js:26:26)
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'undefined0001-test.md' 

Cannot create new file (Node 16)

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

I just get start with this tool.

I was sending this command on the CLI (I already init the folder - it worked):

adr new "no need for monorepo"

This is the error message:

/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/build/main/lib/create.js:35
    console.log(i18n.logSavePath + savePath);
                     ^

TypeError: Cannot read properties of undefined (reading 'logSavePath')
    at create (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/build/main/lib/create.js:35:22)
    at /Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/build/main/cli.js:23:29
    at Array.forEach (<anonymous>)
    at Command.<anonymous> (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/build/main/cli.js:23:12)
    at Command.listener [as _actionHandler] (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/node_modules/commander/index.js:413:31)
    at Command._parseCommand (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/node_modules/commander/index.js:914:14)
    at Command._dispatchSubcommand (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/node_modules/commander/index.js:865:18)
    at Command._parseCommand (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/node_modules/commander/index.js:882:12)
    at Command.parse (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/node_modules/commander/index.js:717:10)
    at Object.<anonymous> (/Users/anton/.nvm/versions/node/v16.14.1/lib/node_modules/adr/build/main/cli.js:78:9)
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Any idea? Am I doing it wrong?

adr list should not show a list of files before table

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    Currently adr list prints a list of files before printing the ADR table list:

$ adr list
docs/adr/0001-implementation-of-decision-records.md
docs/adr/0002-implementing-nx-framework.md
╔══════════════════════════════════════╤════════════════════╤═════════════════════╗
║ Decision                             │ Last Modified Date │ Last Status         ║
╟──────────────────────────────────────┼────────────────────┼─────────────────────╢
║ 1.Implementation of Decision Records │ 2022-11-26         │ 2022-11-26 accepted ║
╟──────────────────────────────────────┼────────────────────┼─────────────────────╢
║ 2.implementing NX Framework          │ 2022-11-26         │ 2022-11-26 proposed ║
╚══════════════════════════════════════╧════════════════════╧═════════════════════╝

that list of files should be removed.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Does it miss the important step after using the command `adr new`

  • I'm submitting a ...
    [ ] language request
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [x] question about how to use this project

  • Summary

As README.md mentioned, there is no other informations to explain how to do next after using adr new command. It's confused and console prints the save directory path. So I think it's important to add more informations what to do next.

I found adr-tools using the environment variable to open new file with which editor, so it would be better to use some package(such as open-in-editor) to implement this feature and adding the editor configuration.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
  1. open-in-editor
  2. launch-editor

adr export Markdown fails

  • I'm submitting a ...
    [ ] language request
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    yarn adr help export says: 'export ADR reporter in HTML, CSV, JSON, Markdown'

but

yarn adr export Markdown fails

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Support for using Asciidoc rather than Markdown

  • I'm submitting a ...
  • language request
  • bug report
  • feature request
  • question about the decisions made in the repository
  • question about how to use this project
  • Summary

It would be really handy if the tool was also supporting writing ADR using Asciidoc.
Asciidoc is quite popular too, and has interesting 3rd party tooling for aggregating documentation or publishing documentation to Confluence for example.

So it would be nice if the adr tool would let you chose between Markdown and Asciidoc, while keeping Markdown as default.

Regular Expression Denial of Service in markdown

  • I'm submitting a ...
    [ ] language request
    [ x ] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary
    GHSA-wx77-rp39-c6vg

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
    Please switch from unmaintained markdown package to something else. I'm not feeling in a good position to propose any alternatives.

Asset compression support

  • I'm submitting a ...
    [X] feature request

  • Summary
    What do you think about adding support for asset-compression (images specifically)?

The total asset size for ADR can get out of hand over time.

We added a basic image compression system to our repo for ADRs using the sharp library with caching in mind. I can work on adding it to this library as well.

Detect custom template.md

  • I'm submitting a ...
    [ ] language request
    [ ] bug report
    [x] feature request
    [ ] question about the decisions made in the repository
    [ ] question about how to use this project

  • Summary

Detect if a template.md file exists in savePath (specified in config) and use it before using default templates.

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.