mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-12 23:31:02 +00:00
8963180006
- iOS: microphone usage text for "Take Video", no-export-compliance flag, ExportOptions.plist for App Store Connect uploads, the unused push forwarders gone; CI builds with Xcode 26 and lints the property lists. - Android: version and signing from Gradle properties (unsigned without them), R8 with keep rules for TREK's and Capacitor's reflective classes, no Auto Backup of the session cookie, no external file provider path, template and Firebase leftovers removed, keystores and service accounts ignored, full-size adaptive icon layers with a monochrome layer; CI also builds the release APK. - native-release.yml: signed bundle to a Play testing track and archive to TestFlight, by hand or on a v* tag, behind the store environment. - Version handshake: the server reports nativeApi 1, the app refuses a server below its minimum and tolerates an app older than the offline copy. - Address screen: privacy policy link, "Try the demo" and "What is a TREK server?"; the privacy link also in the app's server settings. Three new native strings in all 27 locales. - Donation links and the notices asking for one are hidden in the app. - Store listings for "TREK Travel Planner" in client/fastlane: texts, review notes with placeholders, privacy and account deletion page drafts, the feature graphic and icon, a length and image check in CI, and a Playwright store project with the scripts that turn its captures into screenshots. - Docs: wiki/Native-Apps.md, README no longer says there is no store app.
65 lines
2.7 KiB
JavaScript
65 lines
2.7 KiB
JavaScript
/**
|
|
* Moves the store screenshots from e2e/.tmp/store/ (written by the Playwright
|
|
* `store` project, `npm run store:shots`) into the folders fastlane uploads
|
|
* from, flattened onto the app background: both stores refuse an image with an
|
|
* alpha channel.
|
|
*
|
|
* iphone69, ipad13 fastlane/screenshots/en-US/ (deliver, App Store)
|
|
* play-phone fastlane/metadata/android/en-US/images/phoneScreenshots/
|
|
* play-7in .../sevenInchScreenshots/
|
|
* play-10in .../tenInchScreenshots/ (supply, Google Play)
|
|
*
|
|
* Every image is checked against the size its device must have, so a capture at
|
|
* the wrong viewport never reaches a listing. `npm run store:check` checks the
|
|
* committed files the same way.
|
|
*/
|
|
import { existsSync, mkdirSync, readdirSync } from 'fs';
|
|
import { dirname, join } from 'path';
|
|
import sharp from 'sharp';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const clientDir = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
const rawDir = join(clientDir, 'e2e', '.tmp', 'store');
|
|
const fastlane = join(clientDir, 'fastlane');
|
|
const playImages = join(fastlane, 'metadata', 'android', 'en-US', 'images');
|
|
|
|
const TARGETS = {
|
|
iphone69: { dir: join(fastlane, 'screenshots', 'en-US'), size: [1320, 2868] },
|
|
ipad13: { dir: join(fastlane, 'screenshots', 'en-US'), size: [2064, 2752] },
|
|
'play-phone': { dir: join(playImages, 'phoneScreenshots'), size: [1080, 1920] },
|
|
'play-7in': { dir: join(playImages, 'sevenInchScreenshots'), size: [1620, 2880] },
|
|
'play-10in': { dir: join(playImages, 'tenInchScreenshots'), size: [1920, 1080] },
|
|
};
|
|
|
|
const BACKGROUND = '#09090b';
|
|
|
|
if (!existsSync(rawDir)) {
|
|
console.error(`No captures in ${rawDir}. Run npm run store:shots first.`);
|
|
process.exit(1);
|
|
}
|
|
|
|
let failed = false;
|
|
for (const [device, { dir, size }] of Object.entries(TARGETS)) {
|
|
const from = join(rawDir, device);
|
|
if (!existsSync(from)) {
|
|
console.error(`missing captures for ${device}`);
|
|
failed = true;
|
|
continue;
|
|
}
|
|
mkdirSync(dir, { recursive: true });
|
|
for (const file of readdirSync(from).filter((f) => f.endsWith('.png'))) {
|
|
const image = sharp(join(from, file));
|
|
const { width, height } = await image.metadata();
|
|
if (width !== size[0] || height !== size[1]) {
|
|
console.error(`${device}/${file}: ${width}x${height}, expected ${size[0]}x${size[1]}`);
|
|
failed = true;
|
|
continue;
|
|
}
|
|
// The App Store folder holds both devices; the prefix keeps them apart.
|
|
const name = dir.endsWith(join('screenshots', 'en-US')) ? `${device}_${file}` : file;
|
|
await image.flatten({ background: BACKGROUND }).removeAlpha().png().toFile(join(dir, name));
|
|
console.log(`wrote ${join(dir, name)}`);
|
|
}
|
|
}
|
|
process.exit(failed ? 1 : 0);
|