build.prebuild and a Capacitor web-asset staleness guard for apple build / play build
apple build and play build run build.prebuild (or apple.prebuild / play.prebuild) first, once per flow run; --no-prebuild skips it, --dry only prints it. A Capacitor project's copied public/index.html must then be newer than the last source commit and <webDir>/index.html, else the build stops (--allow-stale-web overrides). check warns when stale without a prebuild; the build output and dry plan show the web bundle's sha256 and mtime. The Capacitor project is also found in a monorepo (apps/native etc.); several ask for play.build.dir / apple.build.*. Pitfall 23.
This commit is contained in:
parent
f694af80eb
commit
5fbb9e63e3
14 changed files with 600 additions and 25 deletions
15
cli/check.ts
15
cli/check.ts
|
|
@ -5,7 +5,7 @@
|
|||
// storebound check --aso keyword audit of both listing files (App Store keyword field, Play stuffing); exit 1 on errors
|
||||
// --json structured result ({ ok, items, warnings, hints, problems } or { findings, errors }), exit 1 on problems
|
||||
import { existsSync, readFileSync } from 'node:fs';
|
||||
import { relative } from 'node:path';
|
||||
import { dirname, relative } from 'node:path';
|
||||
import { appPrivacyMismatches } from './lib/app-privacy';
|
||||
import { type AsoFinding, auditAso } from './lib/aso';
|
||||
import { draftLocales } from './lib/aso-intel';
|
||||
|
|
@ -20,6 +20,7 @@ import { detectProject } from './lib/scan/project';
|
|||
import { reviewShotProblem } from './apple/iap-review';
|
||||
import { allSubscriptions } from './lib/subscriptions';
|
||||
import { type CopyFile, validateCopy } from './shots/lib';
|
||||
import { type CapProject, capacitorProject, prebuildFor, staleMessage, webState } from './lib/web-assets';
|
||||
|
||||
function aso(ctx: Ctx): void {
|
||||
const { config, resolve } = ctx.loaded;
|
||||
|
|
@ -119,7 +120,17 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
if (e.length) throw new Error(e.join('; '));
|
||||
return `${Object.keys(copy).length} languages x ${config.shots!.scenes.length} scenes`;
|
||||
});
|
||||
for (const i of profileIssues(config, { demoAccount: !!reviewDemoAccount(ctx.loaded.root) })) {
|
||||
// Capacitor: the native builds ship the web assets cap sync copied last (pitfall 20)
|
||||
for (const store of ['apple', 'play'] as const) {
|
||||
if (!config[store] || prebuildFor(config, store)) continue;
|
||||
const b = store === 'play' ? config.play?.build?.dir : config.apple?.build?.workspace ?? config.apple?.build?.project;
|
||||
let cap: CapProject | null = null;
|
||||
try { cap = capacitorProject(ctx.loaded.root, b && store === 'apple' ? dirname(b) : b); } catch (e) { note(`${store}: ${(e as Error).message}`); continue; }
|
||||
if (!cap) continue;
|
||||
const st = webState(ctx.loaded.root, store, cap);
|
||||
if (st.staleness.stale) note(`${store}: ${staleMessage(st.path, st.staleness, st.copied)}. Set build.prebuild (e.g. "npm run build && npx cap sync") so apple build / play build refresh them`);
|
||||
}
|
||||
for (const i of profileIssues(config,{ demoAccount: !!reviewDemoAccount(ctx.loaded.root) })) {
|
||||
if (i.level === 'error') problems.push(i.msg); else warn('check', i.msg);
|
||||
}
|
||||
const subs = allSubscriptions(config.subscriptions);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue