Skip to content

Commit 3ba04a5

Browse files
authored
Merging release v1.1.5 to master
Merging changes for release v1.1.5 to master # New Features and enhancements - Code view feature for viewing files from repo details file explorer (#51) - Minor UI tweaks and fallback views # Bug fixes - gitconvex app crash issue when started from the globally installed npm module (#87)
2 parents 668ffe3 + 5306036 commit 3ba04a5

File tree

558 files changed

+24095
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+24095
-37
lines changed

API/addRepoApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function addRepoHandler(
4545
throw new Error("Invalid clone URL string!");
4646
}
4747

48-
if (repoName.match(/[^a-zA-Z0-9-_.\\s]/gi)) {
48+
if (repoName.match(/[^a-zA-Z0-9-_.\s]/gi)) {
4949
throw new Error("Invalid repo name string!");
5050
}
5151

API/codeFileViewApi.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
const { getRepoPath } = require("../global/fetchGitRepoPath");
4+
const { gitFileBasedCommit } = require("../git/gitFileBasedCommit");
5+
const { isText } = require("istextorbinary");
6+
const { LangLine } = require("@itassistors/langline");
7+
8+
async function codeFileViewApi(repoId, fileName) {
9+
const repoPath = await getRepoPath(repoId);
10+
const targetFile = path.join(repoPath, fileName);
11+
const langData = await new LangLine().withFile(targetFile);
12+
let fileContent = [];
13+
14+
if (isText(targetFile)) {
15+
const commit = await gitFileBasedCommit(repoPath, targetFile);
16+
17+
let fileData = await fs.promises
18+
.readFile(targetFile)
19+
.then((res) => {
20+
return res.toString();
21+
})
22+
.catch((err) => {
23+
console.log(err);
24+
return "";
25+
});
26+
27+
if (langData && langData.name) {
28+
if (fileData) {
29+
fileContent = fileData.split("\n");
30+
return {
31+
codeFileDetails: {
32+
language: langData.name,
33+
fileData: fileContent,
34+
fileCommit: commit,
35+
prism: langData.prismIndicator
36+
? langData.prismIndicator
37+
: "markdown",
38+
},
39+
};
40+
}
41+
} else {
42+
return {
43+
codeFileDetails: {
44+
language: "Invalid",
45+
fileData: fileContent,
46+
fileCommit: commit,
47+
prism: "markdown",
48+
},
49+
};
50+
}
51+
}
52+
}
53+
54+
module.exports.codeFileViewApi = codeFileViewApi;

DOCUMENTATION.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,15 @@ or use `pm2` by downloading it from npm - `npm i -g pm2` and start the module by
8686
- Remote repo URL and host
8787
- Files and folders tracked by git
8888
```
89-
The repo detail view also provides features for performing the following git operations,
89+
The repo detail view also provides features for performing the following operations,
9090
```
9191
- Adding a new branch
9292
- Pulling changes from remote
9393
- Fetching changes from remote
9494
- Adding a new remote repo
95-
- Directory navigator
96-
- Loading commit logs on demand
95+
- Directory navigator to lookup all files and folders within the repo
96+
- Code view for valid files from the file explorer view
97+
- Loading commit logs dynamically
9798
```
9899

99100
![repo-card-details](https://user-images.githubusercontent.com/65342122/89164057-30deb800-d594-11ea-94d6-d3a330260044.png)

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
> Use any of the below options to get gitconvex for your system
2020
21-
[![gitconvex npm package](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.4&color=red&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@itassistors/gitconvex)
22-
[![github release](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.4&color=green&style=for-the-badge&logo=github)](https://github.com/neel1996/gitconvex-package/releases)
23-
[![docker image](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.4&color=blue&style=for-the-badge&logo=docker)](https://hub.docker.com/repository/docker/itassistors/gitconvex)
21+
[![gitconvex npm package](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.5&color=red&style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@itassistors/gitconvex)
22+
[![github release](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.5&color=green&style=for-the-badge&logo=github)](https://github.com/neel1996/gitconvex-package/releases)
23+
[![docker image](https://img.shields.io/static/v1?label=gitconvex&message=v1.1.5&color=blue&style=for-the-badge&logo=docker)](https://hub.docker.com/repository/docker/itassistors/gitconvex)
2424
[![License](https://img.shields.io/static/v1?label=LICENSE&message=Apache-2.0&color=yellow&style=for-the-badge)](LICENSE)
2525

2626
- **Option - 1** Cloning repo from **github**
@@ -88,6 +88,30 @@ $ npm start
8888
| <b>[Node js](https://nodejs.org/en/)</b> | <b>Tested on v12.0+ |
8989
|--|--|
9090
| <b>[Git](https://git-scm.com/)</b> | <b>Tested on v2.20+</b> |
91+
92+
> **Important note for windows users**
93+
94+
If you are a windows user, then make sure that `git` is accessible from the command line without using git bash.
95+
96+
- Open command prompt or powershell and enter `git --version` and press enter. If it displays the following output, then it is fine
97+
98+
```
99+
C:\> git --version
100+
101+
git version 2.28.0.windows.1
102+
```
103+
104+
If this output is not displayed and if the command throws the following error, then it shows that `git` is not added to the 'path' environment variable and it will not be accessible directly from the command line,
105+
106+
```
107+
C:\> git --version
108+
109+
'git' is not recognized as an internal or external command,
110+
operable program or batch file.
111+
```
112+
113+
This can be fixed by adding `git` to the PATH environment variable in windows. The process of setting this up is available [here](https://stackoverflow.com/questions/26620312/git-installing-git-in-path-with-github-client-for-windows#answer-53706956:~:text=comment-,27,Here%20is%20the%20magic)
114+
91115

92116
# Detailed documentation
93117

@@ -97,3 +121,4 @@ Refer the detailed [Documentation](DOCUMENTATION.md) for how to setup and use th
97121

98122
See [LICENSE ](LICENSE) info for more
99123

124+

build/asset-manifest.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"files": {
3-
"main.css": "/static/css/main.bece8f5e.chunk.css",
4-
"main.js": "/static/js/main.a07d6054.chunk.js",
5-
"main.js.map": "/static/js/main.a07d6054.chunk.js.map",
6-
"runtime-main.js": "/static/js/runtime-main.f623be64.js",
7-
"runtime-main.js.map": "/static/js/runtime-main.f623be64.js.map",
8-
"static/js/2.a04ba513.chunk.js": "/static/js/2.a04ba513.chunk.js",
9-
"static/js/2.a04ba513.chunk.js.map": "/static/js/2.a04ba513.chunk.js.map",
3+
"main.css": "/static/css/main.4982453a.chunk.css",
4+
"main.js": "/static/js/main.7c0b6200.chunk.js",
5+
"main.js.map": "/static/js/main.7c0b6200.chunk.js.map",
6+
"runtime-main.js": "/static/js/runtime-main.704666b2.js",
7+
"runtime-main.js.map": "/static/js/runtime-main.704666b2.js.map",
8+
"static/js/2.72df468b.chunk.js": "/static/js/2.72df468b.chunk.js",
9+
"static/js/2.72df468b.chunk.js.map": "/static/js/2.72df468b.chunk.js.map",
1010
"static/js/3.305dce55.chunk.js": "/static/js/3.305dce55.chunk.js",
1111
"static/js/3.305dce55.chunk.js.map": "/static/js/3.305dce55.chunk.js.map",
1212
"static/js/4.3916cb29.chunk.js": "/static/js/4.3916cb29.chunk.js",
@@ -143,10 +143,10 @@
143143
"static/js/69.2e484cc6.chunk.js.map": "/static/js/69.2e484cc6.chunk.js.map",
144144
"static/js/70.af220eff.chunk.js": "/static/js/70.af220eff.chunk.js",
145145
"static/js/70.af220eff.chunk.js.map": "/static/js/70.af220eff.chunk.js.map",
146-
"static/js/71.41508ee1.chunk.js": "/static/js/71.41508ee1.chunk.js",
147-
"static/js/71.41508ee1.chunk.js.map": "/static/js/71.41508ee1.chunk.js.map",
148-
"static/js/72.bc359e5d.chunk.js": "/static/js/72.bc359e5d.chunk.js",
149-
"static/js/72.bc359e5d.chunk.js.map": "/static/js/72.bc359e5d.chunk.js.map",
146+
"static/js/71.21b9d286.chunk.js": "/static/js/71.21b9d286.chunk.js",
147+
"static/js/71.21b9d286.chunk.js.map": "/static/js/71.21b9d286.chunk.js.map",
148+
"static/js/72.1b668638.chunk.js": "/static/js/72.1b668638.chunk.js",
149+
"static/js/72.1b668638.chunk.js.map": "/static/js/72.1b668638.chunk.js.map",
150150
"static/js/73.fa3c90b5.chunk.js": "/static/js/73.fa3c90b5.chunk.js",
151151
"static/js/73.fa3c90b5.chunk.js.map": "/static/js/73.fa3c90b5.chunk.js.map",
152152
"static/js/74.a0094cb4.chunk.js": "/static/js/74.a0094cb4.chunk.js",
@@ -916,17 +916,17 @@
916916
"static/js/456.5871dfd5.chunk.js": "/static/js/456.5871dfd5.chunk.js",
917917
"static/js/456.5871dfd5.chunk.js.map": "/static/js/456.5871dfd5.chunk.js.map",
918918
"index.html": "/index.html",
919-
"precache-manifest.126caf2e5cd7b0982a7e6735e8116539.js": "/precache-manifest.126caf2e5cd7b0982a7e6735e8116539.js",
919+
"precache-manifest.59a427ac95ff5e64a44e736349d76f47.js": "/precache-manifest.59a427ac95ff5e64a44e736349d76f47.js",
920920
"service-worker.js": "/service-worker.js",
921-
"static/css/main.bece8f5e.chunk.css.map": "/static/css/main.bece8f5e.chunk.css.map",
922-
"static/js/2.a04ba513.chunk.js.LICENSE.txt": "/static/js/2.a04ba513.chunk.js.LICENSE.txt",
923-
"static/js/71.41508ee1.chunk.js.LICENSE.txt": "/static/js/71.41508ee1.chunk.js.LICENSE.txt",
921+
"static/css/main.4982453a.chunk.css.map": "/static/css/main.4982453a.chunk.css.map",
922+
"static/js/2.72df468b.chunk.js.LICENSE.txt": "/static/js/2.72df468b.chunk.js.LICENSE.txt",
923+
"static/js/71.21b9d286.chunk.js.LICENSE.txt": "/static/js/71.21b9d286.chunk.js.LICENSE.txt",
924924
"static/media/SplashScreen.css": "/static/media/gitconvex.e136c267.png"
925925
},
926926
"entrypoints": [
927-
"static/js/runtime-main.f623be64.js",
928-
"static/js/2.a04ba513.chunk.js",
929-
"static/css/main.bece8f5e.chunk.css",
930-
"static/js/main.a07d6054.chunk.js"
927+
"static/js/runtime-main.704666b2.js",
928+
"static/js/2.72df468b.chunk.js",
929+
"static/css/main.4982453a.chunk.css",
930+
"static/js/main.7c0b6200.chunk.js"
931931
]
932932
}

build/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)