From 6a4bad87bf004e32aec66341c471d67f59596f6a Mon Sep 17 00:00:00 2001 From: "circleci-app[bot]" <127350680+circleci-app[bot]@users.noreply.github.com> Date: Mon, 16 Nov 2026 01:30:52 +0000 Subject: [PATCH] feat: add YouTube API v3 worker build job and fix CI workflow failures - Add worker-build CI job: type-checks src/youtube-worker.ts, verifies wrangler.jsonc exists, deploys to Cloudflare if CLOUDFLARE_API_TOKEN set - Fix node-checks: add functions npm install step, replace npx tsc with local binary, remove broken quality-gc step - Regenerate pnpm-lock.yaml: sync @circleci/circleci-config-sdk ^0.12.5 (was causing pnpm install --frozen-lockfile failure in CI) - Fix functions/package.json: deduplicate firebase-admin, typescript 5.6, node engine 20, add test script - Fix functions/package-lock.json: regenerated to match corrected manifest - Reformat functions/.eslintrc.js from minified to readable - Apply pending fix scripts: episodes nav scroll, search button title, dependency version sync AI-Generated: true --- .circleci/config.yml | 37 +- .coverage | Bin 0 -> 53248 bytes fix_app.py | 17 +- fix_deps.py | 10 +- fix_index.py | 10 +- functions/.eslintrc.js | 34 +- functions/package-lock.json | 21808 +++++----------------------------- functions/package.json | 11 +- js/app.js | 13 + package.json | 5 +- pnpm-lock.yaml | 181 +- 11 files changed, 3348 insertions(+), 18778 deletions(-) create mode 100644 .coverage diff --git a/.circleci/config.yml b/.circleci/config.yml index bb176b74..a52d9180 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,6 +33,11 @@ jobs: 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: | @@ -42,10 +47,35 @@ jobs: name: TypeScript type check command: | cd functions - npx tsc --noEmit + ./node_modules/.bin/tsc --noEmit + + worker-build: + docker: + - image: cimg/node:20.18 + steps: + - checkout - run: - name: Quality GC check - command: npx quality-gc run || echo "Quality GC issues found" + name: Install dependencies + command: | + sudo npm install -g pnpm + pnpm install --frozen-lockfile + - run: + name: Type-check YouTube API v3 Worker + command: ./node_modules/.bin/tsc --noEmit --project tsconfig.json + - run: + name: Verify worker entry point + command: | + test -f src/youtube-worker.ts && echo "✓ YouTube API v3 worker found" + test -f wrangler.jsonc && echo "✓ Wrangler config found" + - run: + name: Deploy worker to Cloudflare + command: | + if [ -n "${CLOUDFLARE_API_TOKEN}" ]; then + echo "Deploying YouTube API v3 worker..." + ./node_modules/.bin/wrangler deploy src/youtube-worker.ts --name ytstudio + else + echo "CLOUDFLARE_API_TOKEN not set — skipping deploy (dry run only)" + fi workflows: version: 2 @@ -53,3 +83,4 @@ workflows: jobs: - python-checks - node-checks + - worker-build diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..31553dcae52161f430916865c14798cd7e8a67b5 GIT binary patch literal 53248 zcmeI*O>f&a7zc1EO6}N5pbSA^WI2R~<;APx!04fSIc(V$V8se#S+b$M%%Nr4R%=O) zBGw&iJOI(tKZnnU~Jb_+)JPrwe5FvO6WAaC0SG`~VgxSs=klfHW%I=kv21iz97;!p`gQ*EZ+3SM zcg5k(XODMKPb zNq*j|yG_a!t2PzU3tdl!=i<3KuOtc5tHtUp)(5B%<+goJAvV+OWf7{D3YG7uNY`T1 zZI+AWpMEUnON)!LHdh(WOG&|)f z8TG?#BDrgl%yJB7$!v_IXQ(+_`CMsdWn6R8boE-gGjoxj&X<;!%nLmtcwXY)dn1kD zBZDDuZ6SF5>i1;a5jX43hpFNl_j09=m&R3`t5C1;YwqR3R8r+%tVG|VNuPhMkt*|% zL6yH!=UXSTOS4H&x*-i&nuGNUAUI)DQexQ%`f(D!{5ALACQV=zQH%`e+~M<1_1~_00Izz00bZa z0SG_<0uX?}G;1_1~_00Izz00bZa0SG_<0uX?}BncF)l|uTr0Q~%a+CDPu zKkeV`pJ@jh1Rwwb2tWV=5P$##AOHafKmY=7Eb!j6W$bNt0#9u_Zs>HC<8JrD;F)sb z?Us91m%Sc+)xnx&8T)snYN}pD$;wlf@pMeGZs5pnoxWGVdCp1KP0KhKla#NUd}9rz z-+JGAIxg9@`~RtR>!5JQb+h~bZAOHafKmY;|fB*y_009U<00I*%fam`c+_`8P1Rwwb2tWV=5P$##AOHaf zKp+*s^M8Z_1Rwwb2tWV=5P$##AOHafKw$C(@ce)B`xq^R00bZa0SG_<0uX=z1Rwwb z2;liYVgLdVfB*y_009U<00Izz00bZ~`2u+UKly!(7D5055P$##AOHafKmY;|fB*#k E1LHK6ApigX literal 0 HcmV?d00001 diff --git a/fix_app.py b/fix_app.py index 247998d2..8dd1092c 100644 --- a/fix_app.py +++ b/fix_app.py @@ -1,13 +1,16 @@ -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 for i, line in enumerate(lines): if "themeMenu: document.getElementById('themeMenu')," in line: - lines.insert(i + 1, " episodesNavBtn: document.querySelector('[data-action=\"scroll-to-episodes\"]'),\n") + lines.insert( + i + 1, + " episodesNavBtn: document.querySelector('[data-action=\"scroll-to-episodes\"]'),\n", + ) lines.insert(i + 2, " episodesSection: document.getElementById('episodesSection'),\n") break @@ -20,16 +23,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) diff --git a/fix_deps.py b/fix_deps.py index 34cbd976..f59b27b2 100644 --- a/fix_deps.py +++ b/fix_deps.py @@ -15,12 +15,12 @@ # Maybe the CI is running against a different state of the PR? # Let's just make sure trigger-circleci-pipeline and circletui are in package.json if they are in the lockfile. -if 'dependencies' not in pkg: - pkg['dependencies'] = {} +if "dependencies" not in pkg: + pkg["dependencies"] = {} -pkg['dependencies']['trigger-circleci-pipeline'] = '^1.12.1' -pkg['dependencies']['circletui'] = '^1.0.3' -pkg['dependencies']['@circleci/circleci-config-sdk'] = '^0.12.5' +pkg["dependencies"]["trigger-circleci-pipeline"] = "^1.12.1" +pkg["dependencies"]["circletui"] = "^1.0.3" +pkg["dependencies"]["@circleci/circleci-config-sdk"] = "^0.12.5" with Path("package.json").open("w") as f: json.dump(pkg, f, indent=2) diff --git a/fix_index.py b/fix_index.py index 353b69c1..3476e3f2 100644 --- a/fix_index.py +++ b/fix_index.py @@ -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 = '