LifeMate — Personal, Family & Learning Companion

feat/weekly-planner-android
chore/phase1-repository-cleanup deploy/stable-web-apk deployment-static design/mobile-accessibility-v2 design/mobile-navigation-review docs/child-education-access-decision docs/offline-data-rescue-options docs/owner-guide-and-delivery-plan docs/phase1-policy-options docs/public-review-live-2026-10-15 feat/aparat-learning-library feat/child-device-safety feat/child-identity-schema feat/flutter-mobile-navigation feat/learning-content-operations feat/local-signing-preflight feat/online-family-stage0 feat/personal-encrypted-recovery feat/private-planner-series-api feat/public-review-page feat/standalone-weekly-planner feat/weekly-planner-android final-feature-1/iran-family-school fix/auth-abuse-expiry-safety fix/auth-expiry-after-lock fix/backend-request-safety fix/lifeguide-bootstrap-naming-ci fix/lifeguide-pages-qa-base-preflight fix/lifeguide-qa-pages-env-deployment fix/local-task-persistence fix/managed-child-session-boundary fix/personal-jalali-dates fix/personal-notification-controls fix/personal-upgrade-delivery-guard fix/sms-approval-gates fix/study-duration-display infra/cloudflare-neon-migration infra/lifeguide-cloudflare-qa infra/lifeguide-github-pages-qa infra/lifeguide-supabase-qa main phase-1/foundation-completion phase-2/product-foundation-identity phase-3/planner-school-family-core phase-4/ai-learning-wellbeing phase-5/hardening-observability-release test/android-reminder-acceptance test/personal-notification-settings test/personal-recovery-acceptance test/role-entry-apk
mjs 25 lines 1.14 KB
Raw
1 import {readFile, writeFile, readdir} from 'node:fs/promises';
2 import {join} from 'node:path';
3
4 const root = process.argv[2] || 'build/web';
5 async function walk(path) {
6 const files = [];
7 for (const entry of await readdir(path, {withFileTypes: true})) {
8 const location = join(path, entry.name);
9 if (entry.isDirectory()) files.push(...await walk(location));
10 else if (/\.(?:js|json|html)$/.test(entry.name)) files.push(location);
11 }
12 return files;
13 }
14 for (const file of await walk(root)) {
15 let source = await readFile(file, 'utf8');
16 // SDK defaults remain in generated JS despite the configured local loader.
17 // Neutralize these exact known defaults; never rewrite an operator API URL.
18 source = source.replaceAll('https://www.gstatic.com/flutter-canvaskit', 'canvaskit')
19 .replaceAll('https://fonts.gstatic.com/s/', 'assets/fonts/fallback/');
20 if (/https?:[^\s"'<>]*(?:gstatic\.com|googleapis\.com|up\.railway\.app)/i.test(source)) {
21 throw new Error(`Unexpected external runtime URL in ${file}`);
22 }
23 await writeFile(file, source);
24 }
25 console.log('Web resources use local CanvasKit/font bases; external SDK/CDN defaults removed.');