1.8.3 • Published 3 years ago

codecrumbs v1.8.3

Weekly downloads
284
License
BSD-3-Clause
Repository
github
Last release
3 years ago

npm version Open Source Love

What

Have you ever got lost in a big or unknown codebase? This tool will help you to solve that. Also, it will increase your development speed and give more knowledge about your application architecture.

How it works? You run codecrumbs command for a codebase, it analyzes source code and builds its visual representation. Write down a codecrumb-comment and codebase state will be reflected by visual client in browser on the fly.

Check out my talk at React-Finland for more details.

If you like this project, follow me on Twitter @bliashenko to hear about things I am building.

Demo

Check out the example of standalone version running here.

Get started

Install and run

Pre-condition: update/install NodeJS version to be >= 8.11.1

1) Install codecrumbs globally (yarn global add codecrumbs) 2) Run codecrumbs -d project-src-dir -e project-src-dir/index.js. Change parameters to match your project:-d is directory with source code, -e is entry point file . 3) Go to http://localhost:2018 in the browser to check it out.

Configuration

Run codecrumbs with CLI params or specify static config file codecrumbs.config.js (see example here)

CLIConfig fileDescriptionExample
dprojectDirRelative path to project source code directory-d src
eentryPointRelative path to project source entry point file (must be inside dir)-e src/app.js
xexcludeDirRelative path(or paths separated by ,) to directories for exclusion-x src/doc,src/thirdparty
pclientPortPort for Codecrumbs client (optional, default 2018)-p 2019
nprojectNameAliasProject name alias (optional, default same as -d value)-n my-hello-world
C-Path to codecrumbs.config.js (optional, by default will try to find the file in PWD)-C config/codecrumbs.config.js
DdebugModeEnabledEnable debug mode for logs (optional, default is false)-D

Features

Breadcrumbs and trails

UI explained:

  • enable "Codecrumbs" switch to have codecrumbs tree on the scheme (drop-down contains extra configuration)
  • choose "current" codecrumbs trail to display (can be either trail or all other "simple" codecrumbs)
  • select connection between two steps (code for two codecrumbs will be opened in "Sidebar" under "Crumbs" tab)
  • set other options in dropdowns to configure behaviour of the diagram (show code blocks, details, etc.)

How to get there?

Leave breadcrumb in code by writing down a comment: //cc:[parameters;].

cc (stands for "CodeCrumb") is a prefix which used by the parser; check example of parameters in the table below:

ExampleDescriptionUse case
//cc:remember placesimple breadcrumb, remember place is a title of our first breadcrumbMark an important place to not forget where it was
//cc:here is bug;well, seems like a bug in logicsimple breadcrumb, well, seems like a bug in logic is details for breadcrumb, separated by ;Add extra information, will be rendered in popups
//cc:signin#3;enable routetrail of breadcrumbs,signin is the trail ID, #3 is order number of step, enable route is a title describing the step.A sequence of codecrumbs, use to describe some data flow (e.g. user login, or form submit, etc.).
//cc:signin#1;firebase sign in;+2;do call to firebase with credentialstrail of breadcrumbs,+2 is number of lines to highlight, separated by ;Use number of lines to highlight the code related to breadcrumb

Note: current version supports single line comments only.

Hint: you can use trail id without step number (e.g. //cc:groupname#;test) just to group breadcrumbs, you always can add step numbers later when you know the correct order.

Multi-codebase integration

You might be interested to study connections between several codebases (sub-modules), codecrumbs supports that. Simply start codecrumbs multiple times (once for each codebase), it all will be synced in one picture inside the browser tab. To control a diagram UI - select it by clicking on it.

E.g. for client-server application, go to the source directory for your server code and run codecrumbs -e your-server-src/index.py -d your-server-src, same for client codecrumbs -e src-client/index.js -d src-client.

Note: codebases can be located wherever you want (no need to have them like mono-repo, etc.), simply run codecrumbs for directory you need.

Multi-language support

Current version supports next programming languages:

  • C#
  • C++
  • Fortran
  • Go
  • Haskell
  • Java
  • JavaScript
  • Kotlin
  • PHP
  • Python
  • Ruby
  • TypeScript

Please file an issue to support other language you would like to have.

Dependencies

Note: In current version only JavaScript, TypeScript offer this feature

UI explained:

  • enable "Dependencies" switch
  • select connection between modules (all involved files will be opened in "Sidebar", so you can see “what is imported” and “its implementation”)

Flowchart

Note: In current version only JavaScript offers this feature

js2flowchart is used in the sidebar to draw flowchart for the selected file code.

Support

Any support is very much appreciated! 👍 😘 ❤️ If you like this project, please, put a :star: and tweet about it. Thanks!

Please, consider making financial donation, it will help further development of more cool features! We'll thank you by including your name/company logo here ☺️. Feel free to ping me for discussion.

Sponsors

Development supported by 0+X

Backers

Contribute

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owner of this repository before making a change. Ideas and suggestions are welcome. To start development environment, clone the repo & run:

yarn && yarn start

WIP

Next features are developing:

  • VS Code extension - some neat features right inside the code editor. Checkout the repo here.
1.8.3

3 years ago

1.7.3

5 years ago

1.7.2

5 years ago

1.7.1

5 years ago

1.7.0

5 years ago

1.6.18

5 years ago

1.6.17

5 years ago

1.6.16

5 years ago

1.6.15

5 years ago

1.6.14

5 years ago

1.6.13

5 years ago

1.6.12

5 years ago

1.6.11

5 years ago

1.6.10

5 years ago

1.6.9

5 years ago

1.6.8

5 years ago

1.6.7

5 years ago

1.6.6

5 years ago

1.6.5

5 years ago

1.6.4

5 years ago

1.6.3

5 years ago

1.6.2

5 years ago

1.6.1

5 years ago

1.6.0

5 years ago

1.5.7

5 years ago

1.5.6

5 years ago

1.5.5

5 years ago

1.5.4

5 years ago

1.5.3

5 years ago

1.5.2

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.14

5 years ago

1.2.13

5 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16-alpha

5 years ago

1.0.15-alpha

5 years ago

1.0.14-alpha

5 years ago

1.0.13-alpha

5 years ago

1.0.12-alpha

5 years ago

1.0.10-alpha

5 years ago

1.0.9-alpha

5 years ago

1.0.8-alpha

5 years ago

1.0.5-alpha

5 years ago

1.0.4-alpha

5 years ago

1.0.3-alpha

5 years ago

1.0.2-alpha

5 years ago

1.0.1-alpha

5 years ago

1.0.0-alpha

5 years ago