git-truck 0.7.0 → 0.7.7-1

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.
Files changed (73) hide show
  1. package/.eslintrc.json +23 -23
  2. package/.github/workflows/bump-version.yml +33 -33
  3. package/.github/workflows/test-and-build.yml +40 -40
  4. package/.husky/pre-commit +4 -4
  5. package/.vscode/extensions.json +7 -7
  6. package/.vscode/launch.json +24 -24
  7. package/.vscode/settings.json +6 -6
  8. package/LICENSE +21 -21
  9. package/README.md +88 -88
  10. package/build/index.js +171 -81
  11. package/package.json +113 -113
  12. package/post-build.js +14 -14
  13. package/project-statement.md +43 -43
  14. package/remix.config.js +21 -21
  15. package/remix.env.d.ts +2 -2
  16. package/server.ts +103 -103
  17. package/src/analyzer/analyze.server.ts +344 -334
  18. package/src/analyzer/analyze.test.ts +30 -30
  19. package/src/analyzer/args.server.ts +36 -36
  20. package/src/analyzer/coauthors.server.ts +16 -16
  21. package/src/analyzer/constants.ts +1 -1
  22. package/src/analyzer/hydrate.server.ts +200 -200
  23. package/src/analyzer/index.ts +4 -4
  24. package/src/analyzer/log.server.ts +97 -97
  25. package/src/analyzer/model.ts +105 -104
  26. package/src/analyzer/postprocessing.server.ts +77 -77
  27. package/src/analyzer/queue.ts +86 -86
  28. package/src/analyzer/util.test.ts +8 -8
  29. package/src/analyzer/util.ts +228 -229
  30. package/src/authorUnionUtil.test.ts +82 -82
  31. package/src/authorUnionUtil.ts +70 -70
  32. package/src/components/AuthorDistFragment.tsx +27 -27
  33. package/src/components/AuthorDistOther.tsx +24 -24
  34. package/src/components/Chart.tsx +421 -400
  35. package/src/components/Details.tsx +310 -276
  36. package/src/components/EnumSelect.tsx +31 -31
  37. package/src/components/GlobalInfo.tsx +52 -43
  38. package/src/components/HiddenFiles.tsx +84 -71
  39. package/src/components/Legend.tsx +139 -139
  40. package/src/components/LegendFragment.tsx +29 -29
  41. package/src/components/LegendOther.tsx +43 -43
  42. package/src/components/Main.tsx +102 -102
  43. package/src/components/Options.tsx +24 -24
  44. package/src/components/Providers.tsx +135 -135
  45. package/src/components/SearchBar.tsx +51 -51
  46. package/src/components/SidePanel.tsx +13 -13
  47. package/src/components/Spacer.tsx +71 -71
  48. package/src/components/Toggle.tsx +62 -62
  49. package/src/components/Tooltip.tsx +131 -131
  50. package/src/components/util.tsx +157 -143
  51. package/src/const.ts +6 -6
  52. package/src/contexts/ClickedContext.ts +17 -17
  53. package/src/contexts/DataContext.ts +12 -12
  54. package/src/contexts/MetricContext.ts +14 -14
  55. package/src/contexts/OptionsContext.ts +40 -40
  56. package/src/contexts/PathContext.ts +16 -16
  57. package/src/contexts/SearchContext.ts +16 -16
  58. package/src/entry.client.tsx +8 -8
  59. package/src/entry.server.tsx +27 -27
  60. package/src/extension-color.ts +34 -34
  61. package/src/hooks.ts +17 -17
  62. package/src/lang-map.d.ts +3 -3
  63. package/src/metrics.ts +346 -346
  64. package/src/root.tsx +35 -35
  65. package/src/routes/index.tsx +10 -10
  66. package/src/routes/repo.tsx +116 -116
  67. package/src/styles/App.css +3 -3
  68. package/src/styles/Chart.css +26 -26
  69. package/src/styles/index.css +35 -35
  70. package/src/styles/vars.css +21 -21
  71. package/src/util.ts +45 -35
  72. package/truckconfig.json +21 -21
  73. package/tsconfig.json +21 -21
package/.eslintrc.json CHANGED
@@ -1,23 +1,23 @@
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
- "rules": {
20
- "no-case-declarations":"off"
21
- }
22
- }
23
-
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
+ "rules": {
20
+ "no-case-declarations":"off"
21
+ }
22
+ }
23
+
@@ -1,34 +1,34 @@
1
- name: "Bump version"
2
-
3
- on:
4
- push:
5
- branches:
6
- - "main"
7
-
8
- jobs:
9
- bump-version:
10
- name: "Bump Version on main"
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - name: "Checkout source code"
15
- uses: "actions/checkout@v2"
16
- with:
17
- ref: ${{ github.ref }}
18
- token: ${{ secrets.TOKEN }}
19
- - name: "cat package.json"
20
- run: cat ./package.json
21
- - name: "Setup Node.js"
22
- uses: "actions/setup-node@v2"
23
- with:
24
- node-version: 14
25
- - name: Update version in package.json
26
- uses: "phips28/gh-action-bump-version@master"
27
- with:
28
- skip-tag: "true"
29
- minor-wording: "NewVersion"
30
- commit-message: "Bump version to {{version}}"
31
- env:
32
- GITHUB_TOKEN: ${{ secrets.TOKEN }}
33
- - name: "cat package.json"
1
+ name: "Bump version"
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+
8
+ jobs:
9
+ bump-version:
10
+ name: "Bump Version on main"
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: "Checkout source code"
15
+ uses: "actions/checkout@v2"
16
+ with:
17
+ ref: ${{ github.ref }}
18
+ token: ${{ secrets.TOKEN }}
19
+ - name: "cat package.json"
20
+ run: cat ./package.json
21
+ - name: "Setup Node.js"
22
+ uses: "actions/setup-node@v2"
23
+ with:
24
+ node-version: 14
25
+ - name: Update version in package.json
26
+ uses: "phips28/gh-action-bump-version@master"
27
+ with:
28
+ skip-tag: "true"
29
+ minor-wording: "NewVersion"
30
+ commit-message: "Bump version to {{version}}"
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.TOKEN }}
33
+ - name: "cat package.json"
34
34
  run: cat ./package.json
@@ -1,40 +1,40 @@
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 tsc
35
- - run: npm run build
36
-
37
- - name: Upload coverage to Codecov
38
- uses: codecov/codecov-action@v2
39
- with:
40
- 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 tsc
35
+ - run: npm run build
36
+
37
+ - name: Upload coverage to Codecov
38
+ uses: codecov/codecov-action@v2
39
+ with:
40
+ 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
@@ -1,7 +1,7 @@
1
- {
2
- "recommendations": [
3
- "esbenp.prettier-vscode",
4
- "styled-components.vscode-styled-components",
5
- "Orta.vscode-jest"
6
- ]
7
- }
1
+ {
2
+ "recommendations": [
3
+ "esbenp.prettier-vscode",
4
+ "styled-components.vscode-styled-components",
5
+ "Orta.vscode-jest"
6
+ ]
7
+ }
@@ -1,24 +1,24 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
- {
8
- "name": "Debug Remix App",
9
- "program": "${workspaceFolder}/build/index.js",
10
- "request": "launch",
11
- "skipFiles": [
12
- "<node_internals>/**"
13
- ],
14
- "type": "pwa-node"
15
- },
16
- {
17
- "type": "pwa-chrome",
18
- "request": "launch",
19
- "name": "Launch visualization in chrome",
20
- "url": "http://localhost:3000",
21
- "webRoot": "${workspaceFolder}"
22
- }
23
- ]
24
- }
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Debug Remix App",
9
+ "program": "${workspaceFolder}/build/index.js",
10
+ "request": "launch",
11
+ "skipFiles": [
12
+ "<node_internals>/**"
13
+ ],
14
+ "type": "pwa-node"
15
+ },
16
+ {
17
+ "type": "pwa-chrome",
18
+ "request": "launch",
19
+ "name": "Launch visualization in chrome",
20
+ "url": "http://localhost:3000",
21
+ "webRoot": "${workspaceFolder}"
22
+ }
23
+ ]
24
+ }
@@ -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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 git-visual
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 git-visual
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,88 +1,88 @@
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 `npx git-truck` in the root of a git repository, that you want to visualize:
18
-
19
- ```sh
20
- npx git-truck [args]
21
- ```
22
-
23
- #### [Arguments](#arguments)
24
-
25
- | arg | description | default value |
26
- | :--------: | :---------------------------------------------------------------------: | :----------------: |
27
- | `--branch` | branch name | checked out branch |
28
- | `--path` | path to git repository | current directory |
29
- | `--log` | output log level. See [here](./src/analyzer/log.server.ts) for values | - |
30
-
31
- ### [Configuration](#configuration)
32
-
33
- You can add a `truckconfig.json` file to the root of your project, where you can define the arguments you want.
34
- Additionally you can define which git-aliases should be considered as the same person.
35
- You can also define files to ignore.
36
- Example:
37
-
38
- ```json
39
- {
40
- "log": "debug",
41
- "branch": "main",
42
- "unionedAuthors": [
43
- ["Bob", "Bobby Bob"],
44
- ["Alice", "aliiii", "alice alice"]
45
- ],
46
- "hiddenFiles": ["package-lock.json", "*.bin", "*.svg"]
47
- }
48
- ```
49
-
50
- ## [Development](#development)
51
-
52
- 1. Install dependencies with `npm install`
53
- 2. Run git-truck in development mode with:
54
-
55
- ```sh
56
- npm run dev
57
- ```
58
-
59
- _or using yarn:_ `yarn dev`
60
-
61
- This starts the app in development mode, rebuilding assets on file changes.
62
-
63
- **Note:**
64
- If you want to provide args to the parser, you need to run remix and node separately in two different terminals:
65
-
66
- ```
67
- npm run dev:remix
68
- ```
69
-
70
- and
71
-
72
- ```
73
- npm run dev:node -- <args>
74
- ```
75
-
76
- For arguments, see [Arguments](#arguments).
77
-
78
- ### [Husky](#husky)
79
-
80
- To enable husky, run `npx husky install`.
81
-
82
- ## [Clean up](#clean-up)
83
-
84
- To clean up build artefacts, cached analyzations, etc., run:
85
-
86
- ```
87
- npm run clean
88
- ```
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 `npx git-truck` in the root of a git repository, that you want to visualize:
18
+
19
+ ```sh
20
+ npx git-truck [args]
21
+ ```
22
+
23
+ #### [Arguments](#arguments)
24
+
25
+ | arg | description | default value |
26
+ | :--------: | :---------------------------------------------------------------------: | :----------------: |
27
+ | `--branch` | branch name | checked out branch |
28
+ | `--path` | path to git repository | current directory |
29
+ | `--log` | output log level. See [here](./src/analyzer/log.server.ts) for values | - |
30
+
31
+ ### [Configuration](#configuration)
32
+
33
+ You can add a `truckconfig.json` file to the root of your project, where you can define the arguments you want.
34
+ Additionally you can define which git-aliases should be considered as the same person.
35
+ You can also define files to ignore.
36
+ Example:
37
+
38
+ ```json
39
+ {
40
+ "log": "debug",
41
+ "branch": "main",
42
+ "unionedAuthors": [
43
+ ["Bob", "Bobby Bob"],
44
+ ["Alice", "aliiii", "alice alice"]
45
+ ],
46
+ "hiddenFiles": ["package-lock.json", "*.bin", "*.svg"]
47
+ }
48
+ ```
49
+
50
+ ## [Development](#development)
51
+
52
+ 1. Install dependencies with `npm install`
53
+ 2. Run git-truck in development mode with:
54
+
55
+ ```sh
56
+ npm run dev
57
+ ```
58
+
59
+ _or using yarn:_ `yarn dev`
60
+
61
+ This starts the app in development mode, rebuilding assets on file changes.
62
+
63
+ **Note:**
64
+ If you want to provide args to the parser, you need to run remix and node separately in two different terminals:
65
+
66
+ ```
67
+ npm run dev:remix
68
+ ```
69
+
70
+ and
71
+
72
+ ```
73
+ npm run dev:node -- <args>
74
+ ```
75
+
76
+ For arguments, see [Arguments](#arguments).
77
+
78
+ ### [Husky](#husky)
79
+
80
+ To enable husky, run `npx husky install`.
81
+
82
+ ## [Clean up](#clean-up)
83
+
84
+ To clean up build artefacts, cached analyzations, etc., run:
85
+
86
+ ```
87
+ npm run clean
88
+ ```