Skip to content

Commit 8df7c2e

Browse files
authored
Vis improvement 2 (#54)
* feat: enhance UI components and improve accessibility - Updated typography styles across various components for better readability and consistency. - Changed heading levels and classes in DependencyDetails for improved semantic structure. - Refined button and text styles in HeaderControls and Header for a more cohesive design. - Enhanced error messages and loading indicators in MainContent for better user experience. - Improved session ID generation logic in utils for better uniqueness. - Added connection header to API requests for better performance. - Adjusted dropdown and tooltip components for improved usability and aesthetics. - Fixed minor bugs and improved overall code quality. * Add backend setup script and UI/CLI tweaks Add a backend setup-and-run.sh script and corresponding package scripts (root and backend) to automate environment creation, dependency install, DB container start, Drizzle schema generation/push, and dev server start; also add an MCP dev script and README quick-start/MCP notes. Update backend package.json and lockfile to include new dependencies required by these tools. Remove an old image optimization script. Apply assorted frontend/CLI refinements: adjust global font and diagram sizing, tweak dependency sidebar styling and tab label, enhance CodeBlock with a label and spacing, label batch commands, change save-analysis-history to deduplicate across all dates, and expand CLI command help/options and output formatting. These changes streamline local backend setup and improve UX for scanning/fixing workflows. * merge fix
1 parent 58dcdaf commit 8df7c2e

2 files changed

Lines changed: 0 additions & 52 deletions

File tree

packages/cli/src/cli.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@ import { initCommand } from "./commands/init.js";
88

99
const program = new Command();
1010

11-
<<<<<<< Updated upstream
12-
=======
1311
// Custom help formatting
1412
const formatOption = new Option("--format <format>", "Output format")
1513
.choices(["table", "json", "markdown"])
1614
.default("table");
1715

18-
>>>>>>> Stashed changes
1916
program
2017
.name("gds")
2118
.description(
2219
chalk.bold("GitDepSec") +
23-
<<<<<<< Updated upstream
24-
" - Analyze dependency vulnerabilities in your projects"
25-
)
26-
.version("1.0.0");
27-
=======
2820
" - Analyze dependency vulnerabilities in your projects\n\n" +
2921
chalk.dim("Supported ecosystems: npm, pypi, maven, go, cargo, nuget, composer")
3022
)
@@ -49,24 +41,10 @@ ${chalk.bold("Examples:")}
4941
${chalk.bold("Documentation:")}
5042
${chalk.cyan("https://github.com/viralcodex/gitdepsec#readme")}
5143
`);
52-
>>>>>>> Stashed changes
5344

5445
// Analyse command
5546
program
5647
.command("analyse")
57-
<<<<<<< Updated upstream
58-
.alias("analyze")
59-
.description("Analyze dependencies for vulnerabilities")
60-
.option("-f, --file <files...>", "Manifest file(s) to analyze")
61-
.option("-r, --repo <repo>", "GitHub repository (owner/repo)")
62-
.option("-b, --branch <branch>", "Branch to analyze (default: main)")
63-
.option("-t, --token <token>", "GitHub personal access token")
64-
.option("--no-transitive", "Disable transitive dependency scanning")
65-
.option("--format <format>", "Output format: table, json, markdown", "table")
66-
.option("-o, --output <file>", "Save output to file")
67-
.option("-q, --quiet", "Minimal output")
68-
.option("-v, --verbose", "Verbose output")
69-
=======
7048
.aliases(["analyze", "audit"])
7149
.description("Analyze dependencies for vulnerabilities")
7250
.option("-f, --file <files...>", "Manifest file(s) to analyze (e.g., package.json, requirements.txt)")
@@ -99,22 +77,12 @@ ${chalk.bold("Examples:")}
9977
$ gds analyse --format markdown ${chalk.dim("# Output as markdown")}
10078
$ gds analyse --no-transitive ${chalk.dim("# Skip transitive deps")}
10179
`)
102-
>>>>>>> Stashed changes
10380
.action(analyseCommand);
10481

10582
// Fix command
10683
program
10784
.command("fix")
10885
.description("Generate fix recommendations for vulnerabilities")
109-
<<<<<<< Updated upstream
110-
.option("-f, --file <files...>", "Manifest file(s) to fix")
111-
.option("-r, --repo <repo>", "GitHub repository (owner/repo)")
112-
.option("-b, --branch <branch>", "Branch to analyze (default: main)")
113-
.option("-t, --token <token>", "GitHub personal access token")
114-
.option("--no-transitive", "Disable transitive dependency scanning")
115-
.option("--format <format>", "Output format: table, json, markdown", "table")
116-
.option("-o, --output <file>", "Save output to file")
117-
=======
11886
.option("-f, --file <files...>", "Manifest file(s) to fix (e.g., package.json)")
11987
.option("-r, --repo <repo>", "GitHub repository in owner/repo format")
12088
.option("-b, --branch <branch>", "Branch to analyze", "main")
@@ -129,16 +97,12 @@ ${chalk.bold("Examples:")}
12997
$ gds fix -f package.json ${chalk.dim("# Fix specific file")}
13098
$ gds fix --format markdown -o fixes.md ${chalk.dim("# Export as markdown")}
13199
`)
132-
>>>>>>> Stashed changes
133100
.action(fixCommand);
134101

135102
// Init command
136103
program
137104
.command("init")
138105
.description("Create a .gitdepsecrc configuration file")
139-
<<<<<<< Updated upstream
140-
.option("--force", "Overwrite existing config")
141-
=======
142106
.option("--force", "Overwrite existing config file")
143107
.addHelpText("after", `
144108
${chalk.bold("Examples:")}
@@ -151,7 +115,6 @@ ${chalk.bold("Config File Options:")}
151115
${chalk.cyan("format")} Default output format (table|json|markdown)
152116
${chalk.cyan("transitive")} Enable transitive scanning (true|false)
153117
`)
154-
>>>>>>> Stashed changes
155118
.action(initCommand);
156119

157120
// Parse arguments

packages/cli/src/utils/formatters.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@ export function formatAnalysisTable(result: AnalysisResult): string {
118118
lines.push(statRow("Low", result.lowCount, result.lowCount > 0 ? chalk.dim : chalk.dim));
119119

120120
if (result.totalVulnerabilities === 0) {
121-
<<<<<<< Updated upstream
122-
lines.push(chalk.green.bold("✓ No vulnerabilities found!"));
123-
=======
124121
lines.push("");
125122
lines.push(rule("double"));
126123
lines.push(chalk.green.bold(`${INDENT}No vulnerabilities detected`));
@@ -130,7 +127,6 @@ export function formatAnalysisTable(result: AnalysisResult): string {
130127
lines.push(sectionHeader("Warnings"));
131128
result.errors.forEach((err) => lines.push(`${INDENT}${chalk.yellow(">")} ${err}`));
132129
}
133-
>>>>>>> Stashed changes
134130
lines.push("");
135131
return lines.join("\n");
136132
}
@@ -145,15 +141,6 @@ export function formatAnalysisTable(result: AnalysisResult): string {
145141

146142
deps.forEach((dep) => {
147143
if (dep.vulnerabilities && dep.vulnerabilities.length > 0) {
148-
<<<<<<< Updated upstream
149-
lines.push("");
150-
lines.push(` ${chalk.bold(dep.name)}@${chalk.dim(dep.version)} ${chalk.dim(`(${dep.ecosystem})`)}`);
151-
152-
dep.vulnerabilities.forEach((vuln) => {
153-
const severity = getSeverityFromScore(vuln.severityScore);
154-
const score = vuln.severityScore?.cvss_v3 || vuln.severityScore?.cvss_v4 || "N/A";
155-
lines.push(` ${colorSeverity(severity)} ${chalk.cyan(vuln.id)} (CVSS: ${score})`);
156-
=======
157144
// Package name with version
158145
lines.push(`\n${INDENT}${chalk.white.bold(dep.name)} ${chalk.dim("@" + dep.version)} ${chalk.dim.italic(dep.ecosystem)}`);
159146

@@ -164,8 +151,6 @@ export function formatAnalysisTable(result: AnalysisResult): string {
164151
// Vulnerability line with aligned columns and clickable link
165152
const linkedId = chalk.cyan(vulnLink(vuln.id.padEnd(22)));
166153
lines.push(`${DOUBLE_INDENT}${severityBadge(severity)} ${linkedId} ${chalk.dim("CVSS")} ${chalk.white(score)}`);
167-
168-
>>>>>>> Stashed changes
169154
if (vuln.summary) {
170155
lines.push(`${DOUBLE_INDENT}${chalk.dim(truncate(vuln.summary, 62))}`);
171156
}

0 commit comments

Comments
 (0)