Skip to content

Commit 0153aa2

Browse files
committed
update readme, some minor UI improvement
1 parent 5a53497 commit 0153aa2

File tree

5 files changed

+48
-29
lines changed

5 files changed

+48
-29
lines changed

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ determinstic tool.
5050
`napi` aims to support all major programming languages. Here is the current
5151
status:
5252

53-
| Language/Framework | Status | Related Issues |
54-
| ------------------ | -------------- | --------------------------------------------------- |
55-
| Python | ✅ Supported | [#28](https://github.com/nanoapi-io/napi/issues/28) |
56-
| C# | ✅ Supported | [#31](https://github.com/nanoapi-io/napi/issues/31) |
57-
| PHP | 🚧 In Progress | [#30](https://github.com/nanoapi-io/napi/issues/30) |
58-
| Java | 🚧 In Progress | [#32](https://github.com/nanoapi-io/napi/issues/32) |
59-
| C | 🚧 In Progress | Not Tracked Yet |
60-
| C++ | 🚧 In Progress | Not Tracked Yet |
61-
| JavaScript | 🚧 In Progress | Not Tracked Yet |
62-
| TypeScript | 🚧 In Progress | Not Tracked Yet |
53+
| Language/Framework | Status |
54+
| ------------------ | -------------- |
55+
| Python | ✅ Supported |
56+
| C# | ✅ Supported |
57+
| C | In Progress |
58+
| Java | 🚧 In Progress |
59+
| C++ | 🚧 In Progress |
60+
| PHP | 🚧 In Progress |
61+
| JavaScript | 🚧 In Progress |
62+
| TypeScript | 🚧 In Progress |
6363

6464
For the latest updates, visit our [project board](/projects).
6565

@@ -104,17 +104,23 @@ Initialize the project. This step is required before running any other command.
104104
This will create a .napirc configuration file in the project root, storing paths
105105
and settings necessary for further commands.
106106

107-
### `napi audit view`
107+
### `napi manifest generate`
108108

109-
Scan and audit your codebase for potential improvements, vulnerabilities, and
110-
maintainability issues. This command opens the NanoAPI UI in your default
111-
browser, providing a clear overview of what areas of your code would benefit
112-
most from refactoring or cleanup.
109+
Generate a manifest of your codebase that captures its structure, dependencies,
110+
and relationships. This command analyzes your code and writes the manifest data
111+
to the configured `napi_out` directory in your project.
113112

114-
> **Important**: Run napi audit view periodically, especially before major
115-
> refactoring efforts, to ensure your code is in good shape. It will soon also
116-
> be possible to integrate that command into CI/CD workflows to catch
117-
> architectural-level-quality issues early.
113+
### `napi manifest view`
114+
115+
Open the NanoAPI UI in your default browser to visualize and explore the
116+
manifest generated by `napi manifest generate`. This provides an interactive
117+
view of your codebase's architecture, helping you identify areas for potential
118+
improvements and refactoring.
119+
120+
> **Important**: Run `napi manifest generate` whenever you make significant
121+
> changes to your codebase to ensure your manifest stays up-to-date. The
122+
> manifest data can be integrated into CI/CD workflows to track architectural
123+
> changes over time.
118124
119125
## CI/CD Integration
120126

deno.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app/src/components/DependencyVisualizer/DependencyVisualizer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ export interface VisualizerContext {
2121
}
2222

2323
export default function DependencyVisualizer(props: {
24+
theme: string;
2425
dependencyManifest: DependencyManifest;
2526
auditManifest: AuditManifest;
2627
}) {
2728
const [searchParams] = useSearchParams();
2829

29-
const { theme, setTheme } = useTheme();
30+
const { setTheme } = useTheme();
3031

3132
const [highlightedCytoscapeRef, setHighlightedCytoscapeRef] = useState<
3233
{
@@ -109,10 +110,10 @@ export default function DependencyVisualizer(props: {
109110
<Button
110111
variant="ghost"
111112
size="icon"
112-
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
113+
onClick={() => setTheme(props.theme === "light" ? "dark" : "light")}
113114
className="mr-2"
114115
>
115-
{theme === "light" ? <Moon /> : <Sun />}
116+
{props.theme === "light" ? <Moon /> : <Sun />}
116117
</Button>
117118
</div>
118119
<div className="grow w-full border-t">

packages/app/src/components/DependencyVisualizer/components/FileExplorerSidebar.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020
ChevronRight,
2121
Code,
2222
File,
23+
FolderClosed,
24+
FolderOpen,
2325
ScanEye,
2426
SearchCode,
2527
} from "lucide-react";
@@ -254,7 +256,7 @@ function ExplorerNode(props: {
254256
onClick={() => setShowChildren(!showChildren)}
255257
className="w-full justify-start"
256258
>
257-
{showChildren ? <ChevronDown /> : <ChevronRight />}
259+
{showChildren ? <FolderOpen /> : <FolderClosed />}
258260
<DisplayNameWithTooltip
259261
name={props.node.displayName}
260262
maxChar={Math.max(5, 30 - props.level * 2)}
@@ -263,22 +265,25 @@ function ExplorerNode(props: {
263265
);
264266
case "file":
265267
return (
266-
<div className="flex justify-between items-center">
267-
<div className="flex items-center space-x-1">
268+
<div className="flex justify-between items-center gap-2">
269+
<div className="grow flex items-center gap-2">
268270
<Button
269271
variant="ghost"
270272
size="sm"
271273
onClick={() => setShowChildren(!showChildren)}
272274
className="w-full justify-start"
273275
>
276+
{showChildren
277+
? <ChevronDown size={16} />
278+
: <ChevronRight size={16} />}
274279
<File />
275280
<DisplayNameWithTooltip
276281
name={props.node.displayName}
277282
maxChar={Math.max(5, 30 - props.level * 2)}
278283
/>
279284
</Button>
280285
</div>
281-
<div className="flex items-center space-x-1">
286+
<div className="flex items-center gap-1">
282287
<Tooltip delayDuration={500}>
283288
<TooltipTrigger asChild>
284289
<Button
@@ -310,15 +315,15 @@ function ExplorerNode(props: {
310315
);
311316
case "symbol":
312317
return (
313-
<div className="flex justify-between items-center">
314-
<div className="flex items-center space-x-1">
318+
<div className="flex justify-between items-center gap-2">
319+
<div className="grow flex items-center gap-2">
315320
<Code size={12} />
316321
<DisplayNameWithTooltip
317322
name={props.node.displayName}
318323
maxChar={Math.max(5, 30 - props.level * 2)}
319324
/>
320325
</div>
321-
<div className="flex items-center space-x-1">
326+
<div className="flex items-center gap-1">
322327
<Tooltip delayDuration={500}>
323328
<TooltipTrigger asChild>
324329
<Button

packages/app/src/pages/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type { AuditManifest, DependencyManifest } from "@napi/shared";
77
import { toast } from "sonner";
88
import DependencyVisualizer from "../components/DependencyVisualizer/DependencyVisualizer.tsx";
99
import { Loader } from "lucide-react";
10+
import { useTheme } from "../contexts/ThemeProvider.tsx";
1011

1112
export default function IndexPage() {
1213
const [auditManifest, setAuditManifest] = useState<AuditManifest | undefined>(
@@ -16,6 +17,8 @@ export default function IndexPage() {
1617
DependencyManifest | undefined
1718
>(undefined);
1819

20+
const { theme } = useTheme();
21+
1922
useEffect(() => {
2023
async function handleOnLoad() {
2124
const dependencyManifestPromise = getDependencyManifest();
@@ -46,6 +49,7 @@ export default function IndexPage() {
4649
{auditManifest && dependencyManifest
4750
? (
4851
<DependencyVisualizer
52+
theme={theme}
4953
dependencyManifest={dependencyManifest}
5054
auditManifest={auditManifest}
5155
/>

0 commit comments

Comments
 (0)