git-truck 0.5.12 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +20 -20
- package/.github/workflows/test-and-build.yml +39 -39
- package/.husky/pre-commit +4 -4
- package/.vscode/settings.json +6 -6
- package/README.md +77 -77
- package/app/entry.client.tsx +4 -4
- package/app/entry.server.tsx +27 -27
- package/app/parser/.eslintignore +3 -3
- package/app/parser/.eslintrc.json +18 -18
- package/app/parser/src/TruckIgnore.server.ts +20 -20
- package/app/parser/src/constants.ts +1 -1
- package/app/parser/src/hydrate.server.ts +199 -199
- package/app/parser/src/index.ts +5 -5
- package/app/parser/src/log.server.ts +97 -97
- package/app/parser/src/model.ts +77 -77
- package/app/parser/src/parse.server.ts +276 -276
- package/app/parser/src/parse.test.ts +32 -32
- package/app/parser/src/queue.ts +86 -86
- package/app/parser/src/util.test.ts +8 -8
- package/app/parser/src/util.ts +216 -216
- package/app/root.tsx +35 -35
- package/app/routes/index.tsx +43 -43
- package/app/src/authorUnionUtil.test.ts +82 -82
- package/app/src/authorUnionUtil.ts +52 -52
- package/app/src/components/AuthorDistFragment.tsx +27 -27
- package/app/src/components/AuthorDistOther.tsx +24 -24
- package/app/src/components/Chart.tsx +362 -362
- package/app/src/components/Details.tsx +177 -177
- package/app/src/components/Legend.tsx +65 -65
- package/app/src/components/LegendOther.tsx +43 -43
- package/app/src/components/Providers.tsx +121 -121
- package/app/src/components/SearchBar.tsx +36 -36
- package/app/src/components/Toggle.tsx +21 -21
- package/app/src/components/Tooltip.tsx +131 -131
- package/app/src/components/util.tsx +149 -149
- package/app/src/contexts/DataContext.ts +12 -12
- package/app/src/contexts/OptionsContext.ts +46 -46
- package/app/src/hooks.ts +17 -17
- package/app/src/metrics.ts +319 -319
- package/app/src/util.ts +33 -33
- package/app/styles/App.css +3 -3
- package/app/styles/Chart.css +26 -26
- package/app/styles/index.css +35 -35
- package/app/styles/vars.css +17 -17
- package/build/index.js +16 -11
- package/package.json +105 -97
- package/parse.sh +26 -26
- package/post-build.js +14 -14
- package/remix.config.js +21 -21
- package/remix.env.d.ts +2 -2
- package/server.js +48 -42
- package/tsconfig.json +20 -20
package/.eslintrc.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": false,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"@remix-run/eslint-config",
|
|
8
|
-
"eslint:recommended",
|
|
9
|
-
"plugin:@typescript-eslint/recommended"
|
|
10
|
-
],
|
|
11
|
-
"parser": "@typescript-eslint/parser",
|
|
12
|
-
"parserOptions": {
|
|
13
|
-
"ecmaVersion": "latest",
|
|
14
|
-
"sourceType": "module"
|
|
15
|
-
},
|
|
16
|
-
"plugins": [
|
|
17
|
-
"@typescript-eslint"
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": false,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"@remix-run/eslint-config",
|
|
8
|
+
"eslint:recommended",
|
|
9
|
+
"plugin:@typescript-eslint/recommended"
|
|
10
|
+
],
|
|
11
|
+
"parser": "@typescript-eslint/parser",
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaVersion": "latest",
|
|
14
|
+
"sourceType": "module"
|
|
15
|
+
},
|
|
16
|
+
"plugins": [
|
|
17
|
+
"@typescript-eslint"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: Test and build
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [main]
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [main]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
test-and-build:
|
|
14
|
-
runs-on: ubuntu-latest
|
|
15
|
-
|
|
16
|
-
strategy:
|
|
17
|
-
matrix:
|
|
18
|
-
node-version: [16.x, 17.x]
|
|
19
|
-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
20
|
-
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v2
|
|
23
|
-
with:
|
|
24
|
-
fetch-depth: '0'
|
|
25
|
-
|
|
26
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
-
uses: actions/setup-node@v2
|
|
28
|
-
with:
|
|
29
|
-
node-version: ${{ matrix.node-version }}
|
|
30
|
-
cache: 'npm'
|
|
31
|
-
|
|
32
|
-
- run: npm ci
|
|
33
|
-
- run: npm test
|
|
34
|
-
- run: npm run build
|
|
35
|
-
|
|
36
|
-
- name: Upload coverage to Codecov
|
|
37
|
-
uses: codecov/codecov-action@v2
|
|
38
|
-
with:
|
|
39
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|
|
1
|
+
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Test and build
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [main]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test-and-build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
|
|
16
|
+
strategy:
|
|
17
|
+
matrix:
|
|
18
|
+
node-version: [16.x, 17.x]
|
|
19
|
+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v2
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: '0'
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v2
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
cache: 'npm'
|
|
31
|
+
|
|
32
|
+
- run: npm ci
|
|
33
|
+
- run: npm test
|
|
34
|
+
- run: npm run build
|
|
35
|
+
|
|
36
|
+
- name: Upload coverage to Codecov
|
|
37
|
+
uses: codecov/codecov-action@v2
|
|
38
|
+
with:
|
|
39
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
package/.husky/pre-commit
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
. "$(dirname "$0")/_/husky.sh"
|
|
3
|
-
|
|
4
|
-
npx lint-staged
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
. "$(dirname "$0")/_/husky.sh"
|
|
3
|
+
|
|
4
|
+
npx lint-staged
|
package/.vscode/settings.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.formatOnSave": false,
|
|
3
|
-
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
|
|
4
|
-
"githubIssues.issueBranchTitle": "${issueNumber}/${sanitizedIssueTitle}",
|
|
5
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": false,
|
|
3
|
+
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
|
|
4
|
+
"githubIssues.issueBranchTitle": "${issueNumber}/${sanitizedIssueTitle}",
|
|
5
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
6
|
+
}
|
package/README.md
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
# Git Truck 🚛
|
|
2
|
-
|
|
3
|
-
_Visualizing a Git repository_
|
|
4
|
-
|
|
5
|
-
Get an overview over your git repo. See your folder-structure, which users have contributed most to which files, and more.
|
|
6
|
-
|
|
7
|
-
## [Prerequisites](#prerequisites)
|
|
8
|
-
|
|
9
|
-
This projected is tested to work with:
|
|
10
|
-
|
|
11
|
-
- Node.js 16.13
|
|
12
|
-
- npm 6.14
|
|
13
|
-
- git 2.35
|
|
14
|
-
|
|
15
|
-
## [Usage](#usage)
|
|
16
|
-
|
|
17
|
-
Run the tool like this:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
npx git-truck [--path <path>] [--branch <name>] [--out <path>] [--log <path>]
|
|
21
|
-
```
|
|
22
|
-
You can also install it globally:
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
npm install -g git-truck
|
|
26
|
-
```
|
|
27
|
-
And then run it like
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
git-truck [--path <path>] [--branch <name>] [--out <path>] [--log <path>]
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
#### [Arguments](#arguments)
|
|
34
|
-
|
|
35
|
-
| arg | default value | description |
|
|
36
|
-
| :--------: | :----------------: | :---------------------------------------------------------------------: |
|
|
37
|
-
| `--path` | current directory | path to git repository |
|
|
38
|
-
| `--branch` | checked out branch | branch name |
|
|
39
|
-
| `--out` | ./data.json | output path for data file |
|
|
40
|
-
| `--log` | null | output log level. See [here](./app/parser/src/log.server.ts) for values |
|
|
41
|
-
|
|
42
|
-
## [Uninstall](#uninstall)
|
|
43
|
-
Uninstall the tool by running `npm uninstall -g git-truck` or `sudo npm uninstall -g git-truck`
|
|
44
|
-
|
|
45
|
-
## [Development](#development)
|
|
46
|
-
|
|
47
|
-
After dependencies have been installed, run
|
|
48
|
-
```
|
|
49
|
-
npx remix setup node
|
|
50
|
-
```
|
|
51
|
-
to setup remix.
|
|
52
|
-
|
|
53
|
-
Now you can run the tool in development mode:
|
|
54
|
-
|
|
55
|
-
In the root of the project, run the following from your terminal:
|
|
56
|
-
|
|
57
|
-
```sh
|
|
58
|
-
npm run dev -- <args>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
_or using yarn:_ `yarn dev <args>`
|
|
62
|
-
|
|
63
|
-
For arguments, see [Arguments](#arguments).
|
|
64
|
-
|
|
65
|
-
This starts the app in development mode, rebuilding assets on file changes.
|
|
66
|
-
|
|
67
|
-
### [Husky](#husky)
|
|
68
|
-
|
|
69
|
-
To enable husky, run `npx husky install`.
|
|
70
|
-
|
|
71
|
-
## Clean up
|
|
72
|
-
|
|
73
|
-
To clean up build artefacts, etc. run:
|
|
74
|
-
|
|
75
|
-
```
|
|
76
|
-
npm run clean
|
|
77
|
-
```
|
|
1
|
+
# Git Truck 🚛
|
|
2
|
+
|
|
3
|
+
_Visualizing a Git repository_
|
|
4
|
+
|
|
5
|
+
Get an overview over your git repo. See your folder-structure, which users have contributed most to which files, and more.
|
|
6
|
+
|
|
7
|
+
## [Prerequisites](#prerequisites)
|
|
8
|
+
|
|
9
|
+
This projected is tested to work with:
|
|
10
|
+
|
|
11
|
+
- Node.js 16.13
|
|
12
|
+
- npm 6.14
|
|
13
|
+
- git 2.35
|
|
14
|
+
|
|
15
|
+
## [Usage](#usage)
|
|
16
|
+
|
|
17
|
+
Run the tool like this:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
npx git-truck [--path <path>] [--branch <name>] [--out <path>] [--log <path>]
|
|
21
|
+
```
|
|
22
|
+
You can also install it globally:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install -g git-truck
|
|
26
|
+
```
|
|
27
|
+
And then run it like
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
git-truck [--path <path>] [--branch <name>] [--out <path>] [--log <path>]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### [Arguments](#arguments)
|
|
34
|
+
|
|
35
|
+
| arg | default value | description |
|
|
36
|
+
| :--------: | :----------------: | :---------------------------------------------------------------------: |
|
|
37
|
+
| `--path` | current directory | path to git repository |
|
|
38
|
+
| `--branch` | checked out branch | branch name |
|
|
39
|
+
| `--out` | ./data.json | output path for data file |
|
|
40
|
+
| `--log` | null | output log level. See [here](./app/parser/src/log.server.ts) for values |
|
|
41
|
+
|
|
42
|
+
## [Uninstall](#uninstall)
|
|
43
|
+
Uninstall the tool by running `npm uninstall -g git-truck` or `sudo npm uninstall -g git-truck`
|
|
44
|
+
|
|
45
|
+
## [Development](#development)
|
|
46
|
+
|
|
47
|
+
After dependencies have been installed, run
|
|
48
|
+
```
|
|
49
|
+
npx remix setup node
|
|
50
|
+
```
|
|
51
|
+
to setup remix.
|
|
52
|
+
|
|
53
|
+
Now you can run the tool in development mode:
|
|
54
|
+
|
|
55
|
+
In the root of the project, run the following from your terminal:
|
|
56
|
+
|
|
57
|
+
```sh
|
|
58
|
+
npm run dev -- <args>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
_or using yarn:_ `yarn dev <args>`
|
|
62
|
+
|
|
63
|
+
For arguments, see [Arguments](#arguments).
|
|
64
|
+
|
|
65
|
+
This starts the app in development mode, rebuilding assets on file changes.
|
|
66
|
+
|
|
67
|
+
### [Husky](#husky)
|
|
68
|
+
|
|
69
|
+
To enable husky, run `npx husky install`.
|
|
70
|
+
|
|
71
|
+
## Clean up
|
|
72
|
+
|
|
73
|
+
To clean up build artefacts, etc. run:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
npm run clean
|
|
77
|
+
```
|
package/app/entry.client.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hydrate } from "react-dom";
|
|
2
|
-
import { RemixBrowser } from "remix";
|
|
3
|
-
|
|
4
|
-
hydrate(<RemixBrowser />, document);
|
|
1
|
+
import { hydrate } from "react-dom";
|
|
2
|
+
import { RemixBrowser } from "remix";
|
|
3
|
+
|
|
4
|
+
hydrate(<RemixBrowser />, document);
|
package/app/entry.server.tsx
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { renderToString } from "react-dom/server";
|
|
2
|
-
import { RemixServer } from "remix";
|
|
3
|
-
import type { EntryContext } from "remix";
|
|
4
|
-
import { ServerStyleSheet } from "styled-components";
|
|
5
|
-
|
|
6
|
-
export default function handleRequest(
|
|
7
|
-
request: Request,
|
|
8
|
-
responseStatusCode: number,
|
|
9
|
-
responseHeaders: Headers,
|
|
10
|
-
remixContext: EntryContext
|
|
11
|
-
) {
|
|
12
|
-
const sheet = new ServerStyleSheet();
|
|
13
|
-
let markup = renderToString(
|
|
14
|
-
sheet.collectStyles(
|
|
15
|
-
<RemixServer context={remixContext} url={request.url} />
|
|
16
|
-
)
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
const styles = sheet.getStyleTags()
|
|
20
|
-
markup = markup.replace("__STYLES__", styles)
|
|
21
|
-
responseHeaders.set("Content-Type", "text/html");
|
|
22
|
-
|
|
23
|
-
return new Response("<!DOCTYPE html>" + markup, {
|
|
24
|
-
status: responseStatusCode,
|
|
25
|
-
headers: responseHeaders,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
1
|
+
import { renderToString } from "react-dom/server";
|
|
2
|
+
import { RemixServer } from "remix";
|
|
3
|
+
import type { EntryContext } from "remix";
|
|
4
|
+
import { ServerStyleSheet } from "styled-components";
|
|
5
|
+
|
|
6
|
+
export default function handleRequest(
|
|
7
|
+
request: Request,
|
|
8
|
+
responseStatusCode: number,
|
|
9
|
+
responseHeaders: Headers,
|
|
10
|
+
remixContext: EntryContext
|
|
11
|
+
) {
|
|
12
|
+
const sheet = new ServerStyleSheet();
|
|
13
|
+
let markup = renderToString(
|
|
14
|
+
sheet.collectStyles(
|
|
15
|
+
<RemixServer context={remixContext} url={request.url} />
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const styles = sheet.getStyleTags()
|
|
20
|
+
markup = markup.replace("__STYLES__", styles)
|
|
21
|
+
responseHeaders.set("Content-Type", "text/html");
|
|
22
|
+
|
|
23
|
+
return new Response("<!DOCTYPE html>" + markup, {
|
|
24
|
+
status: responseStatusCode,
|
|
25
|
+
headers: responseHeaders,
|
|
26
|
+
});
|
|
27
|
+
}
|
package/app/parser/.eslintignore
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
dist
|
|
2
|
-
node_modules
|
|
3
|
-
.github
|
|
1
|
+
dist
|
|
2
|
+
node_modules
|
|
3
|
+
.github
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": false,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"eslint:recommended",
|
|
8
|
-
"plugin:@typescript-eslint/recommended"
|
|
9
|
-
],
|
|
10
|
-
"parser": "@typescript-eslint/parser",
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"ecmaVersion": "latest",
|
|
13
|
-
"sourceType": "module"
|
|
14
|
-
},
|
|
15
|
-
"plugins": [
|
|
16
|
-
"@typescript-eslint"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"browser": false,
|
|
4
|
+
"es2021": true
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"eslint:recommended",
|
|
8
|
+
"plugin:@typescript-eslint/recommended"
|
|
9
|
+
],
|
|
10
|
+
"parser": "@typescript-eslint/parser",
|
|
11
|
+
"parserOptions": {
|
|
12
|
+
"ecmaVersion": "latest",
|
|
13
|
+
"sourceType": "module"
|
|
14
|
+
},
|
|
15
|
+
"plugins": [
|
|
16
|
+
"@typescript-eslint"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { readFileSync } from "fs"
|
|
2
|
-
import { compile } from "gitignore-parser"
|
|
3
|
-
import { log } from "./log.server"
|
|
4
|
-
|
|
5
|
-
export default class TruckIgnore {
|
|
6
|
-
private truckignore
|
|
7
|
-
constructor(path: string) {
|
|
8
|
-
try {
|
|
9
|
-
const file = readFileSync(path + "/.truckignore", "utf-8")
|
|
10
|
-
this.truckignore = compile(file)
|
|
11
|
-
} catch (e) {
|
|
12
|
-
log.warn("No .truckignore found")
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
public isAccepted(fileName: string) {
|
|
17
|
-
if (!this.truckignore) return true
|
|
18
|
-
return this.truckignore.accepts(fileName)
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { readFileSync } from "fs"
|
|
2
|
+
import { compile } from "gitignore-parser"
|
|
3
|
+
import { log } from "./log.server"
|
|
4
|
+
|
|
5
|
+
export default class TruckIgnore {
|
|
6
|
+
private truckignore
|
|
7
|
+
constructor(path: string) {
|
|
8
|
+
try {
|
|
9
|
+
const file = readFileSync(path + "/.truckignore", "utf-8")
|
|
10
|
+
this.truckignore = compile(file)
|
|
11
|
+
} catch (e) {
|
|
12
|
+
log.warn("No .truckignore found")
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public isAccepted(fileName: string) {
|
|
17
|
+
if (!this.truckignore) return true
|
|
18
|
+
return this.truckignore.accepts(fileName)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const emptyGitCommitHash = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|
|
1
|
+
export const emptyGitCommitHash = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"
|