Git Product home page Git Product logo

bogdan-lyashenko / codecrumbs Goto Github PK

View Code? Open in Web Editor NEW
2.7K 2.7K 100.0 34.35 MB

Learn, design or document codebase by putting breadcrumbs in source code. Live updates, multi-language support and more.

Home Page: https://codecrumbs.io

License: BSD 3-Clause "New" or "Revised" License

JavaScript 90.78% Python 0.10% C++ 0.04% Java 0.08% PHP 0.49% TypeScript 2.43% C# 0.12% Kotlin 0.03% Ruby 0.02% Fortran 0.03% Haskell 0.02% HTML 0.05% Vue 0.11% Go 0.04% Perl 0.03% Standard ML 0.02% Lua 0.02% Dockerfile 0.04% SCSS 2.36% Less 3.21%
code cpp documentation-tool java javascript learning php python software-architecture typescript

codecrumbs's Introduction

My name is Bohdan and reading source code is my hobby and passion.

Few years ago I decided to learn React source code. It took quite some time, but as a result I published the open-source book “Under the hood ReactJs” which explains entire codebase with flowcharts.

First thing I realised after that I need some tool to generate flow chart images from JavaScript code. So a year later I built an open-source tool for that called “js2flowchart” which automatically generates flowcharts from JavaScript code.

Later, I discovered I still need something broader to cover entire codebase, something that can help marking important places in code, connections between files, etc. That's why I built “codecrumbs” (name is derived from “code” and “breadcrumb”). You can check out open-source version on Github.

While keep adding more features and learning more about the topic I got the vision that just a "library" won't solve it, it's time to step up the game and build an application with more systematic approach!

🔭 So currently I’m working on Codecrumbs v2, which standalone application with many cool features! Check out project here.

Follow alongside to see where it leads us.

codecrumbs's People

Contributors

0xflotus avatar agcb avatar andrewmherren avatar blackfyre avatar bogdan-lyashenko avatar ghsamm avatar idoo avatar jbcam avatar pyjarrett 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  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

codecrumbs's Issues

Ruby Support

Would it be possible to support Ruby?
I have to understand a lot of Ruby sources written by others.
Best Regards

Codecrumb number gets cut off

Numbers above 9 get cut off.

It would also be cool to be able to use more than numbers. A, B, C. Or even A.1, A.2, B, C.1, C.2 for branching stuff.

image

Wrong scroll position of code in Crumbs tab

I just started using codecrumbs, and I'm finding that the crumb code listings are not automatically scrolled to the crumb, they are scrolled to a vertical offset that is significantly smaller than the crumb offset, so that the crumb line is not visible unless I scroll it into view. :(

I peeked at the code, and the code for scrolling a crumb into view seems to hardcode a line height of 15. In practice, the line height is 18 (font size of 12px and line height of 1.5).

too many open files, uv_cwd

Client connected.
path.js:1084
          cwd = process.cwd();
                        ^

Error: EMFILE: too many open files, uv_cwd
    at Object.resolve (path.js:1084:25)

Can not access the url http://localhost:2018/

I am trying to view the result for https://github.com/blueimp/jQuery-File-Upload

PS C:\workspace\clu\Downloads> codecrumbs -d "C:\repository\GitHub\Other\jQuery-File-Upload" -e "C:\repository\GitHub\Other\jQuery-File-Upload\js\main.js"
>
> Codecrumbs magic begins!
>
> started with options: {"entryPoint":"C:\\repository\\GitHub\\Other\\jQuery-File-Upload\\js\\main.js","projectDir":"C:\\repository\\GitHub\\Other\\jQuery-File-Upload","clientPort":2018}
- starting: mediator server
+ started: mediator server, listening: 3018
- starting: http server for client assets
- starting: source watcher
+ started: http server for client assets,  codecrumbs client is served on http://localhost:2018
+ started: source watcher: source-project-1561830691215 for: project:C:\repository\GitHub\Other\jQuery-File-Upload;  setup: dir - C:\repository\GitHub\Other\jQuery-File-Upload, entry point - C:\repository\GitHub\Other\jQuery-File-Upload\js\main.js options: webPackConfig - ?, tsConfig - ?

However when I try to access result page, I got the following error:

This page isn’t working localhost sent an invalid response.
ERR_INVALID_REDIRECT

I also verified the port 2018, it was listening. And the network response from Chrome browser
image

I have tried to find the log of codecrumbs, but no lucky.

Highlighting and Auto-Focus in Code and Crumbs section of sidebar

Having multiple crumbs in one large file without it jumping to the respective comment in the code or crumb in the sidebar can result in a little tedious manual searching.

Also, highlighting in Code preview would also be sweet, as well as the option to close/open all crumbs (or just having the active one open [e.g. close current -> open next]).

Basically, some auto-focus features for the sidebar panels.

Error at getting repositorys

Looks like the path issue is fixed.

but now it throws an error at the dependecies option:

uncaught at reactByUpdatingFoldersState TypeError: Cannot read property 'dependencies' of undefined

on Tree.js

{dependenciesDiagramOn && selectedNode.dependencies && ( <DependenciesTree namespace={namespace}

Originally posted by @Motytheultimate in #14 (comment)

Multiple crumbs view is skewed

Hello, I'm playing with CC comments in my Go backend with lots of microservices, currently I'm trying to document a single flow of user authorization, that is split between different files. I'm using numbered code crumbs, but the view is getting skewed and not readable in the end, e.g.

screenshot 2019-02-20 at 18 21 29

I have multiple numbered CC's in the same file, so the view orders them not by the tailing order, but in the order of location in files. It think this is an issue, any suggestions how to avoid this?

Java project doesnt work

codecrumbs

Hi, I'm trying to test codecrumbs with my java project and its doesnt work.
When I ran codecrumbs, my console stops here.

Not valid paths error

Why does it say Not valid paths though those paths do exist?

phuc_thai@linuxsws009:~/Documents/lottery-result-crawler$ l
main.py  requirements.txt
phuc_thai@linuxsws009:~/Documents/lottery-result-crawler$ codecrumbs -d ~/Documents/lottery-result-crawler -e ~/Documents/lottery-result-crawler/main.py 
>
> Codecrumbs magic begins!
>
> started with options: {"entryPoint":"/home/phuc_thai/Documents/lottery-result-crawler/main.py","projectDir":"/home/phuc_thai/Documents/lottery-result-crawler","clientPort":2018}
Not valid paths. Please enter valid path, next path does not exist: /home/phuc_thai/Documents/lottery-result-crawler, /home/phuc_thai/Documents/lottery-result-crawler/main.py

Support Nodejs

Hi,

This project looks really cool! Sorry if am being dumb or not looking for more info. But I can't seems to work this with my node-boilerplate. I added it as dependency and running it with this syntax.

$ npx codecrumbs -d src -e index.js

Environment

  • Node/NPM - 10.7/6.1
  • MACOS - Mojave(10.14.3)

Typescript dependencies support

I don't seem to be able to display components hierarchy links (as per JS files) for a project with .tsx react component files.

Codecrumbs text get cut off

First of all, awesome package!!!👏👏👏

I am using Codecrumbs to document a new C# project at work. I ran into an issue when my descriptions are too long and they get cut off from the svg. See below.

image

only entry shown

Hi there, I've tried running this on multiple codebases and I only ever see the entry.

For example, from a pretty close to vanilla create-react-app:

Codecrumbs: better way to navigate the code maze! 2019-03-14 20-46-04

Is this the expected behavior or am I doing something wrong? Thanks!

Codecrumbs views don't finish loading

My Codecrumbs browser is in a perpetual loading state. I've added some logging on my end and it seems to be parsing the //cc comments properly, so I can't figure out why there is no visualisation.

Browser
codecrumbs

Debug
parsed

Vue Support

Any future plans to support Vue.js?
Thanks

Add Golang Support

Please add Golang support or comment on how to add support and I’ll add a PR.

fortran support

i want understand camb fortran, so analysis fortran by this program.

[IDEA] Think about usage of js-callgraph project

Hello people and firstly I should to say you are amazing ⭐ ! Great project ! So long I've searched for something that can help me to understand huge codebase more faster, and I found it I think !

I just want to point you (but maybe you've already seen that) to look into js-callgraph project, maybe it can somehow to help you to create more features

Corrupted Content Error

Firefox displays this content when attempting to run codecrumbs against a simple, working react project.

Tested with 2 separate projects.

Corrupted Content Error

The site at http://localhost:2018/ has experienced a network protocol violation that cannot be repaired.

The page you are trying to view cannot be shown because an error in the data transmission was detected.

    Please contact the website owners to inform them of this problem.

I am not sure what additional information would be helpful. I also tried this in Opera. I am very interested in getting this working and any assistance will be appreciated.

Error at path

hi there seems to be an error in your sidebar.js and a few more.
i tried it with running your project directly from your sources.

the error i get is the follwing

uncaught at reactOnSourceSet TypeError: Cannot read property 'path' of undefined
On example is at the follwing

  <React.Fragment>
  <div>{file.path}</div>
  <div className={'copyIcon'}>
    <Copy copyText={file.path} />
  </div>
</React.Fragment>

in sidebar js
https://github.com/Bogdan-Lyashenko/codecrumbs/blob/master/src/public/js/components/sideBar/component/SideBar.js

Accept comments with spaces

Currently, the following works:

//cc:authenticate#1;use case

But this way codecrumbs cannot detect the following:

// cc:authenticate#1;use case

Problem is that many popular linting rules for Javascript (like airbnb's or prettier) requires the space between the // and the comment.

If someone has auto-linting setup, then codecrumbs will not work.

Add support for block comments

This is just a place holder issue to add support for block comments like /* comment */

This should be fairly straight forward with ast parser since the comments array includes comments of both type CommentLine and CommentBlock however this will be challenging as support is added for languages for which the ast parser cannot be used.

C# Support

Would it be possible to support C#?
I'm developing game by Unity.
Best Regards

Multiple crumbs in the same file

It seems that currently only one crumb per file is supported, however it would be incredibly useful if there was a way to do multiple crumbs.

The particular use case I am thinking of is a file (like a reducer) that might be involved in more than one trail.

PS Thanks for your work on this package, its a brilliant idea!

Crashes with "EMFILE: too many open files" on large projects

My project has 35,085 files in 3,652 directories. When I load the web interface, it fails with:

Error: EMFILE: too many open files, open '/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/DirectoryWatcher.js'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:348:35)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:809:20)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at require (internal/modules/cjs/helpers.js:14:16)
    at WatcherManager.getDirectoryWatcher (/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/watcherManager.js:14:25)
    at WatcherManager.watchDirectory (/usr/local/lib/node_modules/codecrumbs/node_modules/watchpack/lib/watcherManager.js:32:14)

macOS 10.14.3
Node 11.11.0
codecrumbs 0732382

SyntaxError: Unexpected token ...

Good evening!
I try to run your app for my project and get error from header of this issue.

Error from terminal:
1  bash 2019-03-15 23-29-03

Project structure and client.js:
~Documentsdevsnpfantasy-websitesrcclient js — fantasy-website 2019-03-15 23-30-54

What should I do to start cc correctly?
Thank you for answer.

Display "Dependents"?

Thank you for creating such a cool tool! Is there currently a way to click on a file and find all of the other files that import/reference it?

Mobile layout is mess

Try to run app in 'mobile' mode via dev tools - top bar menu is not usable, separate behaviour for mobile need to be implemented

Kotlin Support

Hi.
Would it be possible to support Kotlin?
I'm developing Android app by Kotlin.

I would be happy if you would consider it.
Thanking you in advance:)

cant get it started

'codecrumbs' is not recognized as an internal or external command,
operable program or batch file.

created a dir '\devDependencies', ran yarn

Haskell support

Cool project!

Would it be possible to support Haskell? Comments in Haskell are:

-- inline comment
{- block comment -}

Golang support

Hello. Would it be possible to support Golang? i can also provide some support

Perl support

Hello . Would it be possible to support Perl?

Store codecrumbs in separate files

This optional feature would be really helpful when you need to analyse a project without modifying the source files. Examples include SCM/VCS tools (Git, Mercurial) and build tools that detect the changes in source files to decide what to recompile (Make, Ninja).

Similar approach of (optionally) using separate "stub" files is described in Python's PEP 484, in that case, *.pyi files contain type annotation stubs. There are two use cases that may be as well applied to Codecrumbs:

Third-party modules whose authors have not yet added type hints
Standard library modules for which type hints have not yet been written

Cannot parse certain ES6+ syntaxes

( Possibly related to js2flowchart )

When trying to parse certain ES6+ syntax, the AST parser throw an error:

Error at parseCodeToAST: This experimental syntax requires enabling the parser plugin: 'classProperties' (XX:YY)

An example of this code would be:

class ExampleComponent extends React.Component {
	constructor(props) {
		super(props)
	}
	// Error triggers on the line below
	state = {
		isLoading: false
	}
	// . . .
}

How does one enable classProperties over @ codecrumbs?

codecrumbs: command not found

Screenshot 2019-05-03 at 11 43 27

Tried following the tips in issue #17 - but I still can not use the codecrumbs command.
Also tried updating "ecstatic" but I get the same warning.
Any ideas what's going on here?

Edit: Noticed there's a typo in my screenshot. Also using command codecrumbs -d src -e src/index.js was not effective

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.