Skip to content

Commit 0702cec

Browse files
committed
style: apply linting format
1 parent a830f28 commit 0702cec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1129
-1237
lines changed

CLAUDE.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CLAUDE.md - SecureChain Frontend Project Context
22

33
> **⚠️ IMPORTANT GUIDELINES FOR THIS FILE:**
4+
>
45
> - **Maximum length:** 500 lines
56
> - **Include only relevant context** for current development needs
67
> - **Remove outdated or unused sections** regularly
@@ -274,7 +275,7 @@ function MyComponent() {
274275
## 🗄️ State Management
275276

276277
- **PackageContext** - Global package state
277-
- **AuthProvider** - Authentication state
278+
- **AuthProvider** - Authentication state
278279
- **ThemeProvider** - Theme state
279280
- **Local Storage Keys:** `user_email`, `theme`, `locale`, `home-active-tab`
280281

@@ -372,9 +373,9 @@ The backend exposes **two separate endpoints** for graph expansion:
372373

373374
```typescript
374375
interface GraphNode {
375-
id: string // PURL format
376-
label: string // Package name or version
377-
type: string // PyPIPackage, NPMPackage, Version, etc.
376+
id: string // PURL format
377+
label: string // Package name or version
378+
type: string // PyPIPackage, NPMPackage, Version, etc.
378379
props: {
379380
name: string
380381
purl: string
@@ -389,12 +390,12 @@ interface GraphNode {
389390
}
390391

391392
interface GraphEdge {
392-
id: string // Format: {source}_{type}_{target}
393-
source: string // Node ID
394-
target: string // Node ID
395-
type: string // HAVE or DEPENDS_ON
393+
id: string // Format: {source}_{type}_{target}
394+
source: string // Node ID
395+
target: string // Node ID
396+
type: string // HAVE or DEPENDS_ON
396397
props?: {
397-
constraints?: string // Version constraints
398+
constraints?: string // Version constraints
398399
parent_version_name?: string
399400
}
400401
}
@@ -434,23 +435,27 @@ if (node.type === 'Version') {
434435
## 🛠️ Quick Guide for AI Agents
435436

436437
### Adding a new feature:
438+
437439
1. Create types in `/types/NewFeature.ts`
438440
2. Create hooks in `/hooks/api/useNewFeature.ts`
439441
3. Create components in `/components/feature/newfeature/`
440442
4. Add routes in `/app/[locale]/newfeature/`
441443
5. Add translations in `/public/locales/{en,es}/newfeature.json`
442444

443445
### Modifying UI:
446+
444447
1. Check `/components/ui/` for existing components
445448
2. Add with shadcn if needed: `npx shadcn-ui@latest add [component]`
446449
3. Use Tailwind for styling
447450

448451
### Adding endpoints:
452+
449453
1. Define in `/constants/apiEndpoints.ts`
450454
2. Create type in `/types/`
451455
3. Create hook in `/hooks/api/`
452456

453457
### Debugging:
458+
454459
- Check `/lib/config/config.ts` for env vars
455460
- Review `middleware.ts` for auth issues
456461
- Browser console and Network tab for API calls

app/landing-page.tsx

Lines changed: 77 additions & 26 deletions
Large diffs are not rendered by default.

components/feature/auth/ApiKeysDialog.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export function ApiKeysDialog({ open, onOpenChange }: ApiKeysDialogProps) {
235235
{newlyCreatedKey && (
236236
<div className="p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg border border-yellow-200 dark:border-yellow-800">
237237
<p className="text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-2">
238-
Copy this key now. You won\'t be able to see it again!
238+
Copy this key now. You won&apos;t be able to see it again!
239239
</p>
240240
<div className="flex items-center gap-2">
241241
<code className="flex-1 p-2 bg-white dark:bg-gray-900 rounded text-sm font-mono overflow-x-auto">
@@ -261,7 +261,9 @@ export function ApiKeysDialog({ open, onOpenChange }: ApiKeysDialogProps) {
261261
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary"></div>
262262
</div>
263263
) : apiKeys.length === 0 ? (
264-
<p className="text-center text-muted-foreground py-8">No API keys found. Create one to get started.</p>
264+
<p className="text-center text-muted-foreground py-8">
265+
No API keys found. Create one to get started.
266+
</p>
265267
) : (
266268
<Table>
267269
<TableHeader>

components/feature/auth/AuthTabs.tsx

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {
22
Card,
33
CardContent,
4-
CardDescription,
54
CardHeader,
65
CardTitle,
76
Tabs,
87
TabsContent,
98
TabsList,
10-
TabsTrigger} from '@/components/ui'
9+
TabsTrigger,
10+
} from '@/components/ui'
1111
import { KeyRound } from 'lucide-react'
1212
import { LoginForm } from './LoginForm'
1313
import { SignupForm } from './SignupForm'
@@ -42,11 +42,7 @@ interface AuthTabsProps {
4242
}
4343
}
4444

45-
export function AuthTabs({
46-
activeTab,
47-
setActiveTab,
48-
loginProps,
49-
signupProps}: AuthTabsProps) {
45+
export function AuthTabs({ activeTab, setActiveTab, loginProps, signupProps }: AuthTabsProps) {
5046
return (
5147
<div className="max-w-md mx-auto">
5248
<Card>
@@ -64,15 +60,11 @@ export function AuthTabs({
6460
</TabsList>
6561

6662
<TabsContent value="login" className="space-y-4">
67-
<LoginForm
68-
{...loginProps}
69-
/>
63+
<LoginForm {...loginProps} />
7064
</TabsContent>
7165

7266
<TabsContent value="signup" className="space-y-4">
73-
<SignupForm
74-
{...signupProps}
75-
/>
67+
<SignupForm {...signupProps} />
7668
</TabsContent>
7769
</Tabs>
7870
</CardContent>

components/feature/auth/LoginForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ export function LoginForm({
2121
showPassword,
2222
setShowPassword,
2323
isSubmitting,
24-
onSubmit}: LoginFormProps) {
24+
onSubmit,
25+
}: LoginFormProps) {
2526
return (
2627
<form onSubmit={onSubmit} className="space-y-4 sm:space-y-6">
2728
<div className="space-y-2">

components/feature/auth/SignupForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ export function SignupForm({
2929
showConfirmPassword,
3030
setShowConfirmPassword,
3131
isSubmitting,
32-
onSubmit}: SignupFormProps) {
32+
onSubmit,
33+
}: SignupFormProps) {
3334
return (
3435
<form onSubmit={onSubmit} className="space-y-4 sm:space-y-6">
3536
<div className="space-y-2">

components/feature/depex/DirectDependenciesList.tsx

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import { VersionList } from './VersionList'
99
interface DirectDependenciesListProps {
1010
dependencies: DirectDependency[]
1111
nodeType: string
12-
1312
}
1413

15-
export function DirectDependenciesList({ dependencies,
16-
nodeType, }: DirectDependenciesListProps) {
14+
export function DirectDependenciesList({ dependencies, nodeType }: DirectDependenciesListProps) {
1715
// Map node_type to friendly display names
1816
const getNodeTypeDisplay = (type: string) => {
1917
const typeMap: Record<string, string> = {
@@ -45,25 +43,18 @@ export function DirectDependenciesList({ dependencies,
4543
{getNodeTypeDisplay(nodeType)}
4644
</Badge>
4745
</div>
48-
<p className="text-sm text-muted-foreground mt-1">
49-
Vendor: {dep.package_vendor}
50-
</p>
46+
<p className="text-sm text-muted-foreground mt-1">Vendor: {dep.package_vendor}</p>
5147
</div>
5248
<div className="flex items-center gap-2">
5349
<Badge variant="outline" className="font-mono text-xs">
5450
{dep.package_constraints}
5551
</Badge>
56-
<Badge variant="secondary">
57-
{dep.versions.length} versions
58-
</Badge>
52+
<Badge variant="secondary">{dep.versions.length} versions</Badge>
5953
</div>
6054
</div>
6155
</CardHeader>
6256
<CardContent className="pt-6">
63-
<VersionList
64-
versions={dep.versions}
65-
packageName={dep.package_name}
66-
/>
57+
<VersionList versions={dep.versions} packageName={dep.package_name} />
6758
</CardContent>
6859
</Card>
6960
))}

components/feature/depex/DirectDependenciesVersionList.tsx

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import { VersionList } from './VersionList'
99
interface DirectDependenciesVersionListProps {
1010
dependencies: DirectDependencyVersion[]
1111
nodeType: string
12-
1312
}
1413

1514
export function DirectDependenciesVersionList({
1615
dependencies,
17-
nodeType}: DirectDependenciesVersionListProps) {
16+
nodeType,
17+
}: DirectDependenciesVersionListProps) {
1818
// Map node_type to friendly display names
1919
const getNodeTypeDisplay = (type: string) => {
2020
const typeMap: Record<string, string> = {
@@ -23,7 +23,8 @@ export function DirectDependenciesVersionList({
2323
MavenPackage: 'Maven',
2424
RubyGemsPackage: 'RubyGems',
2525
CargoPackage: 'Cargo',
26-
NuGetPackage: 'NuGet'}
26+
NuGetPackage: 'NuGet',
27+
}
2728
return typeMap[type] || type
2829
}
2930

@@ -45,26 +46,18 @@ export function DirectDependenciesVersionList({
4546
{getNodeTypeDisplay(nodeType)}
4647
</Badge>
4748
</div>
48-
<p className="text-sm text-muted-foreground mt-1">
49-
Vendor: {dep.package_vendor}
50-
</p>
49+
<p className="text-sm text-muted-foreground mt-1">Vendor: {dep.package_vendor}</p>
5150
</div>
5251
<div className="flex items-center gap-2">
5352
<Badge variant="outline" className="font-mono text-xs">
5453
{dep.package_constraints}
5554
</Badge>
56-
<Badge variant="secondary">
57-
{dep.versions.length} versions
58-
</Badge>
55+
<Badge variant="secondary">{dep.versions.length} versions</Badge>
5956
</div>
6057
</div>
6158
</CardHeader>
6259
<CardContent className="pt-6">
63-
<VersionList
64-
versions={dep.versions}
65-
packageName={dep.package_name}
66-
67-
/>
60+
<VersionList versions={dep.versions} packageName={dep.package_name} />
6861
</CardContent>
6962
</Card>
7063
))}

components/feature/depex/ErrorDisplay.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface ErrorDisplayProps {
99
type: string
1010
data: any
1111
}
12-
1312
}
1413

1514
export function ErrorDisplay({ results }: ErrorDisplayProps) {
@@ -21,9 +20,9 @@ export function ErrorDisplay({ results }: ErrorDisplayProps) {
2120
<AlertTriangleIcon className="h-4 w-4" />
2221
<AlertDescription>
2322
<div className="space-y-2">
24-
<div>'Memory limit exceeded'</div>
23+
<div>Memory limit exceeded</div>
2524
<div className="text-sm text-muted-foreground">
26-
'Try reducing the depth or filtering dependencies'
25+
Try reducing the depth or filtering dependencies
2726
</div>
2827
</div>
2928
</AlertDescription>
@@ -37,7 +36,7 @@ export function ErrorDisplay({ results }: ErrorDisplayProps) {
3736
<AlertTriangleIcon className="h-4 w-4" />
3837
<AlertDescription>
3938
<div className="space-y-2">
40-
<div>'SMT operation timed out'</div>
39+
<div>SMT operation timed out</div>
4140
</div>
4241
</AlertDescription>
4342
</Alert>
@@ -63,9 +62,7 @@ export function ErrorDisplay({ results }: ErrorDisplayProps) {
6362
errorMessage = 'Network error'
6463
suggestion = 'Please check your connection and try again'
6564
} else {
66-
errorMessage =
67-
results.data?.message ||
68-
'Error'
65+
errorMessage = results.data?.message || 'Error'
6966
}
7067

7168
return (

0 commit comments

Comments
 (0)