Commit graph

425 commits

Author SHA1 Message Date
ThatGuySam
6cfbfbf530 Keep prod health checks and route fallbacks from failing on stale API entries
Add a Bun health script that exercises top-level, dynamic, and representative video routes against one or more hosts so prod regressions are visible from a single command.

Device pages now fall back to the bundled device list when the external API misses a slug, and orphaned tv slugs redirect to /benchmarks instead of returning a 500. Video fallback logic reuses the existing YouTube-to-listing builder so route reconstruction stays aligned with the current build logic.

Constraint: The external API host can lag behind the frontend build and omit per-slug JSON files that public routes still expect
Rejected: Import the generated video list directly | static/video-list.json is too large for a safe SSR fallback
Rejected: Leave missing tv routes as 500s | a stale public URL should degrade to a useful redirect instead of breaking the request
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep route fallbacks tied to build-time artifacts from the same repo so frontend and fallback data stay in sync
Tested: bun scripts/health http://127.0.0.1:4322; vitest ./test/prebuild/config-node.test.js ./test/prebuild/site-listings.test.js; pnpm run netlify-build
Not-tested: live production deploy before push
2026-04-06 10:51:49 -05:00
ThatGuySam
820e495d2d Keep redirect lookups from crashing SSR pages
Dynamic Astro routes were reading Netlify redirect config through a cwd-relative path, which is fragile inside a serverless runtime and was taking detail pages down with 500s before render.

Resolve netlify.toml by searching from the module directory and current working directory, and fail open in request-time redirect lookup so a config read problem does not block page rendering.

Constraint: Netlify serverless cwd is not guaranteed to be the repo root
Rejected: Inline redirects into route modules | would duplicate platform config and drift from source of truth
Rejected: Leave redirect lookup hard-failing | one config read failure should not take down unrelated pages
Confidence: medium
Scope-risk: narrow
Reversibility: clean
Directive: Keep redirect config lookup independent of process cwd anywhere server code reads deploy config files
Tested: vitest ./test/prebuild/config-node.test.js; pnpm run netlify-build
Not-tested: live Netlify production deploy before push
2026-04-06 10:31:57 -05:00
ThatGuySam
d026a5420b fix(scanner): rename plist parser module to avoid CI cycle false positive
Some checks failed
Deploy to Cloudflare Workers with Wrangler / Deploy (push) Has been cancelled
Run Node 24 Checks / build (24.x) (push) Has been cancelled
Madge treated the local plist parser module name as a circular dependency during the Netlify build lane after the TypeScript refactor. Rename the local module to plist-parser so the internal file no longer collides with the external plist package name, while keeping parser behavior unchanged.

Constraint: Must restore the deploy gate without changing parser semantics
Rejected: Disable the circular-dependency check | would hide a useful guard instead of fixing the naming conflict that triggered it
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Avoid naming local modules after direct external package imports when the repo relies on static dependency graph tooling
Tested: pnpm run typecheck; pnpm exec vitest run test/scanner/plist.test.ts test/scanner/file-api.test.ts test/scanner/client.test.ts test/prebuild/load-sitemap-endpoints.test.ts; pnpm run test-prebuild
Not-tested: Full production deploy completion before push
2026-04-04 18:31:46 -05:00
ThatGuySam
f1cb66c477 fix(build): retry transient sitemap endpoint fetches
The TypeScript helper refactor exposed a separate production risk: builds can fail when the sitemap-endpoints API returns a transient 5xx during Pagefind index generation. Move that fetch into a small helper with retry logic and add a focused prebuild test so this failure mode is caught without waiting on a full deploy.

Constraint: Must keep Pagefind index generation behavior the same when the endpoint is healthy
Rejected: Ignore the failure as external-only | transient 5xx responses can still block deploys and CI repeatedly
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: When external build inputs can fail transiently, add a small retryable helper plus a direct test before relying on full deploy verification
Tested: pnpm exec vitest run test/prebuild/load-sitemap-endpoints.test.ts; pnpm run typecheck; pnpm run test-prebuild
Not-tested: Full production redeploy completion before push
2026-04-04 18:18:23 -05:00
ThatGuySam
cd41143f0d refactor(scanner): type plist and file-api helpers
Convert the scanner's plist parser and Node-style file shim to TypeScript and add small unit tests so common parser and file-reader failures are caught before we need to lean on Playwright or the higher-level scanner test.

Constraint: Must preserve current scanner behavior while tightening the lowest-level helper surface
Rejected: Jump straight to Mach-O parser conversion | harder to isolate regressions without first proving the smaller helper-test pattern
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Add small module-level regression tests for repeatable scanner breakage before expanding browser coverage
Tested: pnpm run typecheck; pnpm exec vitest run test/scanner/plist.test.ts test/scanner/file-api.test.ts test/scanner/client.test.ts; pnpm run test; pnpm run test:browser
Not-tested: Production deploy behavior prior to push
2026-04-04 18:13:32 -05:00
ThatGuySam
6fc59d6034 fix(runtime-config): avoid package.json fallback in prerender bundle
The previous verbiage fallback loaded package.json via createRequire(), which broke Astro/Netlify prerender bundling because the relative package.json path is not available inside the generated chunk layout. Replace it with static fallback strings so the app-test text stays populated without depending on runtime file access.

Constraint: Must restore Netlify production builds immediately
Rejected: Revert the verbiage fix entirely | would reintroduce the blank app-test subtitle in production
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep public runtime fallbacks bundle-safe; do not require repo files from prerender/runtime chunks
Tested: pnpm run typecheck (workspace); GitHub Actions failure analysis for netlify-build
Not-tested: Full redeploy completion at commit time
2026-04-04 15:41:03 -05:00
ThatGuySam
e667ab564e fix(app-test): restore runtime verbiage fallbacks
The app-test page could render blank processor/mac verbiage when pnpm did not supply npm_package_config_verbiage_* in the runtime environment. Fall back to package.json config and the page-level computed value so the subtitle and description stay populated in builds and production.

Constraint: Must not change scanner behavior or app-test submission flow
Rejected: Patch only the Vue page text | leaves the public runtime config inconsistent for other consumers
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep publicRuntimeConfig resilient to missing npm_package_config_* env values until the config source is normalized repo-wide
Tested: pnpm run typecheck (workspace); node --input-type=module import of publicRuntimeConfig (workspace)
Not-tested: Full browser rerun for this exact commit beyond the already-green production smoke suite
2026-04-04 15:38:30 -05:00
ThatGuySam
689fc0d13d refactor(scanner): type the worker path and align app-test results
Move the worker scanner surface into TypeScript, add a direct worker regression, and make the version=2 app-test path populate the same visible result data and final status as the legacy scanner. This keeps the refactor bounded while making the worker route safe to exercise.

Constraint: Must preserve the existing Apple Silicon app-test behavior while changing the worker internals
Rejected: Flip production to the worker path immediately | still needs the normal deploy path and broader production soak
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep the version=2 adapter using the shared finishFileScan path until the legacy scanner can be removed entirely
Tested: pnpm run typecheck; pnpm exec vitest run test/scanner/client.test.ts; pnpm run test:browser (original workspace); netlify build --context deploy-preview (original workspace)
Not-tested: Browser suite from the clean clone environment (local Astro dev server startup timed out there)
2026-04-04 14:58:25 -05:00
ThatGuySam
a1ae595717 fix(search): prevent pagefind filter hangs
Resolve the Pagefind browser loader in Vite dev and cap filter-only
result hydration so broad filters render promptly instead of stalling
behind thousands of fragment fetches.
2026-03-15 19:25:07 -05:00
ThatGuySam
e1da6eb880 feat(search): add pagefind provider support
Add Pagefind indexing and browser search adapters behind a provider switch.

This lets prebuild generate either Stork or Pagefind search artifacts and lets the existing search UI run against Pagefind while preserving scoped filters, excerpts, and result metadata.
2026-03-15 13:42:07 -05:00
ThatGuySam
727f84e4c2 refactor(search): extract shared filter helper
Share filter parsing and provider mapping logic between Stork and upcoming search adapters.

This keeps the existing Stork API stable while adding Pagefind-oriented filter serialization under test.
2026-03-15 13:41:33 -05:00
ThatGuySam
fcda9f0a02 chore(node): move repo tooling to node 24
Align local version markers and GitHub Actions with Node 24, switch the default test entrypoint to the maintained Vitest runner, and replace pnpm-incompatible npm helpers in repo scripts.

This also removes the obsolete AVA plus esm path and excludes disabled test fixtures from generic Vitest discovery so CI reflects the supported test surface.
2026-03-15 12:55:25 -05:00
ThatGuySam
f378862b23 fix(config): stop relying on global public config 2026-03-15 12:20:19 -05:00
ThatGuySam
9e48862a5f fix(stork): support netlify ubuntu 24 builds
Switch Stork downloads to artifacts that match current runtimes and fix the runtime detection path that Node 22 changed.

This keeps the existing Stork pipeline working on Netlify's Noble image and on Apple Silicon development machines.
2026-03-15 11:57:41 -05:00
Sam Carlton
fa7ca3804b
Update for M3 Verbiage 2023-10-30 20:08:06 -05:00
ThatGuySam
e54c0cdac1 Move msw listener to file 2023-08-12 16:14:45 -05:00
ThatGuySam
361350e5fa Enable msw file server for DoesItAPI 2023-08-12 16:02:17 -05:00
ThatGuySam
ea40288bea Add streamToJson helper 2023-04-01 09:55:03 -05:00
Sam Carlton
13f29b9a64 Revert back to Stork 1.6.0 2023-02-11 17:30:22 -06:00
Sam Carlton
0d5180c7c2 Add future Stork 2.0 code 2023-02-11 17:20:34 -06:00
Sam Carlton
91d36b7f0e Add comment on what’s needed to fix YouTube 2023-02-11 16:32:46 -06:00
Sam Carlton
f1be7ca87e Lock YouTube API data for now 2023-02-11 16:18:27 -06:00
Sam Carlton
8e6ed6ed49 Upgrade to Stork 1.6.0 2023-02-11 16:02:02 -06:00
Sam Carlton
350f9d5b19 Add isLinux helper 2022-09-04 10:13:37 -05:00
Sam Carlton
9c6a4628be Load file directly into fileLoader 2022-08-21 08:46:43 -05:00
Sam Carlton
16fdd159a9 Add getArrayBufferFromFileData function 2022-08-21 08:45:55 -05:00
Sam Carlton
e5b3ba3d9e Trim readFile error message 2022-08-21 08:45:04 -05:00
Sam Carlton
fa156c3733 Use getZipFileReader on readFileBlob 2022-08-21 08:44:36 -05:00
Sam Carlton
ff8e07e11a Add getZipFileReader method 2022-08-21 08:43:04 -05:00
Sam Carlton
3f238dfd4e Add loadFile method 2022-08-21 08:42:32 -05:00
Sam Carlton
c883fe85d6 Message extraction start 2022-08-20 22:38:15 -05:00
Sam Carlton
6d0fafd041 Throw for falsy fileArrayBuffer 2022-08-20 21:35:57 -05:00
Sam Carlton
0cfb9efe29 Catch zipReader errors 2022-08-20 21:35:26 -05:00
Sam Carlton
ada3aec3f6 Make worker self.onmessage into classic function 2022-08-20 21:35:02 -05:00
Sam Carlton
8b15f2580b Pass all message details through receivers 2022-08-20 21:34:29 -05:00
Sam Carlton
c2021fe6fd Fix v2 scans timing out after finishing 2022-08-07 16:07:30 -05:00
Sam Carlton
9e1a7c0158 Fix scan page not receiving v2 messages 2022-08-07 16:07:01 -05:00
Sam Carlton
c79603b361 Fix scan not receiving from Worker 2022-08-07 16:06:26 -05:00
Sam Carlton
6b08545081 Fix data not transferring into Worker 2022-08-07 16:05:43 -05:00
Sam Carlton
f73635de08 Make scan finish verbiage more consistent 2022-08-07 16:03:47 -05:00
Sam Carlton
dcf0a3a265 Use runScanWorker for v2 scan 2022-08-07 15:15:01 -05:00
Sam Carlton
6de839a6d6 Make scan imports relative for Worker compat 2022-08-07 15:13:56 -05:00
Sam Carlton
d37603fcd5 Move scan business login into scan file 2022-08-07 14:33:58 -05:00
Sam Carlton
f82e47c4b6 Put scan steps into single method 2022-08-07 14:19:40 -05:00
Sam Carlton
9ec294c629 Remove undefined arg 2022-08-07 14:18:14 -05:00
Sam Carlton
e3af5f7bb8 Add Scan Worker 2022-08-07 14:18:00 -05:00
Sam Carlton
b857977fbe Reenable V2 Scanner 2022-07-27 21:25:49 -05:00
Sam Carlton
e008ad7ddf Reenable MachoNode 2022-07-27 21:25:36 -05:00
Sam Carlton
3be1dd52a7 Try importing buffer index
# Conflicts:
#	helpers/scanner/client.mjs
2022-07-26 23:25:27 -05:00
Sam Carlton
3ee6a8c13e Remove big int import 2022-07-26 21:31:51 -05:00