mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-16 03:03:06 +00:00
Board "Acompanhe de perto" (S1) ganha o feed automático do canal oficial: global SocialFeedSettings (admin-only, kill switch + toggle + maxItems + exclusões por item), loader src/utilities/youtubeFeed.ts (Data API v3 search→statistics, unstable_cache tag social-feed + revalidate 300, fail-closed com snapshot persistido via SQL direto — revalidateTag dentro de unstable_cache lança no Next 15.4), card generalizado (CampaignArticleCard → CampaignContentCard, external com noopener) e merge por recência com o grande = mais recente elegível. Stub HTTP do YouTube no webServer do Playwright (porta dev+1000) + 4 e2e novos no describe serial. Migration 20260818_111748_add_social_feed_settings (não destrutiva). Closes #18
11 lines
592 B
TypeScript
11 lines
592 B
TypeScript
/**
|
|
* Port/URL of the YouTube Data API stub the e2e board (S2) fetches. The single
|
|
* spelling of the derivation: dev servers live in 3100..4099 (worktree slots,
|
|
* capped at 999), so +1000 never collides with another worktree's dev server;
|
|
* CI stays on 4000. Shared by playwright.config.ts (webServer + env) and the
|
|
* frontend spec (state switches) so the two cannot drift apart.
|
|
*/
|
|
export const youtubeStubUrlFor = (baseURL: string): string => {
|
|
const port = new URL(baseURL).port || (baseURL.startsWith('https:') ? '443' : '80')
|
|
return `http://localhost:${Number(port) + 1000}`
|
|
}
|