Compare commits
278 Commits
multy-serv
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31ca6f4a78 | ||
|
|
1f9bc3a2d3 | ||
|
|
aad81bedbd | ||
|
|
1158c5fc1d | ||
|
|
a9727b990d | ||
|
|
a9f94a2cfa | ||
|
|
eb0b9bfc40 | ||
|
|
b4e1a99add | ||
|
|
c21d3ff504 | ||
|
|
2957d95133 | ||
|
|
d6ce727b0c | ||
|
|
c18c9fadd1 | ||
|
|
dce33716d9 | ||
|
|
cf8ba61943 | ||
|
|
26383aa79d | ||
|
|
136bd77d5f | ||
|
|
ba6620f040 | ||
|
|
4a8e7b7dc8 | ||
|
|
6ca48eb537 | ||
|
|
2864a098ab | ||
|
|
fec0cceba6 | ||
|
|
3bf39ce1b0 | ||
|
|
3a047b5bbe | ||
|
|
50145d4d1a | ||
|
|
4df2e8a48b | ||
|
|
3dae451776 | ||
|
|
4d038f37b3 | ||
|
|
a09ef4df65 | ||
|
|
628862d024 | ||
|
|
af83be1fcc | ||
|
|
05cb5527e3 | ||
|
|
7d910a0f75 | ||
|
|
ab74f6426e | ||
|
|
390bb8ff67 | ||
|
|
fcd108f9e7 | ||
|
|
dd2c6ee3d2 | ||
|
|
9917425cc8 | ||
|
|
3f54ca11a1 | ||
|
|
e059f800d6 | ||
|
|
f2dec10c05 | ||
|
|
d8117eac7d | ||
|
|
354514818c | ||
|
|
4ac814be93 | ||
|
|
2f7387a67f | ||
|
|
1cf779c5a6 | ||
|
|
64c9a75d92 | ||
|
|
5a8c4e6a9b | ||
|
|
2fd728b5e8 | ||
|
|
9bda1672d5 | ||
|
|
101eade38f | ||
|
|
6a1c8bcd75 | ||
|
|
c49a09e721 | ||
|
|
d526ded04b | ||
|
|
06344bee72 | ||
|
|
f9f67ff9ea | ||
|
|
9e519166d5 | ||
|
|
1b649bbe96 | ||
|
|
9ed305c08b | ||
|
|
dfebfa20a2 | ||
|
|
564c81362e | ||
|
|
d938ea3ef1 | ||
|
|
beceb476d9 | ||
|
|
ca882e4568 | ||
|
|
227c626c3a | ||
|
|
c3606e3c3e | ||
|
|
ae9ffccf65 | ||
|
|
897dcb8c3b | ||
|
|
38e1fdeeda | ||
|
|
c94e587675 | ||
|
|
5354dad9fe | ||
|
|
cbbab432e4 | ||
|
|
e21ab82729 | ||
|
|
987a98732a | ||
|
|
3ddfda80ed | ||
|
|
3e5da523ce | ||
|
|
6f6625d3db | ||
|
|
e9b4331d60 | ||
|
|
b7e5b70df7 | ||
|
|
ec04a20b8d | ||
|
|
7b51b8db72 | ||
|
|
fddb08554d | ||
|
|
14116c24b8 | ||
|
|
9307cf6259 | ||
|
|
39de752084 | ||
|
|
d50783bb7f | ||
|
|
2f22563d8d | ||
|
|
a0c7c134d3 | ||
|
|
e8d08572c6 | ||
|
|
0191bde3e6 | ||
|
|
5c738d8f4d | ||
|
|
6ca8817108 | ||
|
|
b9f5c0b40e | ||
|
|
c89cfec0c8 | ||
|
|
85840a9fa6 | ||
|
|
a9ff99d48e | ||
|
|
160fdaef88 | ||
|
|
c020a739c4 | ||
|
|
3b6e34fed8 | ||
|
|
e4d09f118d | ||
|
|
662adb7bda | ||
|
|
9c479f4462 | ||
|
|
447da26e16 | ||
|
|
9878e59a1b | ||
|
|
af0530c764 | ||
|
|
30067567ab | ||
|
|
501509f4df | ||
|
|
b0edfdc976 | ||
|
|
4745ed2242 | ||
|
|
4112828108 | ||
|
|
17e5edc17d | ||
|
|
24a0f6f6c4 | ||
|
|
76975298f0 | ||
|
|
770ae6d5cf | ||
|
|
25fdb28540 | ||
|
|
6a026e0039 | ||
|
|
edb8cd0ba7 | ||
|
|
0908fcab89 | ||
|
|
ceb18f613f | ||
|
|
72776eee35 | ||
|
|
0cf67aa8bb | ||
|
|
1893aef144 | ||
|
|
d2806e7fe0 | ||
|
|
174e4be581 | ||
|
|
583b47bf2f | ||
|
|
b623363369 | ||
|
|
2b72adbfed | ||
|
|
2b1f1a514d | ||
|
|
af452c014d | ||
|
|
53cfa8deee | ||
|
|
adefb7de07 | ||
|
|
d17ba78413 | ||
|
|
56419385c3 | ||
|
|
4b55018014 | ||
|
|
449b4157c3 | ||
|
|
cad0113d59 | ||
|
|
4e98fd7839 | ||
|
|
366eb9d0dd | ||
|
|
ed6cb9e00d | ||
|
|
9267c05a9b | ||
|
|
e2d574eb5d | ||
|
|
658fe92f9e | ||
|
|
1525572c03 | ||
|
|
90b548973b | ||
|
|
fa188868b1 | ||
|
|
719ee3456a | ||
|
|
afc136d4f9 | ||
|
|
802ceb1ff5 | ||
|
|
adf9aac96a | ||
|
|
1898ff0813 | ||
|
|
e97ada9654 | ||
|
|
1f79a454c4 | ||
|
|
029493f3ed | ||
|
|
882332fc55 | ||
|
|
a318765143 | ||
|
|
bafed33c1f | ||
|
|
43451bdaff | ||
|
|
a2c9b59a1e | ||
|
|
164cb11cf3 | ||
|
|
84fab1da37 | ||
|
|
9843fb0144 | ||
|
|
8b23750641 | ||
|
|
3d775da19f | ||
|
|
ec0880ade3 | ||
|
|
58b6765a71 | ||
|
|
bf28e81613 | ||
|
|
c862b5f657 | ||
|
|
a4cb4b0107 | ||
|
|
78221abba4 | ||
|
|
b37663d17e | ||
|
|
e063ba4b65 | ||
|
|
458fbc836b | ||
|
|
e3cfb240d0 | ||
|
|
fcedde96bb | ||
|
|
4cb8f3fc66 | ||
|
|
eca8898d3b | ||
|
|
4e770b7aec | ||
|
|
0a3dea0edb | ||
|
|
69ccaf85be | ||
|
|
40ed8505ed | ||
|
|
1c8bf6d539 | ||
|
|
fa4712aa34 | ||
|
|
662291458f | ||
|
|
e8ca1f927b | ||
|
|
017d83c060 | ||
|
|
528fe8bdf1 | ||
|
|
c54a1b7abc | ||
|
|
b978a7f64e | ||
|
|
2ac23c86ea | ||
|
|
6b56945eb0 | ||
|
|
aca83fae6d | ||
|
|
5850ff923f | ||
|
|
2329d24ce3 | ||
|
|
8b0cf0b6cf | ||
|
|
128f88c99d | ||
|
|
261d06cf5a | ||
|
|
856fd37297 | ||
|
|
e2a3e6bf05 | ||
|
|
0732382216 | ||
|
|
0ae080130b | ||
|
|
fe12874400 | ||
|
|
4e6aa1dc93 | ||
|
|
20fbd97b01 | ||
|
|
94eea071b6 | ||
|
|
d9e50dc4f9 | ||
|
|
3b29dd616c | ||
|
|
1a61830d7a | ||
|
|
7c3f88c2bf | ||
|
|
50da3e9504 | ||
|
|
772010458c | ||
|
|
6205c26675 | ||
|
|
6712ea9ad8 | ||
|
|
41ece67739 | ||
|
|
268837a62f | ||
|
|
512c3ae318 | ||
|
|
27d1ef6c9b | ||
|
|
18fe23f92f | ||
|
|
8f7676a36c | ||
|
|
e4be7ef344 | ||
|
|
aa518b9eab | ||
|
|
0155b855de | ||
|
|
1af5427db4 | ||
|
|
9ac59e5e72 | ||
|
|
c43caa8a00 | ||
|
|
aff1da2fe4 | ||
|
|
e8f5d8a663 | ||
|
|
f3bd318635 | ||
|
|
9e965e1799 | ||
|
|
9b5a6191d6 | ||
|
|
8f2939d958 | ||
|
|
33b484a405 | ||
|
|
62ffdc3ab6 | ||
|
|
7373e083a1 | ||
|
|
57e7da6068 | ||
|
|
b34aca68ec | ||
|
|
3c65ba210f | ||
|
|
fb0974b0ff | ||
|
|
6bcf4ef96e | ||
|
|
aab750f93b | ||
|
|
167f119163 | ||
|
|
e1b9dd6dc6 | ||
|
|
3d581e6ed2 | ||
|
|
95651a9d12 | ||
|
|
7490bf3ea1 | ||
|
|
3c2a6f76cc | ||
|
|
62a0deba57 | ||
|
|
bcb581af03 | ||
|
|
78da65706d | ||
|
|
8155ed3207 | ||
|
|
eed383522b | ||
|
|
55068ca6ca | ||
|
|
0fee30ab26 | ||
|
|
f820124db9 | ||
|
|
0428ba5e5c | ||
|
|
3ff09c65fc | ||
|
|
b09c41c353 | ||
|
|
d9f48330f2 | ||
|
|
c97c2e93c6 | ||
|
|
205176caab | ||
|
|
c62cb76347 | ||
|
|
a85eba776a | ||
|
|
95282552a5 | ||
|
|
93c584efc7 | ||
|
|
b7f16f31d9 | ||
|
|
012d8c81f5 | ||
|
|
b4c03fc922 | ||
|
|
3d2ff24531 | ||
|
|
9d56f4a1b2 | ||
|
|
fcc726046b | ||
|
|
a0f06ac704 | ||
|
|
4542021a34 | ||
|
|
b32cb1eede | ||
|
|
b41d1b1309 | ||
|
|
fe9bda3ab0 | ||
|
|
6cc5f311fc | ||
|
|
4d6529d6d1 | ||
|
|
97fa10fc55 | ||
|
|
e0adf39626 | ||
|
|
d4b27cf545 |
8
.editorconfig
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
2
.gitignore
vendored
@@ -3,7 +3,7 @@ node_modules
|
|||||||
|
|
||||||
# Build directories
|
# Build directories
|
||||||
src/public/dist/local/bundle/
|
src/public/dist/local/bundle/
|
||||||
src/public/dist/standalone/bundle/
|
build/
|
||||||
|
|
||||||
# example for dev
|
# example for dev
|
||||||
# example-project
|
# example-project
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
.idea
|
.idea
|
||||||
example-project
|
example-project
|
||||||
docs
|
docs
|
||||||
|
src/public/js
|
||||||
|
build
|
||||||
|
|||||||
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM node:14-slim
|
||||||
|
|
||||||
|
WORKDIR /usr/src/codecrumbs
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
RUN yarn install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE 2018 3018
|
||||||
179
README.md
@@ -1,48 +1,169 @@
|
|||||||
# codecrumbs [active development phase, stay tuned!] [](https://twitter.com/intent/tweet?text=Leave%20breadcrumbs%20in%20source%20code%20with%20codecrumbs%20tool%20&url=https://github.com/Bogdan-Lyashenko/codecrumbs&via=bliashenko&hashtags=javascript,code)
|
[](https://badge.fury.io/js/codecrumbs) [](https://github.com/ellerbrock/open-source-badges/) [<img src="https://img.shields.io/twitter/follow/bliashenko.svg?label=Stay%20Tuned&style=social">](https://twitter.com/bliashenko)
|
||||||
|
|
||||||
[](https://badge.fury.io/js/codecrumbs)
|
<p align="center">
|
||||||
|
<img src="/docs/logo-sm.png" width="250"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
Leave "breadcrumbs" in source code via comments to find your way out from code maze.
|
<h3 align="center">
|
||||||
> Still much work to do, but the basic features are already implemented and are ready to use. Give it a try while I am finishing a few more big features. Ideas and improvements are welcome. Thanks.
|
<a href="#what">What</a>
|
||||||
|
<span> · </span>
|
||||||
|
<a href="#demo">Demo</a>
|
||||||
|
<span> · </span>
|
||||||
|
<a href="#get-started">Get started</a>
|
||||||
|
<span> · </span>
|
||||||
|
<a href="#features">Features</a>
|
||||||
|
<span> · </span>
|
||||||
|
<a href="#case-studies">Case studies</a>
|
||||||
|
<span> · </span>
|
||||||
|
<a href="#support">Support</a>
|
||||||
|
</h3>
|
||||||
|
|
||||||
## [Demo](https://codecrumbs.io/)
|
**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.
|
||||||
Check out [**standalone version here**](https://codecrumbs.io/) with defined trail of codecrumbs.
|
> If you like this project, follow me on Twitter [@bliashenko](https://twitter.com/bliashenko) to hear about things I am building.
|
||||||
|
|
||||||
[<img src="/docs/codecrumbs-ui.png" width="800">](https://codecrumbs.io/)
|
## Codecrumbs v2
|
||||||
|
Check out new version of this project as [standalone application](https://codecrumbs.io). Just in a few clicks you can start exploring a codebase in more efficient way, create interactive visual guides and share them with others on your own blog! See [quick guide here](https://codecrumbs.io/guides/web-app-with-github/).
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://codecrumbs.io" target="_blank">
|
||||||
|
<img src="https://codecrumbs.io/external/img/common/app-ui-1.png" />
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
## Demo
|
||||||
|
Check out prepared example for [**standalone version running here**](https://codecrumbs.io/app).
|
||||||
|
|
||||||
|
## Codecrumbs v1
|
||||||
|
|
||||||
|
>**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](https://www.youtube.com/watch?v=S_1-1jzLxm4) for more details.
|
||||||
|
|
||||||
|
|
||||||
|
<img src="/docs/main-ui-3.png" width="100%"/>
|
||||||
|
|
||||||
## Get started
|
## Get started
|
||||||
Install ```codecrumbs``` globally or in ```devDependencies```:
|
### Install and run
|
||||||
```yarn add codecrumbs -D```
|
>Pre-condition: update/install `NodeJS` version to be >= *8.11.1*
|
||||||
|
|
||||||
Add command with **entry file** and **source directory** to ```scripts``` section in your ```package.json```. Change ```-e``` (entry point file), ```-d``` (directory) params to match paths inside your project.
|
1) Install ```codecrumbs``` globally (```yarn global add codecrumbs```)
|
||||||
```javascript
|
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* .
|
||||||
// package.json
|
3) Go to [http://localhost:2018](http://localhost:2018/#) in the browser to check it out.
|
||||||
...
|
|
||||||
"scripts": {
|
|
||||||
"start:cc": "codecrumbs -e src/index.js -d src"
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
### Configuration
|
||||||
|
Run codecrumbs with CLI params or specify static config file `codecrumbs.config.js` (see example [here](/example-project/codecrumbs.config.js))
|
||||||
|
|
||||||
Run ```yarn start:cc``` from the terminal. Go to [http://localhost:2018/#](http://localhost:2018/#) in the browser to check it out.
|
CLI | Config file | Description | Example
|
||||||
|
--- | --- | --- | ---
|
||||||
|
```d``` | ```projectDir``` | Relative path to project source code directory | ```-d src```
|
||||||
|
```e``` | ```entryPoint``` | Relative path to project source entry point file (must be inside ```dir```) | ```-e src/app.js```
|
||||||
|
```x``` | ```excludeDir``` | Relative path(or paths separated by ```,```) to directories for exclusion | ```-x src/doc,src/thirdparty```
|
||||||
|
```p``` | ```clientPort``` | Port for Codecrumbs client (optional, default *2018*) | ```-p 2019```
|
||||||
|
```n``` | ```projectNameAlias``` | Project 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```
|
||||||
|
```D``` | ```debugModeEnabled``` | Enable debug mode for logs (optional, default is ```false```) | ```-D```
|
||||||
|
|
||||||
## Breadcrumbs
|
## Features
|
||||||
> Leave breadcrumbs by simply putting a comment in code, diagram wil be updated on the fly!
|
### Breadcrumbs and trails
|
||||||
|
|
||||||
Write ```//cc:here is breadcrumb``` to put a simple breadcrumb in the code. ```cc``` (stands for "codecrumb") is the prefix which used by the parser, and ```here is breadcrumb``` is a title of our first breadcrumb.
|
<img src="/docs/cc-ui-3.png" width="750"/>
|
||||||
|
|
||||||
Also, you can create “trail of breadcrumbs” — basically, a sequence of codecrumbs which follow some data flow (e.g. user login, or form submit, etc.).
|
UI explained:
|
||||||
To create a codecrumb as part of a trail you write: ```//cc:signin#3;enable route``` where ```signin``` is the **trail ID**, ```#3``` is order **number of step**, ```enable route``` is a title describing the step.
|
- 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.)
|
||||||
|
|
||||||
<img src="/docs/live-changes.gif" width="800">
|
**How to get there?**
|
||||||
|
|
||||||
Check out [the introduction article here](https://itnext.io/how-to-navigate-the-maze-of-javascript-code-541250447cbb) for more details.
|
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:
|
||||||
|
|
||||||
## Learn and share your knowledge
|
Example | Description | Use case
|
||||||
So let’s say you put together some trail of codecrumbs describing some important flow inside the project. How you can share it with others? Simply download the json file of codecrumbs store, send it to the friend, he/she uploads it to the codecrumbs and can see same you just saw!
|
--- | --- | ---
|
||||||
<img src="/docs/share-knowledge.gif" width="800">
|
```//cc:remember place``` | simple breadcrumb, ```remember place``` is a title of our first breadcrumb | Mark an important place to not forget where it was
|
||||||
|
```//cc:here is bug;well, seems like a bug in logic``` | simple 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 route``` | trail 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 credentials``` | trail 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.
|
||||||
|
|
||||||
|
<img src="/docs/multi-codebase-cc-2.png" width="100%"/>
|
||||||
|
|
||||||
|
### 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
|
||||||
|
|
||||||
|
<img src="/docs/dep-ui-2.png" width="100%"/>
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
<img src="/docs/flow-ui.png" width="100%"/>
|
||||||
|
|
||||||
|
[js2flowchart](https://github.com/Bogdan-Lyashenko/js-code-to-svg-flowchart) is used in the sidebar to draw flowchart for the selected file code.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
Any support is very much appreciated! 👍 😘 ❤️
|
||||||
|
If you like this project, please, **put a :star: and tweet about it**. Thanks!
|
||||||
|
|
||||||
If you like this project and believe it makes sense, please, put a :star: or tweet about it - it will show your support and motivate me :punch:. Thanks!
|
Please, consider [making financial donation](https://opencollective.com/codecrumbs), 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](https://www.linkedin.com/in/bohdan-liashenko-bb365854/) for discussion.
|
||||||
|
|
||||||
|
<a href="https://opencollective.com/codecrumbs/donate" target="_blank">
|
||||||
|
<img src="https://opencollective.com/codecrumbs/donate/button@2x.png?color=blue" width=300 />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
#### Sponsors
|
||||||
|
Development supported by [0+X](https://0x.se)
|
||||||
|
|
||||||
|
<a href="https://0x.se" target="_blank">
|
||||||
|
<img src="https://avatars0.githubusercontent.com/u/16350669?s=200&v=4" width=100 />
|
||||||
|
</a>
|
||||||
|
|
||||||
|
#### Backers
|
||||||
|
<a href="https://opencollective.com/codecrumbs/backer/0/website" target="_blank"><img src="https://opencollective.com/codecrumbs/backer/0/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/codecrumbs/backer/1/website" target="_blank"><img src="https://opencollective.com/codecrumbs/backer/1/avatar.svg"></a>
|
||||||
|
<a href="https://opencollective.com/codecrumbs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/codecrumbs/sponsor/0/avatar.svg"></a>
|
||||||
|
|
||||||
|
## 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](https://github.com/Bogdan-Lyashenko/) of this repository before making a change. Ideas and suggestions are welcome.
|
||||||
|
To start development environment, clone the repo & run:
|
||||||
|
```javascript
|
||||||
|
yarn && yarn start
|
||||||
|
```
|
||||||
|
|
||||||
|
## WIP
|
||||||
|
Next features are developing:
|
||||||
|
- **VS Code extension** - some neat features right inside the code editor. Checkout [the repo here](https://github.com/Bogdan-Lyashenko/vs-code-codecrumbs).
|
||||||
|
|||||||
51
cli/index.cli.js
Normal file → Executable file
@@ -1,36 +1,57 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
const program = require('commander');
|
const program = require('commander');
|
||||||
const colors = require('colors');
|
const colors = require('colors');
|
||||||
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
const showUpdatesInfo = require('./updatesInfo');
|
||||||
const server = require('../src/server');
|
const server = require('../src/server');
|
||||||
|
|
||||||
|
showUpdatesInfo();
|
||||||
|
|
||||||
program
|
program
|
||||||
.option('-e, --entry [entryFile]', 'Specify path to entry point file. E.g. `./src/app.js`')
|
.option('-e, --entry [entryPoint]', 'Specify path to entry point file. E.g. `src/app.js`')
|
||||||
.option('-d, --dir [projectDir]', 'Specify path to project source code directory. E.g. `./src`')
|
.option('-d, --dir [projectDir]', 'Specify path to project source code directory. E.g. `src`', '')
|
||||||
.option(
|
.option(
|
||||||
'-w, --webpack [webpackConfigFile]',
|
'-w, --webpack [webpackConfigFile]',
|
||||||
'Specify path to webpack config file. E.g. ./webpack.config.js'
|
'Specify path to webpack config file. E.g. webpack.config.js'
|
||||||
|
)
|
||||||
|
.option(
|
||||||
|
'-t, --tsconfig [tsConfigFile]',
|
||||||
|
'Specify path to typeScript config file. E.g. tsConfig.json'
|
||||||
)
|
)
|
||||||
.option('-p, --port [defaultPort]', 'Specify port for Codecrumbs client. E.g. 3333', 2018)
|
.option('-p, --port [defaultPort]', 'Specify port for Codecrumbs client. E.g. 3333', 2018)
|
||||||
|
.option('-i, --ideCmd [ideCmd]', 'IDE command to open file')
|
||||||
|
.option('-x, --excludeDir [excludeDirectories]', 'Exclude directories')
|
||||||
|
.option('-n, --projectName [projectNameAlias]', 'Project name alias')
|
||||||
|
.option('-C, --configFile [pathToConfigFile]', 'Path to codecrumbs.config.js')
|
||||||
|
.option('-D, --debugModeEnabled [debugModeEnabled]', 'Enable debug mode for logs.')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
if (!program.entry && !program.dir) {
|
const pathToConfigFile = program.configFile || 'codecrumbs.config.js';
|
||||||
|
const configFileExists = server.checkIfPathExists(pathToConfigFile);
|
||||||
|
if ((!program.entry || !program.dir) && !configFileExists) {
|
||||||
console.log(
|
console.log(
|
||||||
colors.magenta(
|
colors.magenta(
|
||||||
'Please specify `entry` and `dir` params. E.g. `codecrumbs -e src/app.js -d src`'
|
'Please specify `entryPoint` and `projectDir` params (e.g. `codecrumbs -e src/app.js -d src`). Or use `-C codecrumbs.config.js` instead.'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
server.setup(
|
const configFromFile = configFileExists ? require(path.resolve(pathToConfigFile)) : {};
|
||||||
{
|
|
||||||
projectNameAlias: undefined, // TODO: add param for this
|
const configFromCLI = {
|
||||||
entryPoint: program.entry,
|
projectNameAlias: program.projectName,
|
||||||
projectDir: program.dir,
|
entryPoint: program.entry,
|
||||||
webpackConfigPath: program.webpack,
|
projectDir: program.dir,
|
||||||
clientPort: program.port
|
webpackConfigPath: program.webpack,
|
||||||
},
|
tsConfigPath: program.tsconfig,
|
||||||
false
|
clientPort: program.port,
|
||||||
);
|
excludeDir: program.excludeDir,
|
||||||
|
ideCmd: program.ideCmd,
|
||||||
|
debugModeEnabled: program.debugModeEnabled
|
||||||
|
};
|
||||||
|
|
||||||
|
server.setup(_.merge(configFromCLI, configFromFile), { isDev: false });
|
||||||
|
|||||||
20
cli/updatesInfo.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
const colors = require('colors');
|
||||||
|
const exec = require('child_process').exec;
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
try {
|
||||||
|
exec('npm outdated codecrumbs').stdout.on('data', function(data) {
|
||||||
|
const list = data
|
||||||
|
.split(' ')
|
||||||
|
.filter(v => !!v)
|
||||||
|
.map(v => v.trim());
|
||||||
|
|
||||||
|
const latestVersion = list[list.length - 2];
|
||||||
|
console.log(
|
||||||
|
colors.cyan.underline(
|
||||||
|
`There is new version of codecrumbs (${latestVersion}) available! Please update to have all latest features and improvements!`
|
||||||
|
)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
} catch (e) {}
|
||||||
|
};
|
||||||
BIN
docs/cc-ui-3.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
|
Before Width: | Height: | Size: 198 KiB |
BIN
docs/dep-ui-2.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
docs/dev.png
Normal file
|
After Width: | Height: | Size: 163 KiB |
BIN
docs/flow-ui.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
docs/ide-integration.gif
Normal file
|
After Width: | Height: | Size: 5.1 MiB |
BIN
docs/logo-sm.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
docs/main-ui-3.png
Normal file
|
After Width: | Height: | Size: 236 KiB |
BIN
docs/multi-codebase-cc-2.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 3.3 MiB |
7
example-project/codecrumbs.config.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = {
|
||||||
|
entryPoint: 'example-project/src-client/index.js',
|
||||||
|
projectDir: 'example-project/src-client',
|
||||||
|
clientPort: 1234,
|
||||||
|
projectNameAlias: 'example-project-for-client',
|
||||||
|
debugModeEnabled: true
|
||||||
|
};
|
||||||
1
example-project/debug/index.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
//cc:debug#0;step 0
|
||||||
1
example-project/debug/sections/one.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
//cc:debug#2;step 2
|
||||||
3
example-project/debug/sections/two.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
//cc:debug#4;step 4
|
||||||
|
|
||||||
|
//cc:debug#1;step 1
|
||||||
1
example-project/debug/utils/changeListener/behaviour.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
//cc:debug#3;step 3
|
||||||
0
example-project/debug/x1/index.js
Normal file
0
example-project/debug/x2/ok/ok.js
Normal file
0
example-project/debug/x2/x/index.js
Normal file
9
example-project/languages/cpp-lang.cpp
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
//cc:main function
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
cout << "Hello, World!";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
16
example-project/languages/csharp-lang.cs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
//cc:main function
|
||||||
|
using System;
|
||||||
|
namespace HelloWorld
|
||||||
|
{
|
||||||
|
class Hello
|
||||||
|
{
|
||||||
|
static void Main()
|
||||||
|
{
|
||||||
|
Console.WriteLine("Hello World!");
|
||||||
|
|
||||||
|
// Keep the console window open in debug mode.
|
||||||
|
Console.WriteLine("Press any key to exit.");
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4
example-project/languages/fortran-lang.f
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
! cc: main function
|
||||||
|
program hello
|
||||||
|
print *, "Hello World!"
|
||||||
|
end program hello
|
||||||
7
example-project/languages/go-lang.go
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package main
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
// cc:main function
|
||||||
|
func main() {
|
||||||
|
fmt.Println("hello world")
|
||||||
|
}
|
||||||
2
example-project/languages/haskell-lang.hs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
-- cc:main function
|
||||||
|
putStrLn "Hello, world!"
|
||||||
9
example-project/languages/java-lang.java
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
public class HelloWorld {
|
||||||
|
|
||||||
|
//cc: main function
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// Prints "Hello, World" to the terminal window.
|
||||||
|
System.out.println("Hello, World");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
4
example-project/languages/js-lang.js
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//cc:main function
|
||||||
|
function greeting() {
|
||||||
|
console.log('Hello world!');
|
||||||
|
}
|
||||||
5
example-project/languages/kotlin-lang.kt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//cc:main function
|
||||||
|
|
||||||
|
fun main(args : Array<String>) {
|
||||||
|
println("Hello, World!")
|
||||||
|
}
|
||||||
2
example-project/languages/lua-lang.lua
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
-- hello world program
|
||||||
|
print ("Hello World!")
|
||||||
2
example-project/languages/ocaml.ml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/* cc:main function */
|
||||||
|
let hello = () => "Hello, World!";
|
||||||
7
example-project/languages/perl-lang.pl
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
# cc: main function.
|
||||||
|
print "Hello, World!\n";
|
||||||
5
example-project/languages/php-lang.php
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
//cc:main function
|
||||||
|
echo "Hello World!";
|
||||||
|
echo "PHP is so easy!";
|
||||||
|
?>
|
||||||
10
example-project/languages/python-lang.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
# cc:main function
|
||||||
|
def main(argv=None):
|
||||||
|
if argv is None:
|
||||||
|
argv = sys.argv
|
||||||
|
|
||||||
|
print "Hello, world"
|
||||||
|
|
||||||
|
return
|
||||||
3
example-project/languages/ruby-lang.rb
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# cc:main function
|
||||||
|
|
||||||
|
puts 'Hello, world!'
|
||||||
4
example-project/languages/ts-lang.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
//cc:main function
|
||||||
|
function greeting() {
|
||||||
|
console.log('Hello world!');
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
|
|
||||||
function authenticate(provider) {
|
function authenticate(provider) {
|
||||||
return dispatch => {
|
return dispatch => {
|
||||||
//cc:signin#1;firebase sign in;+2
|
//cc:signin#1;firebase sign in;+1;call to firebase with auth provider, proceed if success response
|
||||||
firebaseAuth.signInWithPopup(provider)
|
firebaseAuth.signInWithPopup(provider)
|
||||||
.then(result => dispatch(signInSuccess(result)))
|
.then(result => dispatch(signInSuccess(result)))
|
||||||
.catch(error => dispatch(signInError(error)));
|
.catch(error => dispatch(signInError(error)));
|
||||||
@@ -13,7 +13,7 @@ export function authReducer(state = new AuthState(), {payload, type}) {
|
|||||||
case INIT_AUTH:
|
case INIT_AUTH:
|
||||||
case SIGN_IN_SUCCESS:
|
case SIGN_IN_SUCCESS:
|
||||||
return state.merge({
|
return state.merge({
|
||||||
authenticated: !!payload, // cc:signin#2;toggle 'authenticated' flag
|
authenticated: !!payload, //cc:signin#5;toggle 'authenticated' flag
|
||||||
id: payload ? payload.uid : null
|
id: payload ? payload.uid : null
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
//cc:firebase config;and some details
|
||||||
export const firebaseConfig = {
|
export const firebaseConfig = {
|
||||||
apiKey: 'AIzaSyBsVVpEDrlNPEmshLcmOuE0FxhjPn0AqMg',
|
apiKey: 'AIzaSyBsVVpEDrlNPEmshLcmOuE0FxhjPn0AqMg',
|
||||||
authDomain: 'todo-react-redux.firebaseapp.com',
|
authDomain: 'todo-react-redux.firebaseapp.com',
|
||||||
@@ -15,7 +15,7 @@ import App from './views/app';
|
|||||||
const store = configureStore();
|
const store = configureStore();
|
||||||
const rootElement = document.getElementById('root');
|
const rootElement = document.getElementById('root');
|
||||||
|
|
||||||
//cc:layout#0;start;provider
|
//cc:layout#0;start
|
||||||
function render(Component) {
|
function render(Component) {
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
22
example-project/src-client/test_tml.vue
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
<template>
|
||||||
|
<p>{{ greeting }} World!</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
module.exports = {
|
||||||
|
data: function () {
|
||||||
|
return {
|
||||||
|
greeting: 'Hello'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
//cc:test vue
|
||||||
|
<style scoped>
|
||||||
|
p {
|
||||||
|
font-size: 2em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -10,7 +10,7 @@ import RequireUnauthRoute from '../components/require-unauth-route';
|
|||||||
import SignInPage from '../pages/sign-in';
|
import SignInPage from '../pages/sign-in';
|
||||||
import TasksPage from '../pages/tasks';
|
import TasksPage from '../pages/tasks';
|
||||||
|
|
||||||
//cc:layout#1;describe pages
|
//cc:layout#1;describe pages;some details long description for separare popup
|
||||||
const App = ({authenticated, signOut}) => (
|
const App = ({authenticated, signOut}) => (
|
||||||
<div>
|
<div>
|
||||||
<Header
|
<Header
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Route, Redirect } from 'react-router-dom'
|
import { Route, Redirect } from 'react-router-dom'
|
||||||
|
|
||||||
//cc:signin#3;enable route;+6
|
//cc:signin#6;enable route;details
|
||||||
const RequireAuthRoute = ({component: Component, authenticated, ...rest}) => (
|
const RequireAuthRoute = ({component: Component, authenticated, ...rest}) => (
|
||||||
<Route
|
<Route
|
||||||
{...rest}
|
{...rest}
|
||||||
@@ -6,7 +6,7 @@ import Icon from '../icon';
|
|||||||
|
|
||||||
import './task-item.css';
|
import './task-item.css';
|
||||||
|
|
||||||
//cc:there is task
|
//cc:there is task;extra
|
||||||
export class TaskItem extends Component {
|
export class TaskItem extends Component {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||