Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
bbarclay committed Oct 6, 2024
1 parent b75462d commit 33b7b06
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 187 deletions.
10 changes: 0 additions & 10 deletions frontend/app.py

This file was deleted.

Empty file removed frontend/findme_deleteme.txt
Empty file.
8 changes: 0 additions & 8 deletions frontend/finished.txt

This file was deleted.

119 changes: 0 additions & 119 deletions frontend/outputviewtree.txt

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/runopendev copy.sh

This file was deleted.

11 changes: 0 additions & 11 deletions frontend/server.log

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/settings_grid_view.py

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/components/DashboardCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/Ucard';

const DashboardCard = ({ title, value }: { title: string; value: string }) => (
<Card className="shadow-md">
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/DashboardContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react';
import { Skeleton } from '@/components/ui/skeleton';
import { Skeleton } from '@/components/ui/Uskeleton';
import DashboardCard from '@/components/DashboardCard';

const DashboardContent = () => {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Topbar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { FiMenu, FiSearch, FiBell } from 'react-icons/fi';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/Ubutton';
import { Input } from '@/components/ui/Uinput';
import DarkModeToggle from '@/components/ui/DarkModeToggle';

const Topbar = ({ toggleSidebar }: { toggleSidebar: () => void }) => (
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ui/DarkModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import { useState, useEffect } from 'react';
import { useTheme } from 'next-themes';
import { Sun, Moon, LogOut, ChevronDown } from 'lucide-react';
import { Button } from '@/components/ui/button';
import { Button } from '@/components/ui/Ubutton';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
DropdownMenuLabel,
DropdownMenuSeparator,
} from '@/components/ui/dropdown-menu';
} from '@/components/ui/UdropdownUmenu';
import Image from 'next/image'; // Use Image for better optimization

export default function DarkModeToggle() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
88 changes: 88 additions & 0 deletions frontend/testclean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash

# Function to convert directory names to kebab-case
convert_dirs_to_kebab_case() {
find "$1" -depth -type d -not -path '*/\.*' | while read -r dir; do
base_dir=$(dirname "$dir")
dir_name=$(basename "$dir")
kebab_dir_name=$(echo "$dir_name" | tr '[:upper:]' '[:lower:]' | sed 's/[ _]/-/g' | tr -s '-')
if [ "$dir_name" != "$kebab_dir_name" ]; then
mv "$dir" "$base_dir/$kebab_dir_name"
echo "Renamed directory: $dir -> $base_dir/$kebab_dir_name"
fi
done
}

# Function to convert filenames in components to PascalCase
convert_files_to_pascal_case() {
find "$1" -type f -name '*.tsx' -not -path '*/\.*' | while read -r file; do
dir=$(dirname "$file")
filename=$(basename "$file")
filename_no_ext="${filename%.*}"
ext="${filename##*.}"

# Convert to PascalCase
pascal_case_filename=$(echo "$filename_no_ext" | sed -r 's/(^|_|-)([a-z])/\U\2/g')
pascal_case_filename="${pascal_case_filename}.${ext}"

if [ "$filename" != "$pascal_case_filename" ]; then
mv "$file" "$dir/$pascal_case_filename"
echo "Renamed file: $file -> $dir/$pascal_case_filename"
fi
done
}

# Function to delete unnecessary files
delete_unnecessary_files() {
echo "Deleting unnecessary files..."
files_to_delete=(
"findme_deleteme.txt"
"outputviewtree.txt"
"server.log"
"finished.txt"
"todos.txt"
"todos_checklist"
"runopendev copy.sh"
"*.py"
)
for pattern in "${files_to_delete[@]}"; do
find . -type f -name "$pattern" -not -path '*/\.*' -exec rm -v {} \;
done
}

# Function to find potentially duplicate files
find_duplicates() {
echo "Potentially duplicate files:"
find src -type f -printf "%f\n" | sort | uniq -d
}

echo "Starting clean up..."

# Delete unnecessary files in the project root
delete_unnecessary_files

# Convert directory names in src/app to kebab-case
convert_dirs_to_kebab_case "src/app"

# Convert component filenames in src/components to PascalCase
convert_files_to_pascal_case "src/components"

# Convert filenames in src/app excluding page.tsx and layout.tsx to kebab-case
find src/app -type f -name '*.tsx' -not -name 'page.tsx' -not -name 'layout.tsx' -not -path '*/\.*' | while read -r file; do
dir=$(dirname "$file")
filename=$(basename "$file")
filename_no_ext="${filename%.*}"
kebab_case_filename=$(echo "$filename_no_ext" | tr '[:upper:]' '[:lower:]' | sed 's/[ _]/-/g' | tr -s '-')
kebab_case_filename="${kebab_case_filename}.tsx"
if [ "$filename" != "$kebab_case_filename" ]; then
mv "$file" "$dir/$kebab_case_filename"
echo "Renamed file: $file -> $dir/$kebab_case_filename"
fi
done

# Remove duplicate files (manual review required)
echo
echo "Finding potentially duplicate files..."
find_duplicates

echo "Clean up completed."
1 change: 0 additions & 1 deletion frontend/todos.txt

This file was deleted.

0 comments on commit 33b7b06

Please sign in to comment.