Compare commits
170 Commits
multy-serv
...
v1.6.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
2
.gitignore
vendored
@@ -3,7 +3,7 @@ node_modules
|
||||
|
||||
# Build directories
|
||||
src/public/dist/local/bundle/
|
||||
src/public/dist/standalone/bundle/
|
||||
src/public/dist/standalone-build/
|
||||
|
||||
# example for dev
|
||||
# example-project
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.idea
|
||||
example-project
|
||||
docs
|
||||
docs
|
||||
src/public/js
|
||||
183
README.md
@@ -1,48 +1,165 @@
|
||||
# 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.
|
||||
> 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.
|
||||
<h3 align="center">
|
||||
<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/)
|
||||
Check out [**standalone version here**](https://codecrumbs.io/) with defined trail of codecrumbs.
|
||||
## 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](https://www.youtube.com/watch?v=S_1-1jzLxm4) for more details.
|
||||
>
|
||||
>-[@bliashenko](https://twitter.com/bliashenko)
|
||||
|
||||
## Demo
|
||||
Check out the example of [**standalone version running here**](https://codecrumbs.io/#showcase=todo-react-redux).
|
||||
|
||||
[<img src="/docs/codecrumbs-ui.png" width="800">](https://codecrumbs.io/)
|
||||
<img src="/docs/main-ui-3.png" width="100%"/>
|
||||
|
||||
## Get started
|
||||
Install ```codecrumbs``` globally or in ```devDependencies```:
|
||||
```yarn add codecrumbs -D```
|
||||
|
||||
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.
|
||||
```javascript
|
||||
// package.json
|
||||
...
|
||||
"scripts": {
|
||||
"start:cc": "codecrumbs -e src/index.js -d src"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Run ```yarn start:cc``` from the terminal. Go to [http://localhost:2018/#](http://localhost:2018/#) in the browser to check it out.
|
||||
|
||||
## Breadcrumbs
|
||||
> Leave breadcrumbs by simply putting a comment in code, diagram wil be updated on the fly!
|
||||
### Install and run
|
||||
>Pre-condition: update/install `NodeJS` version to be >= *8.11.1*
|
||||
|
||||
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.
|
||||
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](http://localhost:2018/#) in the browser to check it out.
|
||||
|
||||
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.).
|
||||
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.
|
||||
### CLI
|
||||
Parameter | Description | Example
|
||||
--- | --- | ---
|
||||
```-d```, ```--dir``` | Relative path to project source code directory | ```-d src```
|
||||
```-e```, ```--entry``` | 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```
|
||||
```-i```, ```--ideCmd``` | command to open file in IDE from bash (default 'webstorm') | ```-i code```
|
||||
```-p```, ```--port``` | Port for Codecrumbs client (optional, default *2018*) | ```-p 2019```
|
||||
```-n```, ```--projectName``` | Project name alias (optional, default same as ```-d``` value) | ```-n my-hello-world```
|
||||
|
||||
## Features
|
||||
### Breadcrumbs and trails
|
||||
|
||||
<img src="/docs/cc-ui-3.png" width="750"/>
|
||||
|
||||
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:
|
||||
|
||||
<img src="/docs/live-changes.gif" width="800">
|
||||
Example | Description | Use case
|
||||
--- | --- | ---
|
||||
```//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
|
||||
|
||||
Check out [the introduction article here](https://itnext.io/how-to-navigate-the-maze-of-javascript-code-541250447cbb) for more details.
|
||||
> Note: current version supports single line comments only.
|
||||
|
||||
### 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.
|
||||
|
||||
## Learn and share your knowledge
|
||||
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">
|
||||
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:
|
||||
- `JavaScript`
|
||||
- `TypeScript`
|
||||
- `Python`
|
||||
- `Ruby`
|
||||
- `PHP`
|
||||
- `Java`
|
||||
- `Kotlin`
|
||||
- `C++`
|
||||
- `C#`
|
||||
- `Fortran`
|
||||
- `Haskell`
|
||||
|
||||
Please file an issue to support other language you would like to have.
|
||||
|
||||
### Download & Upload (learn and share your knowledge)
|
||||
|
||||
You can take a snapshot of application state at any point of time and share it with others. Simply download the json file of codecrumbs store (*top-right corner, "setup -> download"*). This json file can be then uploaded to codecrumbs (*top-right corner, "setup -> upload"*) to represent exactly same picture, even without having that project locally!
|
||||
|
||||
<img src="/docs/upload-feature-2.gif" width="100%"/>
|
||||
|
||||
### 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.
|
||||
|
||||
### IDE integration
|
||||
> Check ```-i``` CLI param first to configure command.
|
||||
|
||||
Navigate from browser to your code editor simply by clicking ```Command+click```(or ```Alt+click```) on a file or a codecrumb to open file in your IDE.
|
||||
|
||||
<img src="/docs/ide-integration.gif" width="100%"/>
|
||||
|
||||
## Case studies
|
||||
The tool (codecrumbs) allows us to learn, document and explain a codebase much faster. Also, with *Download & Upload* feature it becomes super easy to collect and share your "investigation results".
|
||||
|
||||
The ultimate goal is to have many case studies hosting at [https://codecrumbs.io](https://codecrumbs.io/). **The library of projects "explained with codecrumbs", the place for collaborative learning**. More features around that coming soon, stay tuned.
|
||||
|
||||
## 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>
|
||||
|
||||
#### 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:
|
||||
- **eject codecrumbs** - ability to remove all "breadcrumbs" from source code in "one click"
|
||||
- **data transferring between cc trail steps**
|
||||
- **VS Code extension** - some neat features right inside the code editor. Checkout [the repo here](https://github.com/Bogdan-Lyashenko/vs-code-codecrumbs).
|
||||
|
||||
24
cli/index.cli.js
Normal file → Executable file
@@ -6,16 +6,23 @@ const colors = require('colors');
|
||||
const server = require('../src/server');
|
||||
|
||||
program
|
||||
.option('-e, --entry [entryFile]', '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('-e, --entry [entryFile]', '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(
|
||||
'-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('-i, --ideCmd [ideCmd]', 'IDE command to open file')
|
||||
.option('-x, --excludeDir [excludeDirectories]', 'Exclude directories')
|
||||
.option('-n, --projectName [projectNameAlias]', 'Project name alias')
|
||||
.parse(process.argv);
|
||||
|
||||
if (!program.entry && !program.dir) {
|
||||
if (!program.entry || !program.dir) {
|
||||
console.log(
|
||||
colors.magenta(
|
||||
'Please specify `entry` and `dir` params. E.g. `codecrumbs -e src/app.js -d src`'
|
||||
@@ -26,11 +33,14 @@ if (!program.entry && !program.dir) {
|
||||
|
||||
server.setup(
|
||||
{
|
||||
projectNameAlias: undefined, // TODO: add param for this
|
||||
projectNameAlias: program.projectName,
|
||||
entryPoint: program.entry,
|
||||
projectDir: program.dir,
|
||||
webpackConfigPath: program.webpack,
|
||||
clientPort: program.port
|
||||
tsConfigPath: program.tsconfig,
|
||||
clientPort: program.port,
|
||||
excludeDir: program.excludeDir,
|
||||
ideCmd: program.ideCmd
|
||||
},
|
||||
false
|
||||
{ isDev: false }
|
||||
);
|
||||
|
||||
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-intergation.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 |
BIN
docs/upload-feature-2.gif
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
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
|
||||
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!")
|
||||
}
|
||||
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) {
|
||||
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)
|
||||
.then(result => dispatch(signInSuccess(result)))
|
||||
.catch(error => dispatch(signInError(error)));
|
||||
@@ -13,7 +13,7 @@ export function authReducer(state = new AuthState(), {payload, type}) {
|
||||
case INIT_AUTH:
|
||||
case SIGN_IN_SUCCESS:
|
||||
return state.merge({
|
||||
authenticated: !!payload, // cc:signin#2;toggle 'authenticated' flag
|
||||
authenticated: !!payload, //cc:signin#5;toggle 'authenticated' flag
|
||||
id: payload ? payload.uid : null
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//cc:firebase config;and some details
|
||||
export const firebaseConfig = {
|
||||
apiKey: 'AIzaSyBsVVpEDrlNPEmshLcmOuE0FxhjPn0AqMg',
|
||||
authDomain: 'todo-react-redux.firebaseapp.com',
|
||||
@@ -1,4 +1,4 @@
|
||||
import createHistory from 'history/createBrowserHistory';
|
||||
|
||||
|
||||
export default createHistory();
|
||||
export default createHistory();
|
||||
@@ -15,7 +15,7 @@ import App from './views/app';
|
||||
const store = configureStore();
|
||||
const rootElement = document.getElementById('root');
|
||||
|
||||
//cc:layout#0;start;provider
|
||||
//cc:layout#0;start
|
||||
function render(Component) {
|
||||
ReactDOM.render(
|
||||
<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 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}) => (
|
||||
<div>
|
||||
<Header
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
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}) => (
|
||||
<Route
|
||||
{...rest}
|
||||
@@ -6,7 +6,7 @@ import Icon from '../icon';
|
||||
|
||||
import './task-item.css';
|
||||
|
||||
//cc:there is task
|
||||
//cc:there is task;extra
|
||||
export class TaskItem extends Component {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
@@ -33,11 +33,11 @@ SignInPage.propTypes = {
|
||||
//-------------------------------------
|
||||
|
||||
const mapDispatchToProps = {
|
||||
signInWithGithub: authActions.signInWithGithub, //cc:signin#0;dispatch action
|
||||
signInWithGithub: authActions.signInWithGithub, //cc:signin#0;dispatch action;start signin with github
|
||||
signInWithGoogle: authActions.signInWithGoogle,
|
||||
signInWithTwitter: authActions.signInWithTwitter
|
||||
};
|
||||
|
||||
//cc:signin#7;test
|
||||
export default withRouter(
|
||||
connect(
|
||||
null,
|
||||