Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ jobs:
steps:
- checkout
- run:
name: Install dependencies
name: Install pnpm and root dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
- run:
name: Install functions dependencies
command: |
cd functions
npm install
- run:
name: Run linting
command: |
Expand All @@ -47,9 +52,38 @@ jobs:
name: Quality GC check
command: npx quality-gc run || echo "Quality GC issues found"

deploy-worker:
docker:
- image: cimg/node:20.18
steps:
- checkout
- run:
name: Install pnpm and dependencies
command: |
sudo npm install -g pnpm
pnpm install --frozen-lockfile
- run:
name: Type check YouTube API v3 worker
command: pnpm exec tsc --noEmit
- run:
name: Deploy YouTube API v3 Worker to Cloudflare
command: |
if [ -n "${CLOUDFLARE_API_TOKEN}" ]; then
pnpm exec wrangler deploy src/youtube-worker.ts --name ytstudio
else
echo "CLOUDFLARE_API_TOKEN not configured — set it in CircleCI project env vars to enable deployment"
echo "Worker source validated via TypeScript type check"
fi

workflows:
version: 2
validate:
jobs:
- python-checks
- node-checks
- deploy-worker:
requires:
- node-checks
filters:
branches:
only: main
12 changes: 6 additions & 6 deletions fix_app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys
from pathlib import Path

filepath = 'js/app.js'
with open(filepath, 'r') as f:
filepath = Path("js/app.js")
with filepath.open() as f:
lines = f.readlines()

# Part 1: DOM elements
Expand All @@ -20,16 +20,16 @@
" DOM.episodesNavBtn.addEventListener('click', () => {\n",
" DOM.episodesSection.scrollIntoView({ behavior: 'smooth' });\n",
" if (document.body.classList.contains('mobile-nav-active')) {\n",
" document.body.classList.remove('mobile-nav-active');\n",
" document.body.classList.remove('mobile-nav-active');\n",
" if (DOM.menuToggle) DOM.menuToggle.setAttribute('aria-expanded', 'false');\n",
" }\n",
" });\n",
" }\n",
"\n"
"\n",
]
for idx, new_line in enumerate(scroll_listener):
lines.insert(i + idx, new_line)
break

with open(filepath, 'w') as f:
with filepath.open("w") as f:
f.writelines(lines)
10 changes: 6 additions & 4 deletions fix_index.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
with open('index.html', 'r') as f:
from pathlib import Path

with Path("index.html").open() as f:
content = f.read()

# Add title attribute to search button
old_search = '<button class=\"nav-link\" id=\"searchToggleBtn\" aria-controls=\"searchSection\" aria-expanded=\"false\">'
new_search = '<button class=\"nav-link\" id=\"searchToggleBtn\" aria-controls=\"searchSection\" aria-expanded=\"false\" title=\"Search (/)\">'
old_search = '<button class="nav-link" id="searchToggleBtn" aria-controls="searchSection" aria-expanded="false">'
new_search = '<button class="nav-link" id="searchToggleBtn" aria-controls="searchSection" aria-expanded="false" title="Search (/)">'
content = content.replace(old_search, new_search)

with open('index.html', 'w') as f:
with Path("index.html").open("w") as f:
f.write(content)
3 changes: 1 addition & 2 deletions functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "^13.9.0",
"firebase-admin": "^10.3.0",
"firebase-functions": "^7.0.0",
"lint": "^1.2.2"
},
Expand All @@ -27,7 +26,7 @@
"eslint-config-google": "^0.14.0",
"eslint-plugin-import": "^2.25.4",
"firebase-functions-test": "^3.4.1",
"typescript": "^6.0.0"
"typescript": "^5.6.0"
},
"private": true
}
Loading