git-truck 0.7.6 → 0.7.7-0

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/build/index.js CHANGED
@@ -5803,11 +5803,26 @@ var StyledBox = (0, import_styled_components7.default)(Box)`
5803
5803
  display: flex;
5804
5804
  flex-direction: column;
5805
5805
  `;
5806
+ function findSearchResults(tree, searchString) {
5807
+ const searchResults = [];
5808
+ function subTreeSearch(subTree) {
5809
+ for (const child of subTree.children) {
5810
+ if (child.name.includes(searchString))
5811
+ searchResults.push(child);
5812
+ if (child.type === "tree")
5813
+ subTreeSearch(child);
5814
+ }
5815
+ }
5816
+ subTreeSearch(tree);
5817
+ return searchResults;
5818
+ }
5806
5819
  function SearchBar() {
5807
5820
  const searchFieldRef = (0, import_react12.useRef)(null);
5808
5821
  const { setSearchText } = useSearch();
5809
5822
  const [value, setValue] = (0, import_react12.useState)("");
5810
5823
  const id = (0, import_utils2.useId)();
5824
+ const [searchResults, setSearchResults] = (0, import_react12.useState)([]);
5825
+ const data = useData();
5811
5826
  (0, import_react_use2.useDebounce)(() => setSearchText(value), 200, [value]);
5812
5827
  (0, import_react12.useEffect)(() => {
5813
5828
  const searchOverride = (event) => {
@@ -5834,7 +5849,12 @@ function SearchBar() {
5834
5849
  placeholder: "Enter terms",
5835
5850
  onChange: (event) => {
5836
5851
  setValue(event.target.value);
5852
+ setSearchResults(findSearchResults(data.commit.tree, event.target.value));
5837
5853
  }
5854
+ }), searchResults.map((result) => {
5855
+ return /* @__PURE__ */ React.createElement("button", {
5856
+ key: result.path
5857
+ }, result.name);
5838
5858
  }));
5839
5859
  }
5840
5860
 
@@ -6462,7 +6482,7 @@ function Index() {
6462
6482
 
6463
6483
  // server-assets-manifest:@remix-run/dev/assets-manifest
6464
6484
  init_react();
6465
- var assets_manifest_default = { "version": "f64d0b94", "entry": { "module": "/build/entry.client-KSYGPJNH.js", "imports": ["/build/_shared/chunk-TG3VUAQG.js", "/build/_shared/chunk-SQUDAINV.js", "/build/_shared/chunk-BC37YV7Z.js"] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "module": "/build/root-GDC4BREW.js", "imports": void 0, "hasAction": false, "hasLoader": false, "hasCatchBoundary": false, "hasErrorBoundary": false }, "routes/index": { "id": "routes/index", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "module": "/build/routes/index-Z6NZE4DS.js", "imports": void 0, "hasAction": false, "hasLoader": false, "hasCatchBoundary": false, "hasErrorBoundary": false }, "routes/repo": { "id": "routes/repo", "parentId": "root", "path": "repo", "index": void 0, "caseSensitive": void 0, "module": "/build/routes/repo-5WGDOE26.js", "imports": void 0, "hasAction": true, "hasLoader": true, "hasCatchBoundary": false, "hasErrorBoundary": false } }, "url": "/build/manifest-F64D0B94.js" };
6485
+ var assets_manifest_default = { "version": "76c48663", "entry": { "module": "/build/entry.client-KSYGPJNH.js", "imports": ["/build/_shared/chunk-TG3VUAQG.js", "/build/_shared/chunk-SQUDAINV.js", "/build/_shared/chunk-BC37YV7Z.js"] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "module": "/build/root-GDC4BREW.js", "imports": void 0, "hasAction": false, "hasLoader": false, "hasCatchBoundary": false, "hasErrorBoundary": false }, "routes/index": { "id": "routes/index", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "module": "/build/routes/index-Z6NZE4DS.js", "imports": void 0, "hasAction": false, "hasLoader": false, "hasCatchBoundary": false, "hasErrorBoundary": false }, "routes/repo": { "id": "routes/repo", "parentId": "root", "path": "repo", "index": void 0, "caseSensitive": void 0, "module": "/build/routes/repo-XRABXKTF.js", "imports": void 0, "hasAction": true, "hasLoader": true, "hasCatchBoundary": false, "hasErrorBoundary": false } }, "url": "/build/manifest-76C48663.js" };
6466
6486
 
6467
6487
  // server-entry-module:@remix-run/dev/server-build
6468
6488
  var entry = { module: entry_server_exports };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-truck",
3
- "version": "0.7.6",
3
+ "version": "0.7.7-0",
4
4
  "private": false,
5
5
  "description": "Visualizing a Git repository",
6
6
  "license": "MIT",
@@ -59,8 +59,8 @@ export async function analyzeCommitLight(
59
59
  ): Promise<GitCommitObjectLight> {
60
60
  const rawContent = await deflateGitObject(repo, hash)
61
61
  const commitRegex =
62
- /tree (?<tree>.*)\n(?:parent (?<parent>.*)\n)?(?:parent (?<parent2>.*)\n)?author (?<authorName>.*) <(?<authorEmail>.*)> (?<authorTimeStamp>\d*) (?<authorTimeZone>.*)\ncommitter (?<committerName>.*) <(?<committerEmail>.*)> (?<committerTimeStamp>\d*) (?<committerTimeZone>.*)\n(?:gpgsig (?:.|\n)*-----END PGP SIGNATURE-----)?\s*(?<message>.*)\s*(?<description>(?:.|\s)*)/gm
63
-
62
+ /tree (?<tree>.*)\s*(?:parent (?<parent>.*)\s*)?(?:parent (?<parent2>.*)\s*)?author (?<authorName>.*?) <(?<authorEmail>.*?)> (?<authorTimeStamp>\d*?) (?<authorTimeZone>.*?)\s*committer (?<committerName>.*?) <(?<committerEmail>.*?)> (?<committerTimeStamp>\d*?) (?<committerTimeZone>.*)\s*(?:gpgsig (?:.|\s)*?-----END PGP SIGNATURE-----)?\s*(?<message>.*)\s*(?<description>(?:.|\s)*)/gm
63
+
64
64
  const match = commitRegex.exec(rawContent)
65
65
  const groups = match?.groups ?? {}
66
66
 
@@ -37,7 +37,7 @@ export function GlobalInfo() {
37
37
  <Spacer/>
38
38
  <strong>Analyzed: </strong>{dateTimeFormatShort(data.lastRunEpoch)}
39
39
  <Spacer />
40
- <strong>As of commit: </strong><InlineCode title={data.commit.message}>{data.commit.hash.slice(0, 7)}</InlineCode>
40
+ <strong>As of commit: </strong><InlineCode title={data.commit.message ?? "No commit message"}>{data.commit.hash.slice(0, 7)}</InlineCode>
41
41
  </div>
42
42
  <Spacer/>
43
43
  <Form method="post" action="/repo">