包详细信息

jsarch

nfroidure34.6kMIT6.1.2

A simple module to extract architecture notes from your code.

architecture, documentation

自述文件

jsarch

A simple module to extract architecture notes from your code.

GitHub license

Usage

To generate any project's architecture notes:

jsarch src/*.js > ARCHITECTURE.md

Configuration

You can set your own configuration by adding a jsarch property in your package.json file (see the defaults).

For example, if you which to have TypeScript support and you use Gitlab instead of GitHub, just add this:

{
    // (...)
    "jsarch": {
        "gitProvider": "bitbucket",
        "parserOptions": {
          "plugins": ["typescript"]
        }
    }
    // (...)
}

Per default, the Babel parser is used, but you can change it with the parser option. You'll have to install it before using it.

Development

To get involved into this module's development:

npm i -g jsarch

git clone git@github.com:nfroidure/jsarch.git

cd jsarch

npm it
npm run build

node bin/jsarch **/*.js > ARCHITECTURE.md

Architecture Notes

You can see this repository architecture notes for an example of the kind of content generated by this module.

API

initJSArch(services) ⇒ Promise.<function()>

Declare jsArch in the dependency injection system

Kind: global function

Param Type Default Description
services Object Services (provided by the dependency injector)
services.CONFIG Object The JSArch config
services.EOL Object The OS EOL chars
services.glob Object Globbing service
services.fs Object File system service
services.parser Object Parser service
[services.log] Object noop Logging service

initJSArch~jsArch(options) ⇒ Promise.<String>

Compile an run a template

Kind: inner method of initJSArch
Returns: Promise.<String> - Computed architecture notes as a markdown file

Param Type Description
options Object Options (destructured)
options.cwd Object Current working directory
options.patterns Object Patterns to look files for (see node-glob)
options.eol Object End of line character (default to the OS one)
options.titleLevel Object The base title level of the output makdown document
options.base Object The base directory for the ARCHITECTURE.md references

Authors

License

MIT

更新日志

6.1.2 (2024-12-04)

6.1.1 (2024-12-04)

6.1.0 (2024-10-29)

6.0.4 (2024-07-15)

6.0.3 (2023-08-16)

6.0.2 (2023-08-12)

6.0.1 (2023-03-09)

6.0.0 (2022-08-30)

5.0.2 (2022-05-25)

5.0.1 (2021-11-11)

Features

  • title-anchor: correct title anchor computation for level 2+ nested (092fa1f)

5.0.0 (2021-10-31)

Bug Fixes

  • summary: set summary as a markdown list (390876a)
  • tests: fix the tests before publishing (4b9a56e)

Features

  • summary: add an auto generated summary at the beginning of architecture.md file (2195a06)
  • summary: add number to titles (882ff3a)

4.0.1 (2021-04-09)

4.0.0 (2021-04-09)

3.0.0 (2020-05-17)

2.0.3 (2019-06-11)

2.0.2 (2019-02-10)

Bug Fixes

  • RegExp: Fix notes detection when a $ is in the title (dcbc031)

2.0.1 (2019-01-13)

Bug Fixes

  • CONFIG: Fix package.json configuration for edge cases (5ddc915)
  • Documentation: Add missing docs (eb3dc50)

2.0.0 (2019-01-12)

Features

  • configuration: add configuration support (.jsarchrc or package) (5b79a9d)

1.3.0 (2018-02-05)

Features

  • jsarch.js: switch from HTML comment to most compatible Markdown version (b901e4b)

1.2.7 (2018-02-01)

Bug Fixes

  • AST: Fix AST traversal for experimental features (000b2d5)

1.2.6 (2017-12-02)

1.2.5 (2017-12-02)

1.2.4 (2017-12-02)

1.2.3 (2017-11-08)

Bug Fixes

  • Parser: Fix parser source type configuration (6e3e816)

1.2.2 (2017-11-08)

Bug Fixes

  • Parser: From recast to espree (afc9015), closes #7

1.2.1 (2017-04-11)

Bug Fixes

  • cli: Fix the base CLI option (0e93178)
  • ordering: Fix Architecture notes ordering and add tests for it (caa0839)

1.2.0 (2017-03-16)

Features

  • indent: Take care of indentation (063ffdc), closes #1

1.1.3 (2017-03-14)

Bug Fixes

  • dependencies: Fix forgotten dependency (18fc72a)

1.1.2 (2017-03-14)

1.1.1 (2017-03-11)

Bug Fixes

  • docs: Fix the architecture file output (29f994d)

1.1.0 (2017-03-11)

Features

  • output: Add a prefix to the outputted architecture notes (6ff89f8)

1.0.0 (2017-03-10)

Features

  • First working version: This is the first working version, it generates the architecture notes (51b9b4e)