diff --git a/src/app/page.tsx b/src/app/page.tsx index a38ef09..6612a71 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -272,6 +272,7 @@ export default function Home() {
+ {/* eslint-disable-next-line @next/next/no-img-element */} TuxMate Logo - {/* Links */}
@@ -19,25 +17,18 @@ export function track( } } -// Event names for the Umami dashboard - export const EVENTS = { - // Distro Selection DISTRO_SELECTED: 'Distro Selected', - // App Interactions APP_SELECTED: 'App Selected', APP_DESELECTED: 'App Deselected', - // Command Actions COMMAND_COPIED: 'Command Copied', SCRIPT_DOWNLOADED: 'Script Downloaded', - // Navigation GITHUB_CLICKED: 'GitHub Clicked', CONTRIBUTE_CLICKED: 'Contribute Clicked', - // UI Interactions HELP_OPENED: 'How It Works Opened', HELP_CLOSED: 'How It Works Closed', THEME_CHANGED: 'Theme Changed', @@ -45,8 +36,6 @@ export const EVENTS = { CATEGORY_COLLAPSED: 'Category Collapsed', } as const; -// Helper functions so we don't have to remember event names - export const analytics = { distroSelected: (distro: string) => { track(EVENTS.DISTRO_SELECTED, { distro }); diff --git a/src/lib/aur.ts b/src/lib/aur.ts index e8bf199..df6b166 100644 --- a/src/lib/aur.ts +++ b/src/lib/aur.ts @@ -1,16 +1,9 @@ -// AUR package detection for Arch users -// Identifies packages that come from the AUR vs official repos - import aurPackages from './aur-packages.json'; -// Suffixes that scream "I'm from the AUR" export const AUR_PATTERNS = ['-bin', '-git', '-appimage']; -// Known AUR packages without standard suffixes -// Extracted to JSON for cleaner code export const KNOWN_AUR_PACKAGES = new Set(aurPackages.packages); -// Check if a package name is an AUR package export function isAurPackage(packageName: string): boolean { if (KNOWN_AUR_PACKAGES.has(packageName)) { return true; diff --git a/src/lib/generateInstallScript.ts b/src/lib/generateInstallScript.ts index 316b13a..7b216ca 100644 --- a/src/lib/generateInstallScript.ts +++ b/src/lib/generateInstallScript.ts @@ -1,6 +1,3 @@ -// Main entry point for generating install scripts. -// Each distro has its own module - keeps things sane. - import { distros, type DistroId } from './data'; import { getSelectedPackages, @@ -15,14 +12,13 @@ import { generateHomebrewScript, } from './scripts'; -interface ScriptOptions { +interface GenerateOptions { distroId: DistroId; selectedAppIds: Set; helper?: 'yay' | 'paru'; } -// Full install script for download. Nix gets a config file, others get shell scripts. -export function generateInstallScript(options: ScriptOptions): string { +export function generateInstallScript(options: GenerateOptions): string { const { distroId, selectedAppIds, helper = 'yay' } = options; const distro = distros.find(d => d.id === distroId); @@ -45,8 +41,8 @@ export function generateInstallScript(options: ScriptOptions): string { } } -// Quick one-liner for copy-paste warriors -export function generateSimpleCommand(selectedAppIds: Set, distroId: DistroId): string { +export function generateCommandline(options: GenerateOptions): string { + const { selectedAppIds, distroId } = options; const packages = getSelectedPackages(selectedAppIds, distroId); if (packages.length === 0) return '# No packages selected'; diff --git a/src/lib/nixUnfree.ts b/src/lib/nixUnfree.ts index 0cd90df..21a2388 100644 --- a/src/lib/nixUnfree.ts +++ b/src/lib/nixUnfree.ts @@ -1,22 +1,17 @@ -// Nix unfree package detection - these require allowUnfree = true +import nixUnfreeList from './nix-unfree.json'; -import unfreeData from './nix-unfree.json'; -// Loaded from JSON source -export const KNOWN_UNFREE_PACKAGES = new Set(unfreeData.packages); + +const UNFREE_PACKAGES = new Set(nixUnfreeList.packages); export function isUnfreePackage(pkg: string): boolean { const cleanPkg = pkg.trim().toLowerCase(); - // Direct match - if (KNOWN_UNFREE_PACKAGES.has(cleanPkg)) return true; + if (UNFREE_PACKAGES.has(cleanPkg)) return true; - // Nested packages like jetbrains.idea-ultimate - // We iterate because the set is small (matches original logic) - for (const unfree of KNOWN_UNFREE_PACKAGES) { - if (cleanPkg.includes(unfree)) return true; + for (const unfreePkg of Array.from(UNFREE_PACKAGES)) { + if (cleanPkg.includes(unfreePkg)) return true; } return false; } - diff --git a/src/lib/scripts/index.ts b/src/lib/scripts/index.ts index 7c451be..6d1be9c 100644 --- a/src/lib/scripts/index.ts +++ b/src/lib/scripts/index.ts @@ -1,4 +1,4 @@ -// Re-exports all distro script generators + export { escapeShellString, getSelectedPackages, type PackageInfo } from './shared'; export { generateUbuntuScript } from './ubuntu';