Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

fingerprint.config.js

26 lines916 Bytes

1// @ts-check
2const fs = require("node:fs");
3const path = require("node:path");
4​
5// Include the major version, which Expo ignores, to prevent OTAs reaching older store binaries.
6const appConfig = fs.readFileSync(path.join(__dirname, "app.config.ts"), "utf8");
7const version =
8 process.env.T3CODE_MOBILE_VERSION ??
9 appConfig.match(/^ {2}version: repoEnv\.T3CODE_MOBILE_VERSION \?\? "([^"]+)"/m)?.[1];
10const majorVersion = version?.match(/^(\d+)\./)?.[1];
11if (!majorVersion) {
12 throw new Error("fingerprint.config.js could not read the app version from app.config.ts");
14​
15module.exports = {
16 nativeModuleSourceType: "files",
17 extraSources: [
18 { type: "contents", id: "appMajorVersion", contents: majorVersion },
19 // Expo skips symlinks when hashing local modules.
20 {
21 type: "file",
22 filePath: "../../native/apple-speech/AppleSpeechEngine.swift",
23 reasons: ["appleSpeech"],
24 },
25 ],
26};