mirror of
https://github.com/System-End/My-website.git
synced 2026-04-19 19:45:10 +00:00
i need help!!!
This commit is contained in:
parent
bcd4fce285
commit
6355b1a226
36 changed files with 476 additions and 21625 deletions
18
.eslintrc.cjs
Normal file
18
.eslintrc.cjs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
module.exports = {
|
||||
root: true,
|
||||
env: { browser: true, es2020: true },
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:react-hooks/recommended',
|
||||
],
|
||||
ignorePatterns: ['dist', '.eslintrc.cjs'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['react-refresh'],
|
||||
rules: {
|
||||
'react-refresh/only-export-components': [
|
||||
'warn',
|
||||
{ allowConstantExport: true },
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
@ -1,76 +1,12 @@
|
|||
# deploy-master.ps1
|
||||
# deploy.ps1
|
||||
#Requires -Version 5.1
|
||||
Set-StrictMode -Version Latest
|
||||
|
||||
# Configure warning and error preferences
|
||||
$WarningPreference = 'Continue'
|
||||
$ErrorActionPreference = 'Continue'
|
||||
|
||||
# Configure output encoding
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
[Console]::InputEncoding = [System.Text.Encoding]::UTF8
|
||||
|
||||
# Script Configuration
|
||||
$CONFIG = @{
|
||||
ProjectName = "personal-site"
|
||||
RequiredFiles = @{
|
||||
Root = @(
|
||||
"package.json",
|
||||
"wrangler.toml",
|
||||
"spotify-worker.js",
|
||||
".env",
|
||||
".dev.vars",
|
||||
".prod.vars"
|
||||
)
|
||||
Src = @(
|
||||
"App.js",
|
||||
"App.css",
|
||||
"index.js",
|
||||
"App.test.js",
|
||||
"reportWebVitals.js",
|
||||
"setupTests.js"
|
||||
)
|
||||
Public = @(
|
||||
"index.html",
|
||||
"manifest.json",
|
||||
"robots.txt"
|
||||
)
|
||||
}
|
||||
RequiredDirs = @(
|
||||
"src",
|
||||
"public",
|
||||
"build",
|
||||
"logs"
|
||||
)
|
||||
RequiredEnvVars = @{
|
||||
".env" = @(
|
||||
"REACT_APP_SPOTIFY_CLIENT_ID",
|
||||
"REACT_APP_SPOTIFY_CLIENT_SECRET",
|
||||
"REACT_APP_SPOTIFY_REDIRECT_URI",
|
||||
"REACT_APP_WORKER_URL"
|
||||
)
|
||||
".prod.vars" = @(
|
||||
"SPOTIFY_CLIENT_ID",
|
||||
"SPOTIFY_CLIENT_SECRET",
|
||||
"SPOTIFY_REDIRECT_URI"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
# Helper Functions
|
||||
function Write-Header {
|
||||
param([string]$Title)
|
||||
$border = "=" * 80
|
||||
Write-Host "`n$border" -ForegroundColor Magenta
|
||||
Write-Host $Title -ForegroundColor Magenta
|
||||
Write-Host "$border" -ForegroundColor Magenta
|
||||
}
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Write-Status {
|
||||
param(
|
||||
[string]$Message,
|
||||
[string]$Type = "Info",
|
||||
[switch]$NoNewline
|
||||
[string]$Type = "Info"
|
||||
)
|
||||
|
||||
$colors = @{
|
||||
|
|
@ -82,351 +18,86 @@ function Write-Status {
|
|||
|
||||
$prefix = switch ($Type) {
|
||||
"Success" { "[+]" }
|
||||
"Error" { "[-]" }
|
||||
"Error" { "[-]" }
|
||||
"Warning" { "[!]" }
|
||||
"Info" { "[*]" }
|
||||
"Info" { "[*]" }
|
||||
}
|
||||
|
||||
if ($NoNewline) {
|
||||
Write-Host "$prefix $Message" -ForegroundColor $colors[$Type] -NoNewline
|
||||
}
|
||||
else {
|
||||
Write-Host "$prefix $Message" -ForegroundColor $colors[$Type]
|
||||
}
|
||||
}
|
||||
|
||||
function Test-NodeEnvironment {
|
||||
Write-Header "Checking Node.js Environment"
|
||||
$errors = @()
|
||||
|
||||
try {
|
||||
$nodeVersion = node --version 2>&1
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Status "Node.js version: $nodeVersion" "Success"
|
||||
}
|
||||
else {
|
||||
$errors += "Node.js not found"
|
||||
}
|
||||
|
||||
$npmVersion = npm --version 2>&1
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Status "npm version: $npmVersion" "Success"
|
||||
}
|
||||
else {
|
||||
$errors += "npm not found"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Status "Error checking Node.js environment: $_" "Warning"
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
function Test-Dependencies {
|
||||
Write-Header "Checking Dependencies"
|
||||
$errors = @()
|
||||
|
||||
try {
|
||||
# Clean existing installations
|
||||
if (Test-Path "node_modules") {
|
||||
Write-Status "Removing existing node_modules..." "Info"
|
||||
Remove-Item "node_modules" -Recurse -Force -ErrorAction Continue
|
||||
}
|
||||
|
||||
if (Test-Path "package-lock.json") {
|
||||
Write-Status "Removing package-lock.json..." "Info"
|
||||
Remove-Item "package-lock.json" -Force -ErrorAction Continue
|
||||
}
|
||||
|
||||
# Fresh install with warning handling
|
||||
Write-Status "Installing dependencies..." "Info"
|
||||
|
||||
$npmOutput = npm install --legacy-peer-deps --no-audit 2>&1
|
||||
$npmExitCode = $LASTEXITCODE
|
||||
|
||||
# Process npm output
|
||||
$npmOutput | ForEach-Object {
|
||||
if ($_ -match "ERR!") {
|
||||
Write-Status $_ "Error"
|
||||
$errors += $_
|
||||
}
|
||||
elseif ($_ -match "WARN") {
|
||||
Write-Status $_ "Warning"
|
||||
}
|
||||
else {
|
||||
Write-Status $_ "Info"
|
||||
}
|
||||
}
|
||||
|
||||
if ($npmExitCode -ne 0) {
|
||||
$errors += "npm install failed with exit code: $npmExitCode"
|
||||
}
|
||||
else {
|
||||
Write-Status "Dependencies installed successfully" "Success"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Status "Caught exception during dependency installation: $_" "Warning"
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
function Test-CloudflareSetup {
|
||||
Write-Header "Checking Cloudflare Setup"
|
||||
$errors = @()
|
||||
|
||||
try {
|
||||
$wranglerVersion = npx wrangler --version 2>&1
|
||||
Write-Status "Wrangler version: $wranglerVersion" "Success"
|
||||
|
||||
$whoami = npx wrangler whoami 2>&1
|
||||
if ($whoami -match "You are logged in") {
|
||||
Write-Status "Authenticated with Cloudflare" "Success"
|
||||
}
|
||||
else {
|
||||
Write-Status "Not authenticated with Cloudflare. Please log in..." "Warning"
|
||||
npx wrangler login
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
$errors += "Failed to authenticate with Cloudflare"
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Status "Error checking Cloudflare setup: $_" "Warning"
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
function Test-ProjectFiles {
|
||||
Write-Header "Checking Project Files"
|
||||
$errors = @()
|
||||
|
||||
foreach ($category in $CONFIG.RequiredFiles.Keys) {
|
||||
foreach ($file in $CONFIG.RequiredFiles[$category]) {
|
||||
$path = switch ($category) {
|
||||
"Root" { $file }
|
||||
"Src" { "src/$file" }
|
||||
"Public" { "public/$file" }
|
||||
}
|
||||
|
||||
if (-not (Test-Path $path)) {
|
||||
$errors += "Missing required file: $path"
|
||||
}
|
||||
else {
|
||||
Write-Status "Found $path" "Success"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($dir in $CONFIG.RequiredDirs) {
|
||||
if (-not (Test-Path $dir)) {
|
||||
Write-Status "Creating directory: $dir" "Info"
|
||||
New-Item -Path $dir -ItemType Directory -Force | Out-Null
|
||||
}
|
||||
Write-Status "Directory exists: $dir" "Success"
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
function Test-EnvVars {
|
||||
Write-Header "Checking Environment Variables"
|
||||
$errors = @()
|
||||
|
||||
foreach ($file in $CONFIG.RequiredEnvVars.Keys) {
|
||||
if (Test-Path $file) {
|
||||
$content = Get-Content $file -Raw
|
||||
foreach ($var in $CONFIG.RequiredEnvVars[$file]) {
|
||||
if (-not ($content -match $var)) {
|
||||
$errors += "Missing $var in $file"
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$errors += "Missing file: $file"
|
||||
}
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
function Build-Project {
|
||||
Write-Header "Building Project"
|
||||
$errors = @()
|
||||
|
||||
try {
|
||||
if (Test-Path "build") {
|
||||
Remove-Item "build" -Recurse -Force -ErrorAction Continue
|
||||
Write-Status "Cleaned previous build" "Success"
|
||||
}
|
||||
|
||||
Write-Status "Building project..." "Info"
|
||||
$buildOutput = npm run build 2>&1
|
||||
|
||||
# Process build output
|
||||
$buildOutput | ForEach-Object {
|
||||
if ($_ -match "ERR!") {
|
||||
Write-Status $_ "Error"
|
||||
$errors += $_
|
||||
}
|
||||
elseif ($_ -match "WARN") {
|
||||
Write-Status $_ "Warning"
|
||||
}
|
||||
else {
|
||||
Write-Status $_ "Info"
|
||||
}
|
||||
}
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
$errors += "Build failed with exit code: $LASTEXITCODE"
|
||||
}
|
||||
else {
|
||||
Write-Status "Build completed successfully" "Success"
|
||||
}
|
||||
}
|
||||
catch {
|
||||
Write-Status "Error during build: $_" "Warning"
|
||||
}
|
||||
|
||||
return $errors
|
||||
Write-Host "$prefix $Message" -ForegroundColor $colors[$Type]
|
||||
}
|
||||
|
||||
function Deploy-Project {
|
||||
Write-Header "Deploying Project"
|
||||
$errors = @()
|
||||
|
||||
try {
|
||||
# Deploy worker
|
||||
# Start logging
|
||||
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
if (-not (Test-Path "logs")) { New-Item -ItemType Directory -Path "logs" }
|
||||
$logFile = "logs/deploy_$timestamp.log"
|
||||
Start-Transcript -Path $logFile
|
||||
|
||||
# Check environment variables
|
||||
Write-Status "Checking environment variables..." "Info"
|
||||
$requiredVars = @(
|
||||
"SPOTIFY_CLIENT_ID",
|
||||
"SPOTIFY_CLIENT_SECRET",
|
||||
"SPOTIFY_REDIRECT_URI"
|
||||
)
|
||||
|
||||
$missingVars = @()
|
||||
foreach ($var in $requiredVars) {
|
||||
if (-not (Get-Item env:$var -ErrorAction SilentlyContinue)) {
|
||||
$missingVars += $var
|
||||
}
|
||||
}
|
||||
|
||||
if ($missingVars.Count -gt 0) {
|
||||
Write-Status "Missing environment variables: $($missingVars -join ', ')" "Error"
|
||||
throw "Missing required environment variables"
|
||||
}
|
||||
|
||||
# Clean and build
|
||||
Write-Status "Cleaning previous builds..." "Info"
|
||||
if (Test-Path "dist") { Remove-Item -Recurse -Force "dist" }
|
||||
|
||||
Write-Status "Installing dependencies..." "Info"
|
||||
npm install
|
||||
|
||||
Write-Status "Building project..." "Info"
|
||||
npm run build
|
||||
|
||||
if (-not (Test-Path "dist")) {
|
||||
throw "Build failed - dist directory not created"
|
||||
}
|
||||
|
||||
# Deploy Worker
|
||||
Write-Status "Deploying Cloudflare Worker..." "Info"
|
||||
$workerOutput = npx wrangler deploy spotify-worker.js --minify 2>&1
|
||||
|
||||
$workerOutput | ForEach-Object {
|
||||
if ($_ -match "ERR!") {
|
||||
Write-Status $_ "Error"
|
||||
$errors += $_
|
||||
}
|
||||
elseif ($_ -match "WARN") {
|
||||
Write-Status $_ "Warning"
|
||||
}
|
||||
else {
|
||||
Write-Status $_ "Info"
|
||||
}
|
||||
}
|
||||
|
||||
$workerDeploy = npx wrangler deploy spotify-worker.ts 2>&1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
$errors += "Worker deployment failed with exit code: $LASTEXITCODE"
|
||||
}
|
||||
else {
|
||||
Write-Status "Worker deployed successfully" "Success"
|
||||
Write-Status "Worker deployment failed: $workerDeploy" "Error"
|
||||
throw "Worker deployment failed"
|
||||
}
|
||||
Write-Status "Worker deployed successfully" "Success"
|
||||
|
||||
# Deploy pages
|
||||
# Deploy Pages
|
||||
Write-Status "Deploying to Cloudflare Pages..." "Info"
|
||||
$pagesOutput = npx wrangler pages deploy build/ 2>&1
|
||||
|
||||
$pagesOutput | ForEach-Object {
|
||||
if ($_ -match "ERR!") {
|
||||
Write-Status $_ "Error"
|
||||
$errors += $_
|
||||
}
|
||||
elseif ($_ -match "WARN") {
|
||||
Write-Status $_ "Warning"
|
||||
}
|
||||
else {
|
||||
Write-Status $_ "Info"
|
||||
}
|
||||
}
|
||||
|
||||
$pagesDeploy = npx wrangler pages deploy dist/ 2>&1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
$errors += "Pages deployment failed with exit code: $LASTEXITCODE"
|
||||
}
|
||||
else {
|
||||
Write-Status "Pages deployed successfully" "Success"
|
||||
Write-Status "Pages deployment failed: $pagesDeploy" "Error"
|
||||
throw "Pages deployment failed"
|
||||
}
|
||||
Write-Status "Pages deployed successfully" "Success"
|
||||
|
||||
Write-Status "Deployment completed successfully!" "Success"
|
||||
Write-Status "Log file: $logFile" "Info"
|
||||
}
|
||||
catch {
|
||||
Write-Status "Error during deployment: $_" "Warning"
|
||||
Write-Status "Deployment failed: $_" "Error"
|
||||
Write-Status "Check the log file for details: $logFile" "Info"
|
||||
exit 1
|
||||
}
|
||||
|
||||
return $errors
|
||||
}
|
||||
|
||||
# Main execution
|
||||
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
$logFile = "logs/deploy_$timestamp.log"
|
||||
|
||||
if (-not (Test-Path "logs")) {
|
||||
New-Item -ItemType Directory -Path "logs" | Out-Null
|
||||
}
|
||||
|
||||
Start-Transcript -Path $logFile
|
||||
|
||||
try {
|
||||
Write-Header "Starting Deployment Process"
|
||||
$allErrors = @()
|
||||
$continueDeployment = $true
|
||||
|
||||
$allErrors += Test-NodeEnvironment
|
||||
$allErrors += Test-Dependencies
|
||||
$allErrors += Test-CloudflareSetup
|
||||
$allErrors += Test-ProjectFiles
|
||||
$allErrors += Test-EnvVars
|
||||
|
||||
if ($allErrors.Count -gt 0) {
|
||||
Write-Header "Validation Warnings/Errors"
|
||||
foreach ($error in $allErrors) {
|
||||
Write-Status $error "Warning"
|
||||
}
|
||||
Write-Status "Found $($allErrors.Count) issues during validation" "Warning"
|
||||
$userResponse = Read-Host "Do you want to continue with deployment? (y/n)"
|
||||
$continueDeployment = $userResponse -eq 'y'
|
||||
finally {
|
||||
Stop-Transcript
|
||||
}
|
||||
|
||||
if ($continueDeployment) {
|
||||
$buildErrors = Build-Project
|
||||
if ($buildErrors) {
|
||||
Write-Status "Build completed with warnings:" "Warning"
|
||||
foreach ($error in $buildErrors) {
|
||||
Write-Status $error "Warning"
|
||||
}
|
||||
$userResponse = Read-Host "Do you want to continue with deployment? (y/n)"
|
||||
$continueDeployment = $userResponse -eq 'y'
|
||||
}
|
||||
|
||||
if ($continueDeployment) {
|
||||
$deployErrors = Deploy-Project
|
||||
if ($deployErrors) {
|
||||
Write-Status "Deployment completed with warnings:" "Warning"
|
||||
foreach ($error in $deployErrors) {
|
||||
Write-Status $error "Warning"
|
||||
}
|
||||
}
|
||||
else {
|
||||
Write-Header "Deployment Successful"
|
||||
Write-Status "All components deployed successfully!" "Success"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Status "Log file: $logFile" "Info"
|
||||
}
|
||||
catch {
|
||||
Write-Header "Deployment Error"
|
||||
Write-Status $_.Exception.Message "Error"
|
||||
Write-Status "Check the log file for details: $logFile" "Info"
|
||||
|
||||
Write-Header "Troubleshooting Steps"
|
||||
Write-Status "1. Check the log file: $logFile" "Info"
|
||||
Write-Status "2. Verify Node.js and npm installations" "Info"
|
||||
Write-Status "3. Check Cloudflare authentication: npx wrangler login" "Info"
|
||||
Write-Status "4. Verify all required files exist" "Info"
|
||||
Write-Status "5. Check build output" "Info"
|
||||
|
||||
exit 1
|
||||
}
|
||||
finally {
|
||||
Stop-Transcript
|
||||
}
|
||||
|
||||
# Execute deployment
|
||||
Deploy-Project
|
||||
91
dev.ps1
Normal file
91
dev.ps1
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# dev.ps1
|
||||
#Requires -Version 5.1
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Write-Status {
|
||||
param(
|
||||
[string]$Message,
|
||||
[string]$Type = "Info"
|
||||
)
|
||||
|
||||
$colors = @{
|
||||
Info = "Cyan"
|
||||
Success = "Green"
|
||||
Warning = "Yellow"
|
||||
Error = "Red"
|
||||
}
|
||||
|
||||
$prefix = switch ($Type) {
|
||||
"Success" { "[+]" }
|
||||
"Error" { "[-]" }
|
||||
"Warning" { "[!]" }
|
||||
"Info" { "[*]" }
|
||||
}
|
||||
|
||||
Write-Host "$prefix $Message" -ForegroundColor $colors[$Type]
|
||||
}
|
||||
|
||||
function Start-Development {
|
||||
try {
|
||||
# Create logs directory if it doesn't exist
|
||||
if (-not (Test-Path "logs")) {
|
||||
New-Item -ItemType Directory -Path "logs"
|
||||
}
|
||||
|
||||
# Start log file
|
||||
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
|
||||
$logFile = "logs/dev_$timestamp.log"
|
||||
Start-Transcript -Path $logFile
|
||||
|
||||
# Check for running processes on ports 3000 and 8787
|
||||
$port3000 = Get-NetTCPConnection -LocalPort 3000 -ErrorAction SilentlyContinue
|
||||
$port8787 = Get-NetTCPConnection -LocalPort 8787 -ErrorAction SilentlyContinue
|
||||
|
||||
if ($port3000) {
|
||||
Write-Status "Killing process using port 3000..." "Warning"
|
||||
Stop-Process -Id (Get-Process -Id $port3000.OwningProcess).Id -Force
|
||||
}
|
||||
|
||||
if ($port8787) {
|
||||
Write-Status "Killing process using port 8787..." "Warning"
|
||||
Stop-Process -Id (Get-Process -Id $port8787.OwningProcess).Id -Force
|
||||
}
|
||||
|
||||
# Start Vite and Wrangler in separate windows
|
||||
Write-Status "Starting development servers..." "Info"
|
||||
|
||||
# Start Vite
|
||||
$viteWindow = Start-Process powershell -ArgumentList "-NoExit", "-Command", "npm run dev" -PassThru
|
||||
|
||||
# Start Wrangler
|
||||
$wranglerWindow = Start-Process powershell -ArgumentList "-NoExit", "-Command", "npx wrangler dev spotify-worker.ts" -PassThru
|
||||
|
||||
Write-Status "Development servers started successfully!" "Success"
|
||||
Write-Status "Vite running on: http://localhost:3000" "Info"
|
||||
Write-Status "Worker running on: http://localhost:8787" "Info"
|
||||
Write-Status "Log file: $logFile" "Info"
|
||||
|
||||
# Wait for user input to stop servers
|
||||
Write-Host "`nPress any key to stop the development servers..." -ForegroundColor Yellow
|
||||
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
|
||||
# Stop the servers
|
||||
if ($viteWindow) { Stop-Process -Id $viteWindow.Id -Force }
|
||||
if ($wranglerWindow) { Stop-Process -Id $wranglerWindow.Id -Force }
|
||||
|
||||
Write-Status "Development servers stopped" "Success"
|
||||
}
|
||||
catch {
|
||||
Write-Status "Error during development: $_" "Error"
|
||||
if ($viteWindow) { Stop-Process -Id $viteWindow.Id -Force }
|
||||
if ($wranglerWindow) { Stop-Process -Id $wranglerWindow.Id -Force }
|
||||
exit 1
|
||||
}
|
||||
finally {
|
||||
Stop-Transcript
|
||||
}
|
||||
}
|
||||
|
||||
# Run the development environment
|
||||
Start-Development
|
||||
13
index.html
Normal file
13
index.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>EndofTimee</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
**********************
|
||||
Windows PowerShell transcript start
|
||||
Start time: 20250201055616
|
||||
Username: ENDOFTIMEE\mason
|
||||
RunAs User: ENDOFTIMEE\mason
|
||||
Configuration Name:
|
||||
Machine: ENDOFTIMEE (Microsoft Windows NT 10.0.26100.0)
|
||||
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\mason\.vscode\extensions\ms-vscode.powershell-2025.0.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2025.0.0' -BundledModulesPath 'c:\Users\mason\.vscode\extensions\ms-vscode.powershell-2025.0.0\modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2025.0.0
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
https://aka.ms/vscode-powershell
|
||||
Type 'help' to get help.
|
||||
" -LogLevel 'Warning' -LogPath 'c:\Users\mason\AppData\Roaming\Code\logs\20250131T175040\window1\exthost\ms-vscode.powershell' -SessionDetailsPath 'c:\Users\mason\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-17324-675064.json' -FeatureFlags @()
|
||||
Process ID: 29200
|
||||
PSVersion: 5.1.26100.2161
|
||||
PSEdition: Desktop
|
||||
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.26100.2161
|
||||
BuildVersion: 10.0.26100.2161
|
||||
CLRVersion: 4.0.30319.42000
|
||||
WSManStackVersion: 3.0
|
||||
PSRemotingProtocolVersion: 2.3
|
||||
SerializationVersion: 1.1.0.1
|
||||
**********************
|
||||
Transcript started, output file is logs/deploy_20250201_055616.log
|
||||
|
||||
================================================================================
|
||||
Starting Deployment Process
|
||||
================================================================================
|
||||
|
||||
================================================================================
|
||||
Checking Node.js Environment
|
||||
================================================================================
|
||||
[+] Node.js version: v22.12.0
|
||||
[+] npm version: 10.9.0
|
||||
|
||||
================================================================================
|
||||
Checking Dependencies
|
||||
================================================================================
|
||||
[*] Removing existing node_modules...
|
||||
[*] Removing package-lock.json...
|
||||
[*] Installing dependencies...
|
||||
node.exe : npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out
|
||||
lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive
|
||||
and powerful.
|
||||
At C:\Program Files\nodejs\npm.ps1:29 char:3
|
||||
+ & $NODE_EXE $NPM_CLI_JS $args
|
||||
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
+ CategoryInfo : NotSpecified: (npm warn deprec...e and powerful.:String) [], RemoteException
|
||||
+ FullyQualifiedErrorId : NativeCommandError
|
||||
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript
|
||||
standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
|
||||
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript
|
||||
standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
|
||||
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the
|
||||
ECMAScript standard and thus this plugin is no longer maintained. Please use
|
||||
@babel/plugin-transform-nullish-coalescing-operator instead.
|
||||
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript
|
||||
standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
|
||||
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
|
||||
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is
|
||||
deprecated. See the compatibility table on MDN:
|
||||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
|
||||
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript
|
||||
standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
|
||||
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
|
||||
npm warn deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please
|
||||
use @rollup/plugin-inject.
|
||||
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
|
||||
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please
|
||||
use @rollup/plugin-terser
|
||||
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
|
||||
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave
|
||||
JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript
|
||||
promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
|
||||
npm warn deprecated
|
||||
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
|
||||
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
|
||||
npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead
|
||||
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
|
||||
npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
|
||||
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
|
||||
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as
|
||||
long as you are using GAv3 it should be ok, but the package is not longer being maintained
|
||||
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
|
||||
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support
|
||||
for other options.
|
||||
[!] npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
|
||||
[!] npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
|
||||
[!] npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
|
||||
[!] npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
|
||||
[!] npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
|
||||
[!] npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
|
||||
[!] npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
|
||||
[!] npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
|
||||
[!] npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
|
||||
[!] npm warn deprecated rollup-plugin-inject@3.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
|
||||
[!] npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
|
||||
[!] npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
|
||||
[!] npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
|
||||
[!] npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
|
||||
[!] npm warn deprecated
|
||||
[!] npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
|
||||
[!] npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
|
||||
[!] npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead
|
||||
[!] npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
|
||||
[!] npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
|
||||
[!] npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
|
||||
[!] npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
|
||||
[!] npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
|
||||
[!] npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
|
||||
[*]
|
||||
[*] added 1555 packages in 2m
|
||||
[*]
|
||||
[*] 274 packages are looking for funding
|
||||
[*] run `npm fund` for details
|
||||
[+] Dependencies installed successfully
|
||||
|
||||
================================================================================
|
||||
Checking Cloudflare Setup
|
||||
================================================================================
|
||||
[+] Wrangler version: 3.107.2
|
||||
[+] Authenticated with Cloudflare
|
||||
|
||||
================================================================================
|
||||
Checking Project Files
|
||||
================================================================================
|
||||
[+] Found package.json
|
||||
[+] Found wrangler.toml
|
||||
[+] Found spotify-worker.js
|
||||
[+] Found .env
|
||||
[+] Found .dev.vars
|
||||
[+] Found .prod.vars
|
||||
[+] Found public/index.html
|
||||
[+] Found public/manifest.json
|
||||
[+] Found public/robots.txt
|
||||
[+] Found src/App.js
|
||||
[+] Found src/App.css
|
||||
[+] Found src/index.js
|
||||
[+] Found src/App.test.js
|
||||
[+] Found src/reportWebVitals.js
|
||||
[+] Found src/setupTests.js
|
||||
[+] Directory exists: src
|
||||
[+] Directory exists: public
|
||||
[+] Directory exists: build
|
||||
[+] Directory exists: logs
|
||||
|
||||
================================================================================
|
||||
Checking Environment Variables
|
||||
================================================================================
|
||||
|
||||
================================================================================
|
||||
Building Project
|
||||
================================================================================
|
||||
[+] Cleaned previous build
|
||||
[*] Building project...
|
||||
[*]
|
||||
[*] > personal-site@0.1.0 build
|
||||
[*] > react-scripts build
|
||||
[*]
|
||||
[*] Creating an optimized production build...
|
||||
[*] Failed to compile.
|
||||
[*]
|
||||
[*] Unexpected token '', "{
|
||||
[*] "nam"... is not valid JSON
|
||||
[*] while determining default 'output.uniqueName' from 'name' in C:\Users\mason\OneDrive - masoncucci.com\Desktop\Github\personal-site\package.json
|
||||
[*]
|
||||
[*]
|
||||
[!] Build completed with warnings:
|
||||
[!] Build failed with exit code: 1
|
||||
20929
package-lock.json
generated
20929
package-lock.json
generated
File diff suppressed because it is too large
Load diff
143
package.json
143
package.json
|
|
@ -1,52 +1,93 @@
|
|||
{
|
||||
"name": "personal-site",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"ajv-keywords": "^5.1.0",
|
||||
"itty-router": "^4.0.27",
|
||||
"lru-cache": "^10.1.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"terser-webpack-plugin": "^5.3.6",
|
||||
"web-vitals": "^2.1.4",
|
||||
"wrangler": "^3.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240208.0",
|
||||
"@testing-library/jest-dom": "^5.17.0",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/node": "^16.18.70",
|
||||
"@types/react": "^18.2.48",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"ajv": "8.17.1",
|
||||
"typescript": "^4.9.5",
|
||||
"wrangler": "^3.28.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"deploy": "powershell ./deploy-master.ps1",
|
||||
"clean": "rm -rf node_modules package-lock.json build dist .cache"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
"react-app"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all",
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
"name": "personal-site",
|
||||
"private": true,
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "powershell ./dev.ps1",
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"preview": "vite preview",
|
||||
"deploy": "powershell ./deploy.ps1",
|
||||
"setup": "powershell ./first-time-setup.ps1",
|
||||
"clean": "rimraf node_modules dist .wrangler .cloudflare",
|
||||
"type-check": "tsc --noEmit",
|
||||
"format": "prettier --write \"src/**/*.{ts,tsx,css}\"",
|
||||
"test": "vitest",
|
||||
"test:ui": "vitest --ui",
|
||||
"prepare": "husky install"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-slot": "^1.0.2",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.1.0",
|
||||
"itty-router": "^4.0.27",
|
||||
"lucide-react": "^0.330.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-router-dom": "^6.22.0",
|
||||
"tailwind-merge": "^2.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240208.0",
|
||||
"@commitlint/cli": "^18.6.0",
|
||||
"@commitlint/config-conventional": "^18.6.0",
|
||||
"@testing-library/jest-dom": "^6.4.2",
|
||||
"@testing-library/react": "^14.2.1",
|
||||
"@testing-library/user-event": "^14.5.2",
|
||||
"@types/node": "^20.11.17",
|
||||
"@types/react": "^18.2.55",
|
||||
"@types/react-dom": "^18.2.19",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@vitejs/plugin-react-swc": "^3.5.0",
|
||||
"@vitest/ui": "^1.2.2",
|
||||
"autoprefixer": "^10.4.17",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-react-hooks": "^4.6.0",
|
||||
"eslint-plugin-react-refresh": "^0.4.5",
|
||||
"husky": "^9.0.10",
|
||||
"jsdom": "^24.0.0",
|
||||
"lint-staged": "^15.2.2",
|
||||
"postcss": "^8.4.35",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-tailwindcss": "^0.5.11",
|
||||
"rimraf": "^5.0.5",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.1.0",
|
||||
"vitest": "^1.2.2",
|
||||
"wrangler": "^3.28.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{html,css,json,md}": [
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-conventional"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
export default {
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>EndofTimee</title>
|
||||
<link rel="stylesheet" href="pages/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<img src="/logo.png" alt="Logo" style="width: 100px; height: auto;">
|
||||
<div id="root"></div>
|
||||
<script src="/scripts/theme-toggle.js"></script>
|
||||
<script src="/scripts/spotify.js"></script>
|
||||
<script src="/scripts/github-repos.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
69
spotify-worker.ts
Normal file
69
spotify-worker.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import { Router } from 'itty-router'
|
||||
|
||||
const router = Router()
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
||||
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
||||
}
|
||||
|
||||
const jsonResponse = (data: any, status = 200) => {
|
||||
return new Response(JSON.stringify(data), {
|
||||
status,
|
||||
headers: {
|
||||
...corsHeaders,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const errorResponse = (message: string, status = 500) => {
|
||||
return jsonResponse({ error: message }, status)
|
||||
}
|
||||
|
||||
async function refreshAccessToken(env: any) {
|
||||
const authResponse = await fetch('https://accounts.spotify.com/api/token', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Authorization': 'Basic ' + btoa(`${env.SPOTIFY_CLIENT_ID}:${env.SPOTIFY_CLIENT_SECRET}`)
|
||||
},
|
||||
body: 'grant_type=client_credentials'
|
||||
})
|
||||
|
||||
const data = await authResponse.json()
|
||||
return data.access_token
|
||||
}
|
||||
|
||||
router.options('*', () => new Response(null, { headers: corsHeaders }))
|
||||
|
||||
router.get('/health', () => {
|
||||
return jsonResponse({
|
||||
status: 'healthy',
|
||||
timestamp: new Date().toISOString(),
|
||||
})
|
||||
})
|
||||
|
||||
router.get('/top-tracks', async (request: any, env: any) => {
|
||||
try {
|
||||
const accessToken = await refreshAccessToken(env)
|
||||
|
||||
const spotifyResponse = await fetch('https://api.spotify.com/v1/me/top/tracks?limit=10', {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${accessToken}`
|
||||
}
|
||||
})
|
||||
|
||||
const spotifyData = await spotifyResponse.json()
|
||||
return jsonResponse(spotifyData)
|
||||
} catch (error: any) {
|
||||
return errorResponse('Failed to fetch Spotify data: ' + error.message)
|
||||
}
|
||||
})
|
||||
|
||||
router.all('*', () => errorResponse('Not Found', 404))
|
||||
|
||||
export default {
|
||||
fetch: (request: Request, env: any, ctx: any) => router.handle(request, env, ctx)
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import { render, screen } from '@testing-library/react';
|
||||
import App from './App';
|
||||
|
||||
test('renders learn react link', () => {
|
||||
render(<App />);
|
||||
const linkElement = screen.getByText(/learn react/i);
|
||||
expect(linkElement).toBeInTheDocument();
|
||||
});
|
||||
14
src/App.tsx
14
src/App.tsx
|
|
@ -1,11 +1,11 @@
|
|||
import React from 'react';
|
||||
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
|
||||
import Navbar from './components/Navbar';
|
||||
import AboutPage from './pages/AboutPage';
|
||||
import APCSPPage from './pages/APCSPPage';
|
||||
import ProjectsPage from './pages/ProjectsPage';
|
||||
import ErrorBoundary from './components/ErrorBoundary';
|
||||
import './App.css';
|
||||
import Navbar from '@/components/Navbar';
|
||||
import AboutPage from '@/pages/AboutPage';
|
||||
import APCSPPage from '@/pages/APCSPPage';
|
||||
import ProjectsPage from '@/pages/ProjectsPage';
|
||||
import ErrorBoundary from '@/components/ErrorBoundary';
|
||||
import '@/styles/.css';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
|
|
@ -32,4 +32,4 @@ const App = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
export default App;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
|
||||
class ErrorBoundary extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -44,3 +44,4 @@ class ErrorBoundary extends React.Component {
|
|||
}
|
||||
|
||||
export default ErrorBoundary;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
import '../styles/FoxCard.css';
|
||||
|
||||
const FoxCard = ({ children, className = '' }) => {
|
||||
|
|
@ -12,3 +12,4 @@ const FoxCard = ({ children, className = '' }) => {
|
|||
};
|
||||
|
||||
export default FoxCard;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import './GithubRepos.css';
|
||||
import '@/styles/.css';
|
||||
|
||||
const GithubRepos = () => {
|
||||
const [repos, setRepos] = useState([]);
|
||||
|
|
@ -42,3 +42,4 @@ const GithubRepos = () => {
|
|||
};
|
||||
|
||||
export default GithubRepos;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import './LoadingAnimation.css';
|
||||
import '@/styles/.css';
|
||||
|
||||
const generateRandomCode = () => {
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}|;:,.<>?';
|
||||
|
|
@ -31,4 +31,4 @@ const LoadingAnimation = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default LoadingAnimation;
|
||||
export default LoadingAnimation;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
import '../styles/LoadingFox.css';
|
||||
|
||||
const LoadingFox = () => {
|
||||
|
|
@ -23,3 +23,4 @@ const LoadingFox = () => {
|
|||
};
|
||||
|
||||
export default LoadingFox;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,4 +56,4 @@ const Navbar = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default Navbar;
|
||||
export default Navbar;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
import React from 'react';
|
||||
import './parallax.css';
|
||||
import '@/styles/.css';
|
||||
|
||||
const ParallaxEffect = () => {
|
||||
return (
|
||||
|
|
@ -18,3 +18,4 @@ const ParallaxEffect = () => {
|
|||
};
|
||||
|
||||
export default ParallaxEffect;
|
||||
|
||||
|
|
|
|||
|
|
@ -78,4 +78,4 @@ function SpotifyList() {
|
|||
);
|
||||
}
|
||||
|
||||
export default SpotifyList;
|
||||
export default SpotifyList;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useEffect, useRef } from 'react';
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import '../styles/SpotifyVisualizer.css';
|
||||
|
||||
const SpotifyVisualizer = ({ isPlaying }) => {
|
||||
|
|
@ -57,3 +57,4 @@ const SpotifyVisualizer = ({ isPlaying }) => {
|
|||
};
|
||||
|
||||
export default SpotifyVisualizer;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,4 +17,4 @@ function ThemeToggle() {
|
|||
return null;
|
||||
}
|
||||
|
||||
export default ThemeToggle;
|
||||
export default ThemeToggle;
|
||||
|
|
|
|||
12
src/env.d.ts
vendored
Normal file
12
src/env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_SPOTIFY_CLIENT_ID: string
|
||||
readonly VITE_SPOTIFY_CLIENT_SECRET: string
|
||||
readonly VITE_SPOTIFY_REDIRECT_URI: string
|
||||
readonly VITE_WORKER_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
const useGithubRepos = () => {
|
||||
const [repos, setRepos] = useState([]);
|
||||
|
|
@ -50,3 +50,4 @@ const useGithubRepos = () => {
|
|||
};
|
||||
|
||||
export default useGithubRepos;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useEffect } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
const useSpotifyData = () => {
|
||||
const [data, setData] = useState(null);
|
||||
|
|
@ -27,3 +27,4 @@ const useSpotifyData = () => {
|
|||
};
|
||||
|
||||
export default useSpotifyData;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom/client';
|
||||
import './styles/index.css';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom/client'
|
||||
import App from '@/App'
|
||||
import '@/styles/index.css'
|
||||
|
||||
const root = ReactDOM.createRoot(document.getElementById('root'));
|
||||
root.render(
|
||||
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>
|
||||
);
|
||||
|
||||
reportWebVitals();
|
||||
</React.StrictMode>,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
import FoxCard from '../components/FoxCard';
|
||||
import { Code, BookOpen, Cpu } from 'lucide-react';
|
||||
|
||||
|
|
@ -40,3 +40,4 @@ const APCSPPage = () => {
|
|||
};
|
||||
|
||||
export default APCSPPage;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
import FoxCard from '../components/FoxCard';
|
||||
import { Heart, Gamepad2, Code, Music } from 'lucide-react';
|
||||
import { SpotifyVisualizer } from '../components/SpotifyVisualizer';
|
||||
|
|
@ -19,7 +19,7 @@ const AboutPage = () => {
|
|||
<div className="page-container">
|
||||
<FoxCard className="header-card">
|
||||
<h1 className="text-glow">About Me</h1>
|
||||
<p className="text-gradient">Transfem Foxgirl • {calculateAge()} years old • Programmer & Streamer</p>
|
||||
<p className="text-gradient">Transfem Foxgirl • {calculateAge()} years old • Programmer & Streamer</p>
|
||||
</FoxCard>
|
||||
|
||||
<div className="content-grid">
|
||||
|
|
@ -56,3 +56,4 @@ const AboutPage = () => {
|
|||
};
|
||||
|
||||
export default AboutPage;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React from 'react';
|
||||
import FoxCard from '../components/FoxCard';
|
||||
import GithubRepos from '../components/GithubRepos';
|
||||
import useGithubRepos from '../hooks/useGithubRepos';
|
||||
|
|
@ -31,3 +31,4 @@ const ProjectsPage = () => {
|
|||
};
|
||||
|
||||
export default ProjectsPage;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,3 +11,4 @@ const reportWebVitals = onPerfEntry => {
|
|||
};
|
||||
|
||||
export default reportWebVitals;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
||||
// allows you to do things like:
|
||||
// expect(element).toHaveTextContent(/react/i)
|
||||
// learn more: https://github.com/testing-library/jest-dom
|
||||
import '@testing-library/jest-dom';
|
||||
ks
|
||||
32
src/types/index.ts
Normal file
32
src/types/index.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// src/types/index.ts
|
||||
|
||||
export interface GithubRepo {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string | null;
|
||||
html_url: string;
|
||||
language: string | null;
|
||||
languages: string[];
|
||||
}
|
||||
|
||||
export interface SpotifyTrack {
|
||||
id: string;
|
||||
name: string;
|
||||
artists: Array<{
|
||||
name: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface ErrorBoundaryState {
|
||||
hasError: boolean;
|
||||
error: Error | null;
|
||||
}
|
||||
|
||||
export interface ErrorBoundaryProps {
|
||||
children: React.ReactNode;
|
||||
}
|
||||
|
||||
export interface FoxCardProps {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
|
|
|
|||
32
vite.config.ts
Normal file
32
vite.config.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react-swc'
|
||||
import path from 'path'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8787',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'react-vendor': ['react', 'react-dom', 'react-router-dom'],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,30 +1,22 @@
|
|||
|
||||
name = "personal-site"
|
||||
main = "spotify-worker.js"
|
||||
compatibility_date = "2024-01-30"
|
||||
compatibility_date = "2024-02-01"
|
||||
|
||||
[build]
|
||||
command = "npm run build"
|
||||
cwd = "."
|
||||
watch_dir = "src"
|
||||
|
||||
[site]
|
||||
bucket = "./build"
|
||||
pages_build_output_dir = "./build"
|
||||
bucket = "./dist"
|
||||
|
||||
[env.production]
|
||||
name = "personal-site"
|
||||
vars = { ENVIRONMENT = "production" }
|
||||
routes = ["personal-site.pages.dev/*"]
|
||||
vars = { ENVIRONMENT = "production" }
|
||||
|
||||
[env.development]
|
||||
name = "personal-site-dev"
|
||||
vars = { ENVIRONMENT = "development" }
|
||||
|
||||
[[rules]]
|
||||
type = "CompiledWasm"
|
||||
globs = ["**/*.wasm"]
|
||||
|
||||
[[rules]]
|
||||
type = "Text"
|
||||
globs = ["**/*.html", "**/*.css", "**/*.js", "**/*.json"]
|
||||
[vars]
|
||||
ENVIRONMENT = "development"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue