@marktiderman/genesis-cli 1.11.2 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/expo.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
- import { G as GenesisDataUse, a as GenesisPrivacy, b as GenesisLinks } from './config-QC_Ewwwp.js';
4
- export { c as GenesisConfigError, P as PRIVACY_DATA_TYPES, d as PRIVACY_PURPOSES, p as privacyDataType, r as readGenesisConfig, v as validateLinks, e as validatePrivacy } from './config-QC_Ewwwp.js';
3
+ import { G as GenesisDataUse, a as GenesisPrivacy, b as GenesisLinks } from './config-4MhgqkFT.js';
4
+ export { c as GenesisConfigError, P as PRIVACY_DATA_TYPES, d as PRIVACY_PURPOSES, p as privacyDataType, r as readGenesisConfig, v as validateLinks, e as validatePrivacy } from './config-4MhgqkFT.js';
5
5
 
6
6
  declare const APP_VARIANTS: readonly ["development", "preview", "production"];
7
7
  type AppVariant = (typeof APP_VARIANTS)[number];
package/dist/expo.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/doctor/config.ts","../src/expo.ts"],"names":["api","path2","existsSync","readFileSync"],"mappings":";;;;AAcO,IAAM,kBAAA,GAAN,cAAiC,KAAA,CAAM;AAAA,EACnC,IAAA,GAAO,oBAAA;AAClB;AAEO,IAAM,iBAAA,GAAN,cAAgC,kBAAA,CAAmB;AAAA,EAC/C,IAAA,GAAO,mBAAA;AAClB,CAAA;AAoBO,IAAM,kBAAA,GAAuD;AAAA,EAClE,IAAA,EAAM,gCAAA;AAAA,EACN,eAAA,EAAiB,wCAAA;AAAA,EACjB,cAAA,EAAgB,uCAAA;AAAA,EAChB,kBAAA,EAAoB,2CAAA;AAAA,EACpB,yBAAA,EAA2B,gDAAA;AAAA,EAC3B,MAAA,EAAQ,kCAAA;AAAA,EACR,OAAA,EAAS,mCAA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AA;AACT;AAEA,IAAO,YAAA,GAAQ;AAEf,SAAS,iBAAiB,IAAA,EAAuC;AAC/D,EAAA,MAAM,IAAA,GAAYC,IAAA,CAAA,IAAA,CAAK,IAAA,EAAM,cAAc,CAAA;AAC3C,EAAA,IAAI,CAACC,UAAAA,CAAW,IAAI,CAAA,SAAU,EAAC;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,OAAO,IAAA,CAAK,KAAA,CAAMC,aAAa,IAAA,EAAM,MAAM,CAAC,CAAA,EAAG,YAAA;AACrD,IAAA,OAAO,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,GAAW,OAAO,EAAC;AAAA,EACpD,SAAS,GAAA,EAAK;AACZ,IAAA,MAAM,IAAI,kBAAA,CAAmB,CAAA,EAAG,IAAI,CAAA,oBAAA,EAAwB,GAAA,CAAc,OAAO,CAAA,CAAE,CAAA;AAAA,EACrF;AACF;AAEA,SAAS,KAAA,CAAM,GAAa,CAAA,EAAuB;AACjD,EAAA,OAAO,CAAC,mBAAG,IAAI,GAAA,CAAI,CAAC,GAAG,CAAA,EAAG,GAAG,CAAC,CAAC,CAAC,CAAA;AAClC","file":"expo.js","sourcesContent":["/**\n * Finds and validates the app's genesis.config.json.\n *\n * The doctor's lookup order: `--config <path>`, then `genesis.config.json`\n * in the app root, then the `genesis` key of package.json. Either file holds\n * the settings under `doctor`, beside other blocks: `features` (read by\n * `genesis features`) and `links` (validated here, read by the Expo config\n * plugin).\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { DoctorConfig } from \"./types.js\";\n\n/** A genesis.config.json that can't be read or has a block of the wrong shape. */\nexport class GenesisConfigError extends Error {\n override name = \"GenesisConfigError\";\n}\n\nexport class DoctorConfigError extends GenesisConfigError {\n override name = \"DoctorConfigError\";\n}\n\n/** The `links` block: the web hosts (and optional path prefixes) the app opens as universal / app links. */\nexport interface GenesisLinks {\n /** Bare host names, such as `example.com` or `app.example.com`: no scheme, path or port. */\n hosts: string[];\n /** Path prefixes the app handles, each starting with `/`. Default: every path. */\n paths?: string[];\n /** Also add `webcredentials:` domains (password autofill). Default true. */\n webcredentials?: boolean;\n}\n\n/**\n * Apple's collected data types (`NSPrivacyCollectedDataType`), every one in\n * Apple's reference, keyed by the stores' own words, lower case, as Genesis\n * blocks name them in `privacy.collects`. Look one up with\n * {@link privacyDataType}, which ignores case (blocks write `\"device ID\"`,\n * `\"user ID\"`). The values are Apple's exact strings, `PhotosorVideos`\n * included.\n */\nexport const PRIVACY_DATA_TYPES: Readonly<Record<string, string>> = {\n name: \"NSPrivacyCollectedDataTypeName\",\n \"email address\": \"NSPrivacyCollectedDataTypeEmailAddress\",\n \"phone number\": \"NSPrivacyCollectedDataTypePhoneNumber\",\n \"physical address\": \"NSPrivacyCollectedDataTypePhysicalAddress\",\n \"other user contact info\": \"NSPrivacyCollectedDataTypeOtherUserContactInfo\",\n health: \"NSPrivacyCollectedDataTypeHealth\",\n fitness: \"NSPrivacyCollectedDataTypeFitness\",\n \"payment info\": \"NSPrivacyCollectedDataTypePaymentInfo\",\n \"credit info\": \"NSPrivacyCollectedDataTypeCreditInfo\",\n \"other financial info\": \"NSPrivacyCollectedDataTypeOtherFinancialInfo\",\n \"precise location\": \"NSPrivacyCollectedDataTypePreciseLocation\",\n \"coarse location\": \"NSPrivacyCollectedDataTypeCoarseLocation\",\n \"sensitive info\": \"NSPrivacyCollectedDataTypeSensitiveInfo\",\n contacts: \"NSPrivacyCollectedDataTypeContacts\",\n \"emails or text messages\": \"NSPrivacyCollectedDataTypeEmailsOrTextMessages\",\n \"photos or videos\": \"NSPrivacyCollectedDataTypePhotosorVideos\",\n \"audio data\": \"NSPrivacyCollectedDataTypeAudioData\",\n \"gameplay content\": \"NSPrivacyCollectedDataTypeGameplayContent\",\n \"customer support\": \"NSPrivacyCollectedDataTypeCustomerSupport\",\n \"other user content\": \"NSPrivacyCollectedDataTypeOtherUserContent\",\n \"browsing history\": \"NSPrivacyCollectedDataTypeBrowsingHistory\",\n \"search history\": \"NSPrivacyCollectedDataTypeSearchHistory\",\n \"user id\": \"NSPrivacyCollectedDataTypeUserID\",\n \"device id\": \"NSPrivacyCollectedDataTypeDeviceID\",\n \"purchase history\": \"NSPrivacyCollectedDataTypePurchaseHistory\",\n \"product interaction\": \"NSPrivacyCollectedDataTypeProductInteraction\",\n \"advertising data\": \"NSPrivacyCollectedDataTypeAdvertisingData\",\n \"other usage data\": \"NSPrivacyCollectedDataTypeOtherUsageData\",\n \"crash data\": \"NSPrivacyCollectedDataTypeCrashData\",\n \"performance data\": \"NSPrivacyCollectedDataTypePerformanceData\",\n \"other diagnostic data\": \"NSPrivacyCollectedDataTypeOtherDiagnosticData\",\n \"environment scanning\": \"NSPrivacyCollectedDataTypeEnvironmentScanning\",\n hands: \"NSPrivacyCollectedDataTypeHands\",\n head: \"NSPrivacyCollectedDataTypeHead\",\n \"other data types\": \"NSPrivacyCollectedDataTypeOtherDataTypes\",\n};\n\n/** Apple's string for a data type in the stores' words, whatever its case, or undefined. */\nexport function privacyDataType(type: string): string | undefined {\n return PRIVACY_DATA_TYPES[type.toLowerCase()];\n}\n\n/** Apple's collection purposes (`NSPrivacyCollectedDataTypePurposes`), by the stores' words. */\nexport const PRIVACY_PURPOSES: Readonly<Record<string, string>> = {\n \"app functionality\": \"NSPrivacyCollectedDataTypePurposeAppFunctionality\",\n analytics: \"NSPrivacyCollectedDataTypePurposeAnalytics\",\n \"product personalization\": \"NSPrivacyCollectedDataTypePurposeProductPersonalization\",\n \"developer advertising\": \"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising\",\n \"third-party advertising\": \"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising\",\n other: \"NSPrivacyCollectedDataTypePurposeOther\",\n};\n\n/** One kind of data the app collects, as a Genesis block's `privacy.collects` entry says it. */\nexport interface GenesisDataUse {\n /** A key of {@link PRIVACY_DATA_TYPES}: `\"email address\"`, `\"user id\"`, `\"crash data\"`… */\n type: string;\n /** Keys of {@link PRIVACY_PURPOSES}: `\"app functionality\"`, `\"analytics\"`… */\n purposes: string[];\n /** Tied to the person's identity. */\n linked: boolean;\n /** Used to track the person across other companies' apps and websites. */\n tracking: boolean;\n}\n\n/**\n * The `privacy` block: what goes in the iOS privacy manifest's collected data\n * types. Left out, the Genesis blocks the app's packages carry decide.\n */\nexport interface GenesisPrivacy {\n /** The Genesis blocks whose data the app sends anywhere (`account`, `observability`, `push`). Default: found from package.json. */\n blocks?: string[];\n /** Every kind of data the app collects. Replaces what the blocks give, so list everything. */\n collects?: GenesisDataUse[];\n /** `NSPrivacyTracking`. Default false; true needs `NSPrivacyTrackingDomains` in app.config. */\n tracking?: boolean;\n}\n\n/** genesis.config.json, parsed, with its shared blocks validated. */\nexport interface GenesisConfigFile {\n /** The whole parsed file, for blocks other readers own (`doctor`, `features`). */\n raw: Record<string, unknown>;\n links?: GenesisLinks;\n privacy?: GenesisPrivacy;\n}\n\nexport interface LoadedConfig {\n config: DoctorConfig;\n /** The file it came from, or null when no config exists (defaults apply). */\n file: string | null;\n /** Folder that relative plugin paths resolve against. */\n dir: string;\n}\n\nconst STRING_LISTS = [\"src\", \"extensions\", \"ignore\", \"tokenFiles\", \"ignoreTokenPrefixes\", \"localPrimitiveDirs\", \"build\", \"componentPackages\"] as const;\nconst STRINGS = [\"uiPackage\", \"rulesDoc\"] as const;\nconst KNOWN = new Set<string>([\n ...STRING_LISTS,\n ...STRINGS,\n \"themeCss\",\n \"rawTags\",\n \"forbiddenImports\",\n \"rules\",\n \"allow\",\n \"patterns\",\n \"plugins\",\n \"packs\",\n \"native\",\n \"supabase\",\n \"routesDir\",\n \"$schema\",\n \"$comment\",\n]);\nconst LEVELS = new Set([\"error\", \"warn\", \"info\", \"off\"]);\nconst PATTERN_KEYS = new Set([\"id\", \"level\", \"files\", \"exclude\", \"forbid\", \"require\", \"path\", \"message\"]);\nconst PACKS = new Set([\"native\", \"supabase\"]);\n/** Each pack's settings: key → \"string\", \"path\" (app-relative folder, normalized) or \"list\". */\nconst PACK_KEYS: Record<string, Record<string, \"string\" | \"path\" | \"list\">> = {\n native: { routerRoot: \"path\" },\n supabase: { migrations: \"path\", base: \"string\", exposedSchemas: \"list\", since: \"string\" },\n};\n\n/** An app-relative folder in POSIX form (`./app/` → `app`); absolute paths and paths leaving the app are rejected. */\nfunction appPath(v: unknown, where: string, fail: (msg: string) => never): string {\n if (typeof v !== \"string\" || !v.trim()) return fail(`${where} must be a non-empty path`);\n if (path.isAbsolute(v) || /^[A-Za-z]:[\\\\/]/.test(v)) fail(`${where} must be relative to the app, not absolute (\"${v}\")`);\n const norm = path.posix.normalize(v.replace(/\\\\/g, \"/\")).replace(/\\/+$/, \"\");\n if (norm === \".\" || norm === \"..\" || norm.startsWith(\"../\")) fail(`${where} must be a folder inside the app (\"${v}\")`);\n return norm;\n}\n\nexport function loadConfig(root: string, configPath?: string): LoadedConfig {\n if (configPath) {\n const file = path.resolve(root, configPath);\n if (!existsSync(file)) throw new DoctorConfigError(`Config file not found: ${configPath}`);\n const json = readJson(file);\n // An explicit file may hold the block at the top level or under `doctor`\n // (or, for a package.json, under `genesis.doctor`).\n const block = path.basename(file) === \"package.json\" ? json?.genesis?.doctor : json?.doctor ?? json;\n return { config: validateConfig(block ?? {}, file), file, dir: path.dirname(file) };\n }\n const own = path.join(root, \"genesis.config.json\");\n if (existsSync(own)) {\n const block = readGenesisConfig(root)?.raw.doctor;\n return { config: validateConfig(block ?? {}, own), file: own, dir: root };\n }\n const pkg = path.join(root, \"package.json\");\n if (existsSync(pkg)) {\n const block = readJson(pkg)?.genesis?.doctor;\n if (block !== undefined) return { config: validateConfig(block, pkg), file: pkg, dir: root };\n }\n return { config: {}, file: null, dir: root };\n}\n\nfunction readJson(file: string) {\n try {\n return JSON.parse(readFileSync(file, \"utf8\"));\n } catch (err) {\n throw new DoctorConfigError(`${file} is not valid JSON: ${(err as Error).message}`);\n }\n}\n\n/**\n * Reads `<root>/genesis.config.json` and validates its shared blocks (today:\n * `links` and `privacy`). Returns null when the file doesn't exist; throws a\n * GenesisConfigError naming the file when it isn't valid.\n */\nexport function readGenesisConfig(root: string): GenesisConfigFile | null {\n const file = path.join(root, \"genesis.config.json\");\n if (!existsSync(file)) return null;\n const raw: unknown = readJson(file);\n if (!isObject(raw)) throw new GenesisConfigError(`${file}: the config must be a JSON object`);\n const out: GenesisConfigFile = { raw };\n if (raw.links !== undefined) out.links = validateLinks(raw.links, file);\n if (raw.privacy !== undefined) out.privacy = validatePrivacy(raw.privacy, file);\n return out;\n}\n\nconst PRIVACY_KEYS = new Set([\"blocks\", \"collects\", \"tracking\"]);\nconst DATA_USE_KEYS = new Set([\"type\", \"purposes\", \"linked\", \"tracking\"]);\n\n/**\n * Check a `privacy` block (genesis.config.json's, or the plugin's `privacy`\n * option): a misspelt data type or purpose fails the build, since Xcode's\n * privacy report ignores values it doesn't know.\n */\nexport function validatePrivacy(raw: unknown, source = \"config\"): GenesisPrivacy {\n const fail = (msg: string): never => {\n throw new GenesisConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(`\"privacy\" must be an object`);\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!PRIVACY_KEYS.has(key)) fail(`privacy: unknown setting \"${key}\"`);\n const out: GenesisPrivacy = {};\n if (c.blocks !== undefined) {\n if (!isStringList(c.blocks)) fail(`privacy.blocks must be a list of block ids`);\n out.blocks = [...new Set(c.blocks as string[])];\n }\n if (c.tracking !== undefined) {\n if (typeof c.tracking !== \"boolean\") fail(`privacy.tracking must be true or false`);\n out.tracking = c.tracking as boolean;\n }\n if (c.collects !== undefined) {\n if (!Array.isArray(c.collects)) fail(`privacy.collects must be a list`);\n out.collects = (c.collects as unknown[]).map((entry, i) => {\n const where = `privacy.collects[${i}]`;\n if (!isObject(entry)) return fail(`${where} must be an object`);\n for (const key of Object.keys(entry)) if (!DATA_USE_KEYS.has(key)) fail(`${where}: unknown setting \"${key}\"`);\n if (typeof entry.type !== \"string\" || !privacyDataType(entry.type)) {\n fail(`${where}.type \"${String(entry.type)}\" is not one of ${Object.keys(PRIVACY_DATA_TYPES).join(\", \")}`);\n }\n if (!isStringList(entry.purposes) || entry.purposes.length === 0) fail(`${where}.purposes must be a non-empty list`);\n for (const p of entry.purposes as string[]) {\n if (!(p in PRIVACY_PURPOSES)) fail(`${where}.purposes: \"${p}\" is not one of ${Object.keys(PRIVACY_PURPOSES).join(\", \")}`);\n }\n if (typeof entry.linked !== \"boolean\") fail(`${where}.linked must be true or false`);\n if (typeof entry.tracking !== \"boolean\") fail(`${where}.tracking must be true or false`);\n return { type: entry.type as string, purposes: [...new Set(entry.purposes as string[])], linked: entry.linked as boolean, tracking: entry.tracking as boolean };\n });\n }\n return out;\n}\n\nconst LINK_KEYS = new Set([\"hosts\", \"paths\", \"webcredentials\"]);\nconst HOST = /^(?=.{1,253}$)(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/;\n\n/** Check the `links` block, so a typo'd host fails the build instead of shipping links that never open. */\nexport function validateLinks(raw: unknown, source = \"config\"): GenesisLinks {\n const fail = (msg: string): never => {\n throw new GenesisConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(`\"links\" must be an object`);\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!LINK_KEYS.has(key)) fail(`links: unknown setting \"${key}\"`);\n if (!isStringList(c.hosts) || c.hosts.length === 0) fail(`links.hosts must be a non-empty list of host names`);\n for (const host of c.hosts as string[]) {\n if (!HOST.test(host)) {\n fail(`links.hosts: \"${host}\" is not a bare lower-case host name (no scheme, path or port), e.g. \"example.com\"`);\n }\n }\n if (c.paths !== undefined) {\n if (!isStringList(c.paths)) fail(`links.paths must be a list of path prefixes`);\n for (const p of c.paths as string[]) {\n if (!p.startsWith(\"/\") || /[\\s?#*]/.test(p)) {\n fail(`links.paths: \"${p}\" must start with \"/\" and hold no spaces, \"?\", \"#\" or \"*\"`);\n }\n }\n }\n if (c.webcredentials !== undefined && typeof c.webcredentials !== \"boolean\") fail(`links.webcredentials must be true or false`);\n const links: GenesisLinks = { hosts: [...new Set(c.hosts as string[])] };\n if (c.paths !== undefined) links.paths = [...new Set(c.paths as string[])];\n if (c.webcredentials !== undefined) links.webcredentials = c.webcredentials as boolean;\n return links;\n}\n\n/** Check the shape, so a typo fails loudly instead of silently disabling a check. */\nexport function validateConfig(raw: unknown, source = \"config\"): DoctorConfig {\n const fail = (msg: string): never => {\n throw new DoctorConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(\"the doctor settings must be an object\");\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!KNOWN.has(key)) fail(`unknown setting \"${key}\"`);\n // themeCss takes one stylesheet or several; normalize to a list.\n if (typeof c.themeCss === \"string\") c.themeCss = [c.themeCss];\n if (c.themeCss !== undefined && !isStringList(c.themeCss)) fail(`\"themeCss\" must be a path or a list of paths`);\n for (const key of STRING_LISTS) {\n if (c[key] !== undefined && !isStringList(c[key])) fail(`\"${key}\" must be a list of strings`);\n }\n for (const key of STRINGS) {\n if (c[key] !== undefined && typeof c[key] !== \"string\") fail(`\"${key}\" must be a string`);\n }\n if (c.routesDir !== undefined) c.routesDir = appPath(c.routesDir, `\"routesDir\"`, fail);\n if (c.rawTags !== undefined) {\n if (!isObject(c.rawTags)) fail(`\"rawTags\" must be an object`);\n for (const [tag, v] of Object.entries(c.rawTags as object)) {\n if (!/^[a-z][a-z0-9-]*$/.test(tag)) fail(`rawTags: \"${tag}\" is not an HTML tag name`);\n if (v !== false && typeof v !== \"string\") fail(`rawTags.${tag} must be a component name or false`);\n }\n }\n if (c.forbiddenImports !== undefined) {\n if (!isObject(c.forbiddenImports)) fail(`\"forbiddenImports\" must be an object of pattern → message`);\n for (const [re, msg] of Object.entries(c.forbiddenImports as object)) {\n if (typeof msg !== \"string\") fail(`forbiddenImports[\"${re}\"] must be a message string`);\n checkRegExp(re, `forbiddenImports[\"${re}\"]`, fail);\n }\n }\n if (c.rules !== undefined) {\n if (!isObject(c.rules)) fail(`\"rules\" must be an object of rule → level`);\n for (const [rule, level] of Object.entries(c.rules as object)) {\n if (!LEVELS.has(level as string)) fail(`rules.${rule} must be \"error\", \"warn\", \"info\" or \"off\"`);\n }\n }\n if (c.allow !== undefined) {\n if (!Array.isArray(c.allow)) fail(`\"allow\" must be a list`);\n (c.allow as unknown[]).forEach((e, i) => {\n if (!isObject(e)) return fail(`allow[${i}] must be an object`);\n const entry = e as Record<string, unknown>;\n if (typeof entry.rule !== \"string\" || !entry.rule) fail(`allow[${i}] needs a \"rule\"`);\n if (typeof entry.reason !== \"string\" || !entry.reason.trim()) fail(`allow[${i}] (${entry.rule}) needs a \"reason\"`);\n for (const k of [\"file\", \"match\"]) {\n if (entry[k] !== undefined && typeof entry[k] !== \"string\") fail(`allow[${i}].${k} must be a string`);\n }\n });\n }\n if (c.patterns !== undefined) {\n if (!Array.isArray(c.patterns)) fail(`\"patterns\" must be a list`);\n (c.patterns as unknown[]).forEach((p, i) => {\n if (!isObject(p)) return fail(`patterns[${i}] must be an object`);\n const rule = p as Record<string, unknown>;\n for (const k of Object.keys(rule)) if (!PATTERN_KEYS.has(k)) fail(`patterns[${i}]: unknown key \"${k}\"`);\n if (typeof rule.id !== \"string\" || !rule.id) fail(`patterns[${i}] needs an \"id\"`);\n for (const k of [\"files\", \"exclude\"]) {\n if (rule[k] !== undefined && !isStringList(rule[k])) fail(`patterns[${i}].${k} must be a list of globs`);\n }\n });\n }\n if (c.packs !== undefined) {\n if (!isStringList(c.packs)) fail(`\"packs\" must be a list, e.g. [\"native\", \"supabase\"]`);\n for (const p of c.packs as string[]) if (!PACKS.has(p)) fail(`packs: unknown pack \"${p}\" (known: ${[...PACKS].join(\", \")})`);\n if (new Set(c.packs as string[]).size !== (c.packs as string[]).length) fail(`packs: lists a pack twice`);\n }\n for (const [pack, keys] of Object.entries(PACK_KEYS)) {\n const block = c[pack];\n if (block === undefined) continue;\n if (!isObject(block)) fail(`\"${pack}\" must be an object`);\n if (!((c.packs as string[] | undefined) ?? []).includes(pack)) fail(`\"${pack}\" settings are set but the ${pack} pack is not in \"packs\"`);\n for (const [k, v] of Object.entries(block as object)) {\n const want = keys[k];\n if (!want) fail(`${pack}: unknown setting \"${k}\"`);\n if (want === \"string\" && typeof v !== \"string\") fail(`${pack}.${k} must be a string`);\n if (want === \"list\" && !isStringList(v)) fail(`${pack}.${k} must be a list of strings`);\n if (want === \"string\" && !(v as string).trim()) fail(`${pack}.${k} must not be empty`);\n if (want === \"path\") (block as Record<string, unknown>)[k] = appPath(v, `${pack}.${k}`, fail);\n }\n }\n // Schema names compare lowercased, like the SQL they're matched against.\n const supa = c.supabase as Record<string, unknown> | undefined;\n if (Array.isArray(supa?.exposedSchemas)) supa.exposedSchemas = (supa.exposedSchemas as string[]).map((s) => s.toLowerCase());\n if (c.plugins !== undefined) {\n const ok =\n Array.isArray(c.plugins) &&\n c.plugins.every((p) => typeof p === \"string\" || (Array.isArray(p) && p.length === 2 && typeof p[0] === \"string\"));\n if (!ok) fail(`\"plugins\" must be a list of module paths or [path, options] pairs`);\n }\n return c as DoctorConfig;\n}\n\nexport function checkRegExp(source: string, where: string, fail: (msg: string) => never): void {\n try {\n new RegExp(source);\n } catch (err) {\n fail(`${where} is not a valid regular expression: ${(err as Error).message}`);\n }\n}\n\nfunction isObject(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\nfunction isStringList(v: unknown): v is string[] {\n return Array.isArray(v) && v.every((x) => typeof x === \"string\");\n}\n","/**\n * `withGenesis()` — the Genesis Expo config plugin.\n *\n * Keeps an app's `app.config.ts` to a name, ids and plugins. It sets:\n *\n * 1. App variants: `APP_VARIANT` (`development` | `preview` | `production`,\n * default `production`) suffixes the bundle id, Android package, name and\n * URL scheme, so the three builds install side by side and a\n * `scheme://` link opens the build it names, not whichever one iOS or\n * Android picks among apps that registered the same scheme.\n * 2. Universal / app links from genesis.config.json `links`:\n * `ios.associatedDomains` (`applinks:` and `webcredentials:`) and one\n * Android `intentFilters` entry with `autoVerify`.\n * 3. The iOS privacy manifest, merged into what the app declares: the\n * required-reason APIs of React Native, Expo and the packages the app's\n * package.json lists; `NSPrivacyTracking: false`; and the collected data\n * types, the union of what each Genesis block the app uses collects\n * (`account`, `observability`, `push`), or the app's own list from\n * genesis.config.json `privacy` or the plugin's `privacy` option.\n * 4. Export compliance: `ios.config.usesNonExemptEncryption = false`.\n * 5. `runtimeVersion: { policy: \"fingerprint\" }`.\n *\n * Anything the app already sets wins: the plugin fills gaps and appends to\n * lists, never overwrites or removes a value, and running it twice changes\n * nothing.\n *\n * Determinism: the plugin reads two committed files in the project root,\n * genesis.config.json and package.json, and one environment variable,\n * APP_VARIANT. No network, no clock, no other environment. The same commit\n * and variant always give the same config; the EAS fingerprint is stable only\n * if APP_VARIANT is set the same way for builds, `eas update` and fingerprint\n * checks (an EAS environment variable, not a build profile's `env`).\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { ConfigPlugin } from \"@expo/config-plugins\";\nimport type { ExpoConfig } from \"@expo/config-types\";\nimport {\n GenesisConfigError,\n PRIVACY_PURPOSES,\n privacyDataType,\n readGenesisConfig,\n validatePrivacy,\n type GenesisDataUse,\n type GenesisLinks,\n type GenesisPrivacy,\n} from \"./doctor/config.js\";\n\nexport {\n GenesisConfigError,\n PRIVACY_DATA_TYPES,\n PRIVACY_PURPOSES,\n privacyDataType,\n validateLinks,\n validatePrivacy,\n readGenesisConfig,\n type GenesisDataUse,\n type GenesisLinks,\n type GenesisPrivacy,\n} from \"./doctor/config.js\";\n\nexport const APP_VARIANTS = [\"development\", \"preview\", \"production\"] as const;\nexport type AppVariant = (typeof APP_VARIANTS)[number];\n\nexport interface VariantSuffix {\n /** Appended to `ios.bundleIdentifier` and `android.package`, e.g. `.dev`. */\n id: string;\n /** Appended to `name`, e.g. ` (Dev)`. */\n name: string;\n /** Appended to each `scheme`, e.g. `-dev` (`myapp-dev://`). */\n scheme: string;\n}\n\n/** A required-reason API category and the reasons for it, as in PrivacyInfo.xcprivacy. */\nexport interface PrivacyApi {\n NSPrivacyAccessedAPIType: string;\n NSPrivacyAccessedAPITypeReasons: string[];\n}\n\nexport interface WithGenesisOptions {\n /**\n * The variant, overriding `APP_VARIANT`. Tests and scripts pass it; an app\n * leaves it out and sets `APP_VARIANT` per build profile in eas.json.\n */\n variant?: AppVariant;\n /** Suffixes per non-production variant. Default `.dev` / ` (Dev)` / `-dev` and `.preview` / ` (Preview)` / `-preview`. */\n variants?: Partial<Record<Exclude<AppVariant, \"production\">, Partial<VariantSuffix>>>;\n /** Where genesis.config.json and package.json live. Default: the Expo project root. */\n projectRoot?: string;\n /**\n * The manifest's collected data types, overriding genesis.config.json\n * `privacy` key by key (`blocks` here replaces the file's `blocks`; a\n * `collects` list, from either place, replaces every block's list). An app\n * passes `blocks` from its own feature switches, so a block turned off\n * declares nothing. Without `privacy` in either place, the blocks are found\n * from package.json and a warning says the app's own data isn't in the list.\n */\n privacy?: GenesisPrivacy;\n /** Turn single steps off. Every step is on by default. */\n links?: boolean;\n privacyManifest?: boolean;\n exportCompliance?: boolean;\n fingerprint?: boolean;\n}\n\nexport const DEFAULT_VARIANT_SUFFIXES: Record<Exclude<AppVariant, \"production\">, VariantSuffix> = {\n development: { id: \".dev\", name: \" (Dev)\", scheme: \"-dev\" },\n preview: { id: \".preview\", name: \" (Preview)\", scheme: \"-preview\" },\n};\n\nconst api = (category: string, ...reasons: string[]): PrivacyApi => ({\n NSPrivacyAccessedAPIType: `NSPrivacyAccessedAPICategory${category}`,\n NSPrivacyAccessedAPITypeReasons: reasons,\n});\n\n/**\n * The required-reason APIs each package needs the app to declare, copied from\n * the package's own PrivacyInfo.xcprivacy (read from the SDK 58 versions the\n * starter installs). A package is matched when the app's package.json lists\n * it in `dependencies`. CocoaPods also merges these manifests into the app's\n * at `pod install` (React Native's privacy manifest aggregation); declaring\n * them here keeps the app's manifest whole when that is off, or for a pod\n * that doesn't ship one.\n *\n * - react-native 0.88 (`React/Resources`, `ReactCommon/cxxreact`,\n * `ReactCommon/react/timing` and the boost, glog and RCT-Folly podspecs):\n * FileTimestamp C617.1, UserDefaults CA92.1, SystemBootTime 35F9.1.\n * - expo 58, for what it always installs: expo-file-system (FileTimestamp\n * 0A2A.1 and 3B52.1, DiskSpace E174.1 and 85F4.1) and expo-constants\n * (UserDefaults CA92.1).\n * - expo-updates, through expo-eas-client: UserDefaults CA92.1.\n * - expo-application: FileTimestamp C617.1.\n * - expo-notifications: UserDefaults CA92.1.\n * - async-storage 2.2.0: FileTimestamp C617.1.\n *\n * - @sentry/react-native: UserDefaults CA92.1, SystemBootTime 35F9.1,\n * FileTimestamp C617.1, as Sentry's \"Apple Privacy Manifest\" guide for\n * React Native lists (sentry-cocoa ships in a pod, not in node_modules).\n *\n * Not listed, because their packages ship no required-reason API: expo-secure-store\n * (the Keychain is not one), expo-crypto, expo-haptics, expo-linking,\n * expo-apple-authentication, expo-router, netinfo, reanimated and the other\n * starter dependencies with no PrivacyInfo.xcprivacy.\n */\nexport const PRIVACY_APIS: Record<string, PrivacyApi[]> = {\n \"react-native\": [api(\"FileTimestamp\", \"C617.1\"), api(\"UserDefaults\", \"CA92.1\"), api(\"SystemBootTime\", \"35F9.1\")],\n expo: [api(\"FileTimestamp\", \"0A2A.1\", \"3B52.1\"), api(\"DiskSpace\", \"E174.1\", \"85F4.1\"), api(\"UserDefaults\", \"CA92.1\")],\n \"expo-updates\": [api(\"UserDefaults\", \"CA92.1\")],\n \"expo-application\": [api(\"FileTimestamp\", \"C617.1\")],\n \"expo-notifications\": [api(\"UserDefaults\", \"CA92.1\")],\n \"@react-native-async-storage/async-storage\": [api(\"FileTimestamp\", \"C617.1\")],\n \"@sentry/react-native\": [api(\"UserDefaults\", \"CA92.1\"), api(\"SystemBootTime\", \"35F9.1\"), api(\"FileTimestamp\", \"C617.1\")],\n};\n\n/** A Genesis block's collected data, and the packages that mean the app uses it. */\nexport interface PrivacyBlock {\n /** The block is on when the app's `dependencies` list every one of these. */\n packages: string[];\n collects: GenesisDataUse[];\n}\n\nconst appFunctionality = (type: string, ...more: string[]): GenesisDataUse => ({\n type,\n purposes: [\"app functionality\", ...more],\n linked: true,\n tracking: false,\n});\n\n/**\n * What each Genesis block collects, mirroring its `defineBlock`\n * `privacy.collects` (the blocks themselves are React Native code, which a\n * config plugin can't load). \"Collected\" is Apple's sense: sent off the\n * phone, to the app's own backend or a vendor. Purposes follow Apple's\n * definitions: crash and performance data that keep the app working are app\n * functionality (\"minimize app crashes, improve scalability and\n * performance\"); analytics is the typed product events.\n *\n * - `account` (`@marktiderman/genesis-supabase` `accountBlock`): the\n * sign-in email, the account id, and the name (Sign in with Apple's, or\n * one typed in).\n * - `observability` (`@marktiderman/genesis-native` `createObservability`\n * with `events`, reporting through Sentry): crash and performance data,\n * and the other diagnostic data Sentry sends with them (device and OS\n * details, breadcrumbs, sessions), the three Sentry's own privacy-manifest\n * guide lists; the user id; and the typed analytics events (product\n * interaction), all linked because the sink sets the user id. Found by\n * `@sentry/react-native`; an app that never sets a DSN sends nothing and\n * should leave this block out.\n * - `push` (`@marktiderman/genesis-native` `createPush`): the device's push\n * token against the person (a device-level id).\n * - `support` (`@marktiderman/genesis-support` `supportContributions`):\n * feedback and support requests the person sends, with their text, an\n * optional screenshot, the account id and basic device facts.\n *\n * Tests keep each entry equal to its block's own list.\n */\nexport const PRIVACY_BLOCKS: Record<string, PrivacyBlock> = {\n account: {\n packages: [\"@marktiderman/genesis-supabase\"],\n collects: [appFunctionality(\"email address\"), appFunctionality(\"user id\"), appFunctionality(\"name\")],\n },\n observability: {\n packages: [\"@marktiderman/genesis-native\", \"@sentry/react-native\"],\n collects: [\n appFunctionality(\"crash data\"),\n appFunctionality(\"performance data\"),\n appFunctionality(\"other diagnostic data\"),\n appFunctionality(\"user id\", \"analytics\"),\n { type: \"product interaction\", purposes: [\"analytics\"], linked: true, tracking: false },\n ],\n },\n push: {\n packages: [\"@marktiderman/genesis-native\", \"expo-notifications\"],\n collects: [appFunctionality(\"device ID\")],\n },\n support: {\n packages: [\"@marktiderman/genesis-support\"],\n collects: [\n appFunctionality(\"user id\"),\n appFunctionality(\"customer support\"),\n appFunctionality(\"other user content\"),\n appFunctionality(\"photos or videos\"),\n appFunctionality(\"other diagnostic data\"),\n ],\n },\n};\n\n/** The variant from options, else `APP_VARIANT`, else production. An unknown value throws. */\nexport function resolveVariant(given?: string): AppVariant {\n const value = given ?? process.env.APP_VARIANT ?? \"production\";\n if (!(APP_VARIANTS as readonly string[]).includes(value)) {\n throw new GenesisConfigError(`APP_VARIANT is \"${value}\"; expected one of ${APP_VARIANTS.join(\", \")}`);\n }\n return value as AppVariant;\n}\n\nexport function applyVariant(config: ExpoConfig, variant: AppVariant, options: WithGenesisOptions[\"variants\"] = {}): ExpoConfig {\n if (variant === \"production\") return config;\n const suffix = { ...DEFAULT_VARIANT_SUFFIXES[variant], ...options[variant] };\n // A value that already ends in the suffix was suffixed by an earlier run: leave it.\n const add = (value: string, end: string) => (end && value.endsWith(end) ? value : value + end);\n const next: ExpoConfig = { ...config, name: add(config.name, suffix.name) };\n if (config.ios?.bundleIdentifier) next.ios = { ...config.ios, bundleIdentifier: add(config.ios.bundleIdentifier, suffix.id) };\n if (config.android?.package) next.android = { ...config.android, package: add(config.android.package, suffix.id) };\n // Every build registering the same scheme would let a link open the wrong one. Production keeps the base.\n if (typeof config.scheme === \"string\") next.scheme = add(config.scheme, suffix.scheme);\n else if (Array.isArray(config.scheme)) next.scheme = config.scheme.map((scheme) => add(scheme, suffix.scheme));\n return next;\n}\n\nexport function applyLinks(config: ExpoConfig, links: GenesisLinks | undefined): ExpoConfig {\n if (!links) return config;\n const services = links.webcredentials === false ? [\"applinks\"] : [\"applinks\", \"webcredentials\"];\n const domains = links.hosts.flatMap((host) => services.map((service) => `${service}:${host}`));\n const associatedDomains = union(config.ios?.associatedDomains ?? [], domains);\n\n const data = links.hosts.flatMap((host) =>\n links.paths?.length ? links.paths.map((pathPrefix) => ({ scheme: \"https\", host, pathPrefix })) : [{ scheme: \"https\", host }],\n );\n const filter = { action: \"VIEW\", autoVerify: true, data, category: [\"BROWSABLE\", \"DEFAULT\"] };\n const existing = config.android?.intentFilters ?? [];\n const intentFilters = existing.some((f) => JSON.stringify(f) === JSON.stringify(filter)) ? existing : [...existing, filter];\n\n return {\n ...config,\n ios: { ...config.ios, associatedDomains },\n android: { ...config.android, intentFilters },\n };\n}\n\n/** The required-reason APIs for the packages listed in package.json `dependencies`. */\nexport function privacyApisFor(dependencies: Record<string, unknown>): PrivacyApi[] {\n return Object.keys(PRIVACY_APIS)\n .filter((pkg) => pkg in dependencies)\n .flatMap((pkg) => PRIVACY_APIS[pkg]!);\n}\n\n/** Merge required-reason APIs into `ios.privacyManifests`, keeping every entry and reason the app declares. */\nexport function applyPrivacyApis(config: ExpoConfig, apis: PrivacyApi[]): ExpoConfig {\n if (apis.length === 0) return config;\n const manifests = config.ios?.privacyManifests ?? {};\n const types = (manifests.NSPrivacyAccessedAPITypes ?? []).map((t) => ({ ...t, NSPrivacyAccessedAPITypeReasons: [...t.NSPrivacyAccessedAPITypeReasons] }));\n for (const api of apis) {\n const found = types.find((t) => t.NSPrivacyAccessedAPIType === api.NSPrivacyAccessedAPIType);\n if (found) found.NSPrivacyAccessedAPITypeReasons = union(found.NSPrivacyAccessedAPITypeReasons, api.NSPrivacyAccessedAPITypeReasons);\n else types.push({ ...api, NSPrivacyAccessedAPITypeReasons: [...api.NSPrivacyAccessedAPITypeReasons] });\n }\n return { ...config, ios: { ...config.ios, privacyManifests: { ...manifests, NSPrivacyAccessedAPITypes: types } } };\n}\n\n/** The Genesis blocks whose packages are all in `dependencies`. */\nexport function privacyBlocksFor(dependencies: Record<string, unknown>): string[] {\n return Object.keys(PRIVACY_BLOCKS).filter((id) => PRIVACY_BLOCKS[id]!.packages.every((pkg) => pkg in dependencies));\n}\n\n/**\n * The data the app collects: `privacy.collects` when given, else the union of\n * the blocks' (`privacy.blocks`, else those found in `dependencies`). A type\n * two blocks collect appears once, with every purpose either gives, linked or\n * tracking if either says so. An unknown block id throws.\n */\nexport function collectedDataFor(privacy: GenesisPrivacy, dependencies: Record<string, unknown>): GenesisDataUse[] {\n if (privacy.collects) return mergeDataUses(privacy.collects);\n const blocks = privacy.blocks ?? privacyBlocksFor(dependencies);\n const unknown = blocks.filter((id) => !(id in PRIVACY_BLOCKS));\n if (unknown.length) {\n throw new GenesisConfigError(`privacy.blocks: ${unknown.map((id) => `\"${id}\"`).join(\", \")} not one of ${Object.keys(PRIVACY_BLOCKS).join(\", \")}; list other data in privacy.collects`);\n }\n return mergeDataUses(blocks.flatMap((id) => PRIVACY_BLOCKS[id]!.collects));\n}\n\nfunction mergeDataUses(uses: readonly GenesisDataUse[]): GenesisDataUse[] {\n const byType = new Map<string, GenesisDataUse>();\n for (const use of uses) {\n // By Apple's type, so \"user ID\" and \"user id\" are one entry.\n const key = privacyDataType(use.type) ?? use.type;\n const seen = byType.get(key);\n byType.set(\n key,\n seen\n ? { type: use.type, purposes: union(seen.purposes, use.purposes), linked: seen.linked || use.linked, tracking: seen.tracking || use.tracking }\n : { ...use, purposes: [...use.purposes] },\n );\n }\n return [...byType.values()];\n}\n\n/**\n * Write the collected data types and `NSPrivacyTracking` into\n * `ios.privacyManifests`. The app's own entries win: a type it already lists\n * is left as it wrote it, and an `NSPrivacyTracking` it set stays. Tracking\n * defaults to whether any entry tracks; an entry that tracks with tracking\n * set false throws, since the manifest would contradict itself.\n */\nexport function applyPrivacyData(config: ExpoConfig, uses: GenesisDataUse[], tracking?: boolean): ExpoConfig {\n const manifests = config.ios?.privacyManifests ?? {};\n if (tracking !== undefined && manifests.NSPrivacyTracking !== undefined && tracking !== manifests.NSPrivacyTracking) {\n throw new GenesisConfigError(`privacy.tracking is ${tracking} but app.config sets ios.privacyManifests.NSPrivacyTracking to ${manifests.NSPrivacyTracking}; set it in one place`);\n }\n const tracks = uses.some((u) => u.tracking);\n const NSPrivacyTracking = manifests.NSPrivacyTracking ?? tracking ?? tracks;\n if (tracks && NSPrivacyTracking === false) {\n const which = uses.filter((u) => u.tracking).map((u) => u.type);\n throw new GenesisConfigError(`privacy: ${which.join(\", \")} is used for tracking but NSPrivacyTracking is false; set privacy.tracking to true and list NSPrivacyTrackingDomains`);\n }\n const existing = (manifests.NSPrivacyCollectedDataTypes ?? []).map((t) => ({ ...t, NSPrivacyCollectedDataTypePurposes: [...t.NSPrivacyCollectedDataTypePurposes] }));\n const listed = new Set(existing.map((t) => t.NSPrivacyCollectedDataType));\n const added = uses\n .map((u) => ({\n NSPrivacyCollectedDataType: privacyDataType(u.type)!,\n NSPrivacyCollectedDataTypeLinked: u.linked,\n NSPrivacyCollectedDataTypeTracking: u.tracking,\n NSPrivacyCollectedDataTypePurposes: u.purposes.map((p) => PRIVACY_PURPOSES[p]!),\n }))\n .filter((t) => !listed.has(t.NSPrivacyCollectedDataType));\n return {\n ...config,\n ios: { ...config.ios, privacyManifests: { ...manifests, NSPrivacyTracking, NSPrivacyCollectedDataTypes: [...existing, ...added] } },\n };\n}\n\nexport function applyExportCompliance(config: ExpoConfig): ExpoConfig {\n if (config.ios?.config?.usesNonExemptEncryption !== undefined) return config;\n return { ...config, ios: { ...config.ios, config: { ...config.ios?.config, usesNonExemptEncryption: false } } };\n}\n\nexport function applyFingerprint(config: ExpoConfig): ExpoConfig {\n if (config.runtimeVersion !== undefined || config.ios?.runtimeVersion !== undefined || config.android?.runtimeVersion !== undefined) {\n return config;\n }\n return { ...config, runtimeVersion: { policy: \"fingerprint\" } };\n}\n\n/** The Genesis config plugin. Use it in `plugins` or call it directly in app.config.ts. */\nexport const withGenesis: ConfigPlugin<WithGenesisOptions | void> = (config, props) => {\n const options = props ?? {};\n const root = options.projectRoot ?? (config as { _internal?: { projectRoot?: string } })._internal?.projectRoot ?? process.cwd();\n let next = applyVariant(config, resolveVariant(options.variant), options.variants);\n const file = options.links !== false || options.privacyManifest !== false ? readGenesisConfig(root) : null;\n if (options.links !== false) next = applyLinks(next, file?.links);\n if (options.privacyManifest !== false) {\n const dependencies = readDependencies(root);\n const privacy = { ...file?.privacy, ...(options.privacy ? validatePrivacy(options.privacy, \"withGenesis({ privacy })\") : {}) };\n next = applyPrivacyApis(next, privacyApisFor(dependencies));\n if (!privacy.blocks && !privacy.collects && !config.ios?.privacyManifests?.NSPrivacyCollectedDataTypes) {\n // Not a throw: the default is right for an app that is only Genesis blocks. Loud, because\n // anything else the app sends is missing from it.\n console.warn(\n `[genesis] privacy manifest: collected data types are only those of the Genesis blocks found in package.json (${privacyBlocksFor(dependencies).join(\", \") || \"none\"}). If the app sends anything else, list everything it collects in genesis.config.json privacy.collects; to keep this list, set privacy.blocks.`,\n );\n }\n next = applyPrivacyData(next, collectedDataFor(privacy, dependencies), privacy.tracking);\n }\n if (options.exportCompliance !== false) next = applyExportCompliance(next);\n if (options.fingerprint !== false) next = applyFingerprint(next);\n return next;\n};\n\nexport default withGenesis;\n\nfunction readDependencies(root: string): Record<string, unknown> {\n const file = path.join(root, \"package.json\");\n if (!existsSync(file)) return {};\n try {\n const deps = JSON.parse(readFileSync(file, \"utf8\"))?.dependencies;\n return deps && typeof deps === \"object\" ? deps : {};\n } catch (err) {\n throw new GenesisConfigError(`${file} is not valid JSON: ${(err as Error).message}`);\n }\n}\n\nfunction union(a: string[], b: string[]): string[] {\n return [...new Set([...a, ...b])];\n}\n"]}
1
+ {"version":3,"sources":["../src/doctor/config.ts","../src/expo.ts"],"names":["api","path2","existsSync","readFileSync"],"mappings":";;;;AAcO,IAAM,kBAAA,GAAN,cAAiC,KAAA,CAAM;AAAA,EACnC,IAAA,GAAO,oBAAA;AAClB;AAEO,IAAM,iBAAA,GAAN,cAAgC,kBAAA,CAAmB;AAAA,EAC/C,IAAA,GAAO,mBAAA;AAClB,CAAA;AAoBO,IAAM,kBAAA,GAAuD;AAAA,EAClE,IAAA,EAAM,gCAAA;AAAA,EACN,eAAA,EAAiB,wCAAA;AAAA,EACjB,c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AAO,IAAA,GAAO,sBAAsB,IAAI,CAAA;AACzE,EAAA,IAAI,OAAA,CAAQ,WAAA,KAAgB,KAAA,EAAO,IAAA,GAAO,iBAAiB,IAAI,CAAA;AAC/D,EAAA,OAAO,IAAA;AACT;AAEA,IAAO,YAAA,GAAQ;AAEf,SAAS,iBAAiB,IAAA,EAAuC;AAC/D,EAAA,MAAM,IAAA,GAAYC,IAAA,CAAA,IAAA,CAAK,IAAA,EAAM,cAAc,CAAA;AAC3C,EAAA,IAAI,CAACC,UAAAA,CAAW,IAAI,CAAA,SAAU,EAAC;AAC/B,EAAA,IAAI;AACF,IAAA,MAAM,OAAO,IAAA,CAAK,KAAA,CAAMC,aAAa,IAAA,EAAM,MAAM,CAAC,CAAA,EAAG,YAAA;AACrD,IAAA,OAAO,IAAA,IAAQ,OAAO,IAAA,KAAS,QAAA,GAAW,OAAO,EAAC;AAAA,EACpD,SAAS,GAAA,EAAK;AACZ,IAAA,MAAM,IAAI,kBAAA,CAAmB,CAAA,EAAG,IAAI,CAAA,oBAAA,EAAwB,GAAA,CAAc,OAAO,CAAA,CAAE,CAAA;AAAA,EACrF;AACF;AAEA,SAAS,KAAA,CAAM,GAAa,CAAA,EAAuB;AACjD,EAAA,OAAO,CAAC,mBAAG,IAAI,GAAA,CAAI,CAAC,GAAG,CAAA,EAAG,GAAG,CAAC,CAAC,CAAC,CAAA;AAClC","file":"expo.js","sourcesContent":["/**\n * Finds and validates the app's genesis.config.json.\n *\n * The doctor's lookup order: `--config <path>`, then `genesis.config.json`\n * in the app root, then the `genesis` key of package.json. Either file holds\n * the settings under `doctor`, beside other blocks: `features` (read by\n * `genesis features`) and `links` (validated here, read by the Expo config\n * plugin).\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { DoctorConfig } from \"./types.js\";\n\n/** A genesis.config.json that can't be read or has a block of the wrong shape. */\nexport class GenesisConfigError extends Error {\n override name = \"GenesisConfigError\";\n}\n\nexport class DoctorConfigError extends GenesisConfigError {\n override name = \"DoctorConfigError\";\n}\n\n/** The `links` block: the web hosts (and optional path prefixes) the app opens as universal / app links. */\nexport interface GenesisLinks {\n /** Bare host names, such as `example.com` or `app.example.com`: no scheme, path or port. */\n hosts: string[];\n /** Path prefixes the app handles, each starting with `/`. Default: every path. */\n paths?: string[];\n /** Also add `webcredentials:` domains (password autofill). Default true. */\n webcredentials?: boolean;\n}\n\n/**\n * Apple's collected data types (`NSPrivacyCollectedDataType`), every one in\n * Apple's reference, keyed by the stores' own words, lower case, as Genesis\n * blocks name them in `privacy.collects`. Look one up with\n * {@link privacyDataType}, which ignores case (blocks write `\"device ID\"`,\n * `\"user ID\"`). The values are Apple's exact strings, `PhotosorVideos`\n * included.\n */\nexport const PRIVACY_DATA_TYPES: Readonly<Record<string, string>> = {\n name: \"NSPrivacyCollectedDataTypeName\",\n \"email address\": \"NSPrivacyCollectedDataTypeEmailAddress\",\n \"phone number\": \"NSPrivacyCollectedDataTypePhoneNumber\",\n \"physical address\": \"NSPrivacyCollectedDataTypePhysicalAddress\",\n \"other user contact info\": \"NSPrivacyCollectedDataTypeOtherUserContactInfo\",\n health: \"NSPrivacyCollectedDataTypeHealth\",\n fitness: \"NSPrivacyCollectedDataTypeFitness\",\n \"payment info\": \"NSPrivacyCollectedDataTypePaymentInfo\",\n \"credit info\": \"NSPrivacyCollectedDataTypeCreditInfo\",\n \"other financial info\": \"NSPrivacyCollectedDataTypeOtherFinancialInfo\",\n \"precise location\": \"NSPrivacyCollectedDataTypePreciseLocation\",\n \"coarse location\": \"NSPrivacyCollectedDataTypeCoarseLocation\",\n \"sensitive info\": \"NSPrivacyCollectedDataTypeSensitiveInfo\",\n contacts: \"NSPrivacyCollectedDataTypeContacts\",\n \"emails or text messages\": \"NSPrivacyCollectedDataTypeEmailsOrTextMessages\",\n \"photos or videos\": \"NSPrivacyCollectedDataTypePhotosorVideos\",\n \"audio data\": \"NSPrivacyCollectedDataTypeAudioData\",\n \"gameplay content\": \"NSPrivacyCollectedDataTypeGameplayContent\",\n \"customer support\": \"NSPrivacyCollectedDataTypeCustomerSupport\",\n \"other user content\": \"NSPrivacyCollectedDataTypeOtherUserContent\",\n \"browsing history\": \"NSPrivacyCollectedDataTypeBrowsingHistory\",\n \"search history\": \"NSPrivacyCollectedDataTypeSearchHistory\",\n \"user id\": \"NSPrivacyCollectedDataTypeUserID\",\n \"device id\": \"NSPrivacyCollectedDataTypeDeviceID\",\n \"purchase history\": \"NSPrivacyCollectedDataTypePurchaseHistory\",\n \"product interaction\": \"NSPrivacyCollectedDataTypeProductInteraction\",\n \"advertising data\": \"NSPrivacyCollectedDataTypeAdvertisingData\",\n \"other usage data\": \"NSPrivacyCollectedDataTypeOtherUsageData\",\n \"crash data\": \"NSPrivacyCollectedDataTypeCrashData\",\n \"performance data\": \"NSPrivacyCollectedDataTypePerformanceData\",\n \"other diagnostic data\": \"NSPrivacyCollectedDataTypeOtherDiagnosticData\",\n \"environment scanning\": \"NSPrivacyCollectedDataTypeEnvironmentScanning\",\n hands: \"NSPrivacyCollectedDataTypeHands\",\n head: \"NSPrivacyCollectedDataTypeHead\",\n \"other data types\": \"NSPrivacyCollectedDataTypeOtherDataTypes\",\n};\n\n/** Apple's string for a data type in the stores' words, whatever its case, or undefined. */\nexport function privacyDataType(type: string): string | undefined {\n return PRIVACY_DATA_TYPES[type.toLowerCase()];\n}\n\n/** Apple's collection purposes (`NSPrivacyCollectedDataTypePurposes`), by the stores' words. */\nexport const PRIVACY_PURPOSES: Readonly<Record<string, string>> = {\n \"app functionality\": \"NSPrivacyCollectedDataTypePurposeAppFunctionality\",\n analytics: \"NSPrivacyCollectedDataTypePurposeAnalytics\",\n \"product personalization\": \"NSPrivacyCollectedDataTypePurposeProductPersonalization\",\n \"developer advertising\": \"NSPrivacyCollectedDataTypePurposeDeveloperAdvertising\",\n \"third-party advertising\": \"NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising\",\n other: \"NSPrivacyCollectedDataTypePurposeOther\",\n};\n\n/** One kind of data the app collects, as a Genesis block's `privacy.collects` entry says it. */\nexport interface GenesisDataUse {\n /** A key of {@link PRIVACY_DATA_TYPES}: `\"email address\"`, `\"user id\"`, `\"crash data\"`… */\n type: string;\n /** Keys of {@link PRIVACY_PURPOSES}: `\"app functionality\"`, `\"analytics\"`… */\n purposes: string[];\n /** Tied to the person's identity. */\n linked: boolean;\n /** Used to track the person across other companies' apps and websites. */\n tracking: boolean;\n}\n\n/**\n * The `privacy` block: what goes in the iOS privacy manifest's collected data\n * types. Left out, the Genesis blocks the app's packages carry decide.\n */\nexport interface GenesisPrivacy {\n /** The Genesis blocks whose data the app sends anywhere (`account`, `observability`, `push`). Default: found from package.json. */\n blocks?: string[];\n /** Every kind of data the app collects. Replaces what the blocks give, so list everything. */\n collects?: GenesisDataUse[];\n /** `NSPrivacyTracking`. Default false; true needs `NSPrivacyTrackingDomains` in app.config. */\n tracking?: boolean;\n}\n\n/** genesis.config.json, parsed, with its shared blocks validated. */\nexport interface GenesisConfigFile {\n /** The whole parsed file, for blocks other readers own (`doctor`, `features`). */\n raw: Record<string, unknown>;\n links?: GenesisLinks;\n privacy?: GenesisPrivacy;\n}\n\nexport interface LoadedConfig {\n config: DoctorConfig;\n /** The file it came from, or null when no config exists (defaults apply). */\n file: string | null;\n /** Folder that relative plugin paths resolve against. */\n dir: string;\n}\n\nconst STRING_LISTS = [\"src\", \"extensions\", \"ignore\", \"tokenFiles\", \"ignoreTokenPrefixes\", \"localPrimitiveDirs\", \"build\", \"componentPackages\"] as const;\nconst STRINGS = [\"uiPackage\", \"rulesDoc\"] as const;\nconst KNOWN = new Set<string>([\n ...STRING_LISTS,\n ...STRINGS,\n \"themeCss\",\n \"rawTags\",\n \"forbiddenImports\",\n \"rules\",\n \"allow\",\n \"patterns\",\n \"plugins\",\n \"packs\",\n \"native\",\n \"supabase\",\n \"packages\",\n \"routesDir\",\n \"$schema\",\n \"$comment\",\n]);\nconst LEVELS = new Set([\"error\", \"warn\", \"info\", \"off\"]);\nconst PATTERN_KEYS = new Set([\"id\", \"level\", \"files\", \"exclude\", \"forbid\", \"require\", \"path\", \"message\"]);\nconst PACKS = new Set([\"native\", \"supabase\", \"packages\"]);\n/** Each pack's settings: key → \"string\", \"path\" (app-relative folder, normalized) or \"list\". */\nconst PACK_KEYS: Record<string, Record<string, \"string\" | \"path\" | \"list\">> = {\n native: { routerRoot: \"path\" },\n supabase: { migrations: \"path\", base: \"string\", exposedSchemas: \"list\", since: \"string\" },\n packages: { base: \"string\" },\n};\n\n/** An app-relative folder in POSIX form (`./app/` → `app`); absolute paths and paths leaving the app are rejected. */\nfunction appPath(v: unknown, where: string, fail: (msg: string) => never): string {\n if (typeof v !== \"string\" || !v.trim()) return fail(`${where} must be a non-empty path`);\n if (path.isAbsolute(v) || /^[A-Za-z]:[\\\\/]/.test(v)) fail(`${where} must be relative to the app, not absolute (\"${v}\")`);\n const norm = path.posix.normalize(v.replace(/\\\\/g, \"/\")).replace(/\\/+$/, \"\");\n if (norm === \".\" || norm === \"..\" || norm.startsWith(\"../\")) fail(`${where} must be a folder inside the app (\"${v}\")`);\n return norm;\n}\n\nexport function loadConfig(root: string, configPath?: string): LoadedConfig {\n if (configPath) {\n const file = path.resolve(root, configPath);\n if (!existsSync(file)) throw new DoctorConfigError(`Config file not found: ${configPath}`);\n const json = readJson(file);\n // An explicit file may hold the block at the top level or under `doctor`\n // (or, for a package.json, under `genesis.doctor`).\n const block = path.basename(file) === \"package.json\" ? json?.genesis?.doctor : json?.doctor ?? json;\n return { config: validateConfig(block ?? {}, file), file, dir: path.dirname(file) };\n }\n const own = path.join(root, \"genesis.config.json\");\n if (existsSync(own)) {\n const block = readGenesisConfig(root)?.raw.doctor;\n return { config: validateConfig(block ?? {}, own), file: own, dir: root };\n }\n const pkg = path.join(root, \"package.json\");\n if (existsSync(pkg)) {\n const block = readJson(pkg)?.genesis?.doctor;\n if (block !== undefined) return { config: validateConfig(block, pkg), file: pkg, dir: root };\n }\n return { config: {}, file: null, dir: root };\n}\n\nfunction readJson(file: string) {\n try {\n return JSON.parse(readFileSync(file, \"utf8\"));\n } catch (err) {\n throw new DoctorConfigError(`${file} is not valid JSON: ${(err as Error).message}`);\n }\n}\n\n/**\n * Reads `<root>/genesis.config.json` and validates its shared blocks (today:\n * `links` and `privacy`). Returns null when the file doesn't exist; throws a\n * GenesisConfigError naming the file when it isn't valid.\n */\nexport function readGenesisConfig(root: string): GenesisConfigFile | null {\n const file = path.join(root, \"genesis.config.json\");\n if (!existsSync(file)) return null;\n const raw: unknown = readJson(file);\n if (!isObject(raw)) throw new GenesisConfigError(`${file}: the config must be a JSON object`);\n const out: GenesisConfigFile = { raw };\n if (raw.links !== undefined) out.links = validateLinks(raw.links, file);\n if (raw.privacy !== undefined) out.privacy = validatePrivacy(raw.privacy, file);\n // localPackages is read and validated by blocks/local.ts where it's used (doctor, add, migrate);\n // the Expo config plugin loads this file too and must not pull the CLI's block code in.\n return out;\n}\n\nconst PRIVACY_KEYS = new Set([\"blocks\", \"collects\", \"tracking\"]);\nconst DATA_USE_KEYS = new Set([\"type\", \"purposes\", \"linked\", \"tracking\"]);\n\n/**\n * Check a `privacy` block (genesis.config.json's, or the plugin's `privacy`\n * option): a misspelt data type or purpose fails the build, since Xcode's\n * privacy report ignores values it doesn't know.\n */\nexport function validatePrivacy(raw: unknown, source = \"config\"): GenesisPrivacy {\n const fail = (msg: string): never => {\n throw new GenesisConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(`\"privacy\" must be an object`);\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!PRIVACY_KEYS.has(key)) fail(`privacy: unknown setting \"${key}\"`);\n const out: GenesisPrivacy = {};\n if (c.blocks !== undefined) {\n if (!isStringList(c.blocks)) fail(`privacy.blocks must be a list of block ids`);\n out.blocks = [...new Set(c.blocks as string[])];\n }\n if (c.tracking !== undefined) {\n if (typeof c.tracking !== \"boolean\") fail(`privacy.tracking must be true or false`);\n out.tracking = c.tracking as boolean;\n }\n if (c.collects !== undefined) {\n if (!Array.isArray(c.collects)) fail(`privacy.collects must be a list`);\n out.collects = (c.collects as unknown[]).map((entry, i) => {\n const where = `privacy.collects[${i}]`;\n if (!isObject(entry)) return fail(`${where} must be an object`);\n for (const key of Object.keys(entry)) if (!DATA_USE_KEYS.has(key)) fail(`${where}: unknown setting \"${key}\"`);\n if (typeof entry.type !== \"string\" || !privacyDataType(entry.type)) {\n fail(`${where}.type \"${String(entry.type)}\" is not one of ${Object.keys(PRIVACY_DATA_TYPES).join(\", \")}`);\n }\n if (!isStringList(entry.purposes) || entry.purposes.length === 0) fail(`${where}.purposes must be a non-empty list`);\n for (const p of entry.purposes as string[]) {\n if (!(p in PRIVACY_PURPOSES)) fail(`${where}.purposes: \"${p}\" is not one of ${Object.keys(PRIVACY_PURPOSES).join(\", \")}`);\n }\n if (typeof entry.linked !== \"boolean\") fail(`${where}.linked must be true or false`);\n if (typeof entry.tracking !== \"boolean\") fail(`${where}.tracking must be true or false`);\n return { type: entry.type as string, purposes: [...new Set(entry.purposes as string[])], linked: entry.linked as boolean, tracking: entry.tracking as boolean };\n });\n }\n return out;\n}\n\nconst LINK_KEYS = new Set([\"hosts\", \"paths\", \"webcredentials\"]);\nconst HOST = /^(?=.{1,253}$)(\\*\\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$/;\n\n/** Check the `links` block, so a typo'd host fails the build instead of shipping links that never open. */\nexport function validateLinks(raw: unknown, source = \"config\"): GenesisLinks {\n const fail = (msg: string): never => {\n throw new GenesisConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(`\"links\" must be an object`);\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!LINK_KEYS.has(key)) fail(`links: unknown setting \"${key}\"`);\n if (!isStringList(c.hosts) || c.hosts.length === 0) fail(`links.hosts must be a non-empty list of host names`);\n for (const host of c.hosts as string[]) {\n if (!HOST.test(host)) {\n fail(`links.hosts: \"${host}\" is not a bare lower-case host name (no scheme, path or port), e.g. \"example.com\"`);\n }\n }\n if (c.paths !== undefined) {\n if (!isStringList(c.paths)) fail(`links.paths must be a list of path prefixes`);\n for (const p of c.paths as string[]) {\n if (!p.startsWith(\"/\") || /[\\s?#*]/.test(p)) {\n fail(`links.paths: \"${p}\" must start with \"/\" and hold no spaces, \"?\", \"#\" or \"*\"`);\n }\n }\n }\n if (c.webcredentials !== undefined && typeof c.webcredentials !== \"boolean\") fail(`links.webcredentials must be true or false`);\n const links: GenesisLinks = { hosts: [...new Set(c.hosts as string[])] };\n if (c.paths !== undefined) links.paths = [...new Set(c.paths as string[])];\n if (c.webcredentials !== undefined) links.webcredentials = c.webcredentials as boolean;\n return links;\n}\n\n/** Check the shape, so a typo fails loudly instead of silently disabling a check. */\nexport function validateConfig(raw: unknown, source = \"config\"): DoctorConfig {\n const fail = (msg: string): never => {\n throw new DoctorConfigError(`${source}: ${msg}`);\n };\n if (!isObject(raw)) fail(\"the doctor settings must be an object\");\n const c = raw as Record<string, unknown>;\n for (const key of Object.keys(c)) if (!KNOWN.has(key)) fail(`unknown setting \"${key}\"`);\n // themeCss takes one stylesheet or several; normalize to a list.\n if (typeof c.themeCss === \"string\") c.themeCss = [c.themeCss];\n if (c.themeCss !== undefined && !isStringList(c.themeCss)) fail(`\"themeCss\" must be a path or a list of paths`);\n for (const key of STRING_LISTS) {\n if (c[key] !== undefined && !isStringList(c[key])) fail(`\"${key}\" must be a list of strings`);\n }\n for (const key of STRINGS) {\n if (c[key] !== undefined && typeof c[key] !== \"string\") fail(`\"${key}\" must be a string`);\n }\n if (c.routesDir !== undefined) c.routesDir = appPath(c.routesDir, `\"routesDir\"`, fail);\n if (c.rawTags !== undefined) {\n if (!isObject(c.rawTags)) fail(`\"rawTags\" must be an object`);\n for (const [tag, v] of Object.entries(c.rawTags as object)) {\n if (!/^[a-z][a-z0-9-]*$/.test(tag)) fail(`rawTags: \"${tag}\" is not an HTML tag name`);\n if (v !== false && typeof v !== \"string\") fail(`rawTags.${tag} must be a component name or false`);\n }\n }\n if (c.forbiddenImports !== undefined) {\n if (!isObject(c.forbiddenImports)) fail(`\"forbiddenImports\" must be an object of pattern → message`);\n for (const [re, msg] of Object.entries(c.forbiddenImports as object)) {\n if (typeof msg !== \"string\") fail(`forbiddenImports[\"${re}\"] must be a message string`);\n checkRegExp(re, `forbiddenImports[\"${re}\"]`, fail);\n }\n }\n if (c.rules !== undefined) {\n if (!isObject(c.rules)) fail(`\"rules\" must be an object of rule → level`);\n for (const [rule, level] of Object.entries(c.rules as object)) {\n if (!LEVELS.has(level as string)) fail(`rules.${rule} must be \"error\", \"warn\", \"info\" or \"off\"`);\n }\n }\n if (c.allow !== undefined) {\n if (!Array.isArray(c.allow)) fail(`\"allow\" must be a list`);\n (c.allow as unknown[]).forEach((e, i) => {\n if (!isObject(e)) return fail(`allow[${i}] must be an object`);\n const entry = e as Record<string, unknown>;\n if (typeof entry.rule !== \"string\" || !entry.rule) fail(`allow[${i}] needs a \"rule\"`);\n if (typeof entry.reason !== \"string\" || !entry.reason.trim()) fail(`allow[${i}] (${entry.rule}) needs a \"reason\"`);\n for (const k of [\"file\", \"match\"]) {\n if (entry[k] !== undefined && typeof entry[k] !== \"string\") fail(`allow[${i}].${k} must be a string`);\n }\n });\n }\n if (c.patterns !== undefined) {\n if (!Array.isArray(c.patterns)) fail(`\"patterns\" must be a list`);\n (c.patterns as unknown[]).forEach((p, i) => {\n if (!isObject(p)) return fail(`patterns[${i}] must be an object`);\n const rule = p as Record<string, unknown>;\n for (const k of Object.keys(rule)) if (!PATTERN_KEYS.has(k)) fail(`patterns[${i}]: unknown key \"${k}\"`);\n if (typeof rule.id !== \"string\" || !rule.id) fail(`patterns[${i}] needs an \"id\"`);\n for (const k of [\"files\", \"exclude\"]) {\n if (rule[k] !== undefined && !isStringList(rule[k])) fail(`patterns[${i}].${k} must be a list of globs`);\n }\n });\n }\n if (c.packs !== undefined) {\n if (!isStringList(c.packs)) fail(`\"packs\" must be a list, e.g. [\"native\", \"supabase\"]`);\n for (const p of c.packs as string[]) if (!PACKS.has(p)) fail(`packs: unknown pack \"${p}\" (known: ${[...PACKS].join(\", \")})`);\n if (new Set(c.packs as string[]).size !== (c.packs as string[]).length) fail(`packs: lists a pack twice`);\n }\n for (const [pack, keys] of Object.entries(PACK_KEYS)) {\n const block = c[pack];\n if (block === undefined) continue;\n if (!isObject(block)) fail(`\"${pack}\" must be an object`);\n if (!((c.packs as string[] | undefined) ?? []).includes(pack)) fail(`\"${pack}\" settings are set but the ${pack} pack is not in \"packs\"`);\n for (const [k, v] of Object.entries(block as object)) {\n const want = keys[k];\n if (!want) fail(`${pack}: unknown setting \"${k}\"`);\n if (want === \"string\" && typeof v !== \"string\") fail(`${pack}.${k} must be a string`);\n if (want === \"list\" && !isStringList(v)) fail(`${pack}.${k} must be a list of strings`);\n if (want === \"string\" && !(v as string).trim()) fail(`${pack}.${k} must not be empty`);\n if (want === \"path\") (block as Record<string, unknown>)[k] = appPath(v, `${pack}.${k}`, fail);\n }\n }\n // Schema names compare lowercased, like the SQL they're matched against.\n const supa = c.supabase as Record<string, unknown> | undefined;\n if (Array.isArray(supa?.exposedSchemas)) supa.exposedSchemas = (supa.exposedSchemas as string[]).map((s) => s.toLowerCase());\n if (c.plugins !== undefined) {\n const ok =\n Array.isArray(c.plugins) &&\n c.plugins.every((p) => typeof p === \"string\" || (Array.isArray(p) && p.length === 2 && typeof p[0] === \"string\"));\n if (!ok) fail(`\"plugins\" must be a list of module paths or [path, options] pairs`);\n }\n return c as DoctorConfig;\n}\n\nexport function checkRegExp(source: string, where: string, fail: (msg: string) => never): void {\n try {\n new RegExp(source);\n } catch (err) {\n fail(`${where} is not a valid regular expression: ${(err as Error).message}`);\n }\n}\n\nfunction isObject(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\nfunction isStringList(v: unknown): v is string[] {\n return Array.isArray(v) && v.every((x) => typeof x === \"string\");\n}\n","/**\n * `withGenesis()` — the Genesis Expo config plugin.\n *\n * Keeps an app's `app.config.ts` to a name, ids and plugins. It sets:\n *\n * 1. App variants: `APP_VARIANT` (`development` | `preview` | `production`,\n * default `production`) suffixes the bundle id, Android package, name and\n * URL scheme, so the three builds install side by side and a\n * `scheme://` link opens the build it names, not whichever one iOS or\n * Android picks among apps that registered the same scheme.\n * 2. Universal / app links from genesis.config.json `links`:\n * `ios.associatedDomains` (`applinks:` and `webcredentials:`) and one\n * Android `intentFilters` entry with `autoVerify`.\n * 3. The iOS privacy manifest, merged into what the app declares: the\n * required-reason APIs of React Native, Expo and the packages the app's\n * package.json lists; `NSPrivacyTracking: false`; and the collected data\n * types, the union of what each Genesis block the app uses collects\n * (`account`, `observability`, `push`), or the app's own list from\n * genesis.config.json `privacy` or the plugin's `privacy` option.\n * 4. Export compliance: `ios.config.usesNonExemptEncryption = false`.\n * 5. `runtimeVersion: { policy: \"fingerprint\" }`.\n *\n * Anything the app already sets wins: the plugin fills gaps and appends to\n * lists, never overwrites or removes a value, and running it twice changes\n * nothing.\n *\n * Determinism: the plugin reads two committed files in the project root,\n * genesis.config.json and package.json, and one environment variable,\n * APP_VARIANT. No network, no clock, no other environment. The same commit\n * and variant always give the same config; the EAS fingerprint is stable only\n * if APP_VARIANT is set the same way for builds, `eas update` and fingerprint\n * checks (an EAS environment variable, not a build profile's `env`).\n */\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport type { ConfigPlugin } from \"@expo/config-plugins\";\nimport type { ExpoConfig } from \"@expo/config-types\";\nimport {\n GenesisConfigError,\n PRIVACY_PURPOSES,\n privacyDataType,\n readGenesisConfig,\n validatePrivacy,\n type GenesisDataUse,\n type GenesisLinks,\n type GenesisPrivacy,\n} from \"./doctor/config.js\";\n\nexport {\n GenesisConfigError,\n PRIVACY_DATA_TYPES,\n PRIVACY_PURPOSES,\n privacyDataType,\n validateLinks,\n validatePrivacy,\n readGenesisConfig,\n type GenesisDataUse,\n type GenesisLinks,\n type GenesisPrivacy,\n} from \"./doctor/config.js\";\n\nexport const APP_VARIANTS = [\"development\", \"preview\", \"production\"] as const;\nexport type AppVariant = (typeof APP_VARIANTS)[number];\n\nexport interface VariantSuffix {\n /** Appended to `ios.bundleIdentifier` and `android.package`, e.g. `.dev`. */\n id: string;\n /** Appended to `name`, e.g. ` (Dev)`. */\n name: string;\n /** Appended to each `scheme`, e.g. `-dev` (`myapp-dev://`). */\n scheme: string;\n}\n\n/** A required-reason API category and the reasons for it, as in PrivacyInfo.xcprivacy. */\nexport interface PrivacyApi {\n NSPrivacyAccessedAPIType: string;\n NSPrivacyAccessedAPITypeReasons: string[];\n}\n\nexport interface WithGenesisOptions {\n /**\n * The variant, overriding `APP_VARIANT`. Tests and scripts pass it; an app\n * leaves it out and sets `APP_VARIANT` per build profile in eas.json.\n */\n variant?: AppVariant;\n /** Suffixes per non-production variant. Default `.dev` / ` (Dev)` / `-dev` and `.preview` / ` (Preview)` / `-preview`. */\n variants?: Partial<Record<Exclude<AppVariant, \"production\">, Partial<VariantSuffix>>>;\n /** Where genesis.config.json and package.json live. Default: the Expo project root. */\n projectRoot?: string;\n /**\n * The manifest's collected data types, overriding genesis.config.json\n * `privacy` key by key (`blocks` here replaces the file's `blocks`; a\n * `collects` list, from either place, replaces every block's list). An app\n * passes `blocks` from its own feature switches, so a block turned off\n * declares nothing. Without `privacy` in either place, the blocks are found\n * from package.json and a warning says the app's own data isn't in the list.\n */\n privacy?: GenesisPrivacy;\n /** Turn single steps off. Every step is on by default. */\n links?: boolean;\n privacyManifest?: boolean;\n exportCompliance?: boolean;\n fingerprint?: boolean;\n}\n\nexport const DEFAULT_VARIANT_SUFFIXES: Record<Exclude<AppVariant, \"production\">, VariantSuffix> = {\n development: { id: \".dev\", name: \" (Dev)\", scheme: \"-dev\" },\n preview: { id: \".preview\", name: \" (Preview)\", scheme: \"-preview\" },\n};\n\nconst api = (category: string, ...reasons: string[]): PrivacyApi => ({\n NSPrivacyAccessedAPIType: `NSPrivacyAccessedAPICategory${category}`,\n NSPrivacyAccessedAPITypeReasons: reasons,\n});\n\n/**\n * The required-reason APIs each package needs the app to declare, copied from\n * the package's own PrivacyInfo.xcprivacy (read from the SDK 58 versions the\n * starter installs). A package is matched when the app's package.json lists\n * it in `dependencies`. CocoaPods also merges these manifests into the app's\n * at `pod install` (React Native's privacy manifest aggregation); declaring\n * them here keeps the app's manifest whole when that is off, or for a pod\n * that doesn't ship one.\n *\n * - react-native 0.88 (`React/Resources`, `ReactCommon/cxxreact`,\n * `ReactCommon/react/timing` and the boost, glog and RCT-Folly podspecs):\n * FileTimestamp C617.1, UserDefaults CA92.1, SystemBootTime 35F9.1.\n * - expo 58, for what it always installs: expo-file-system (FileTimestamp\n * 0A2A.1 and 3B52.1, DiskSpace E174.1 and 85F4.1) and expo-constants\n * (UserDefaults CA92.1).\n * - expo-updates, through expo-eas-client: UserDefaults CA92.1.\n * - expo-application: FileTimestamp C617.1.\n * - expo-notifications: UserDefaults CA92.1.\n * - async-storage 2.2.0: FileTimestamp C617.1.\n *\n * - @sentry/react-native: UserDefaults CA92.1, SystemBootTime 35F9.1,\n * FileTimestamp C617.1, as Sentry's \"Apple Privacy Manifest\" guide for\n * React Native lists (sentry-cocoa ships in a pod, not in node_modules).\n *\n * Not listed, because their packages ship no required-reason API: expo-secure-store\n * (the Keychain is not one), expo-crypto, expo-haptics, expo-linking,\n * expo-apple-authentication, expo-router, netinfo, reanimated and the other\n * starter dependencies with no PrivacyInfo.xcprivacy.\n */\nexport const PRIVACY_APIS: Record<string, PrivacyApi[]> = {\n \"react-native\": [api(\"FileTimestamp\", \"C617.1\"), api(\"UserDefaults\", \"CA92.1\"), api(\"SystemBootTime\", \"35F9.1\")],\n expo: [api(\"FileTimestamp\", \"0A2A.1\", \"3B52.1\"), api(\"DiskSpace\", \"E174.1\", \"85F4.1\"), api(\"UserDefaults\", \"CA92.1\")],\n \"expo-updates\": [api(\"UserDefaults\", \"CA92.1\")],\n \"expo-application\": [api(\"FileTimestamp\", \"C617.1\")],\n \"expo-notifications\": [api(\"UserDefaults\", \"CA92.1\")],\n \"@react-native-async-storage/async-storage\": [api(\"FileTimestamp\", \"C617.1\")],\n \"@sentry/react-native\": [api(\"UserDefaults\", \"CA92.1\"), api(\"SystemBootTime\", \"35F9.1\"), api(\"FileTimestamp\", \"C617.1\")],\n};\n\n/** A Genesis block's collected data, and the packages that mean the app uses it. */\nexport interface PrivacyBlock {\n /** The block is on when the app's `dependencies` list every one of these. */\n packages: string[];\n collects: GenesisDataUse[];\n}\n\nconst appFunctionality = (type: string, ...more: string[]): GenesisDataUse => ({\n type,\n purposes: [\"app functionality\", ...more],\n linked: true,\n tracking: false,\n});\n\n/**\n * What each Genesis block collects, mirroring its `defineBlock`\n * `privacy.collects` (the blocks themselves are React Native code, which a\n * config plugin can't load). \"Collected\" is Apple's sense: sent off the\n * phone, to the app's own backend or a vendor. Purposes follow Apple's\n * definitions: crash and performance data that keep the app working are app\n * functionality (\"minimize app crashes, improve scalability and\n * performance\"); analytics is the typed product events.\n *\n * - `account` (`@marktiderman/genesis-supabase` `accountBlock`): the\n * sign-in email, the account id, and the name (Sign in with Apple's, or\n * one typed in).\n * - `observability` (`@marktiderman/genesis-native` `createObservability`\n * with `events`, reporting through Sentry): crash and performance data,\n * and the other diagnostic data Sentry sends with them (device and OS\n * details, breadcrumbs, sessions), the three Sentry's own privacy-manifest\n * guide lists; the user id; and the typed analytics events (product\n * interaction), all linked because the sink sets the user id. Found by\n * `@sentry/react-native`; an app that never sets a DSN sends nothing and\n * should leave this block out.\n * - `push` (`@marktiderman/genesis-native` `createPush`): the device's push\n * token against the person (a device-level id).\n * - `support` (`@marktiderman/genesis-support` `supportContributions`):\n * feedback and support requests the person sends, with their text, an\n * optional screenshot, the account id and basic device facts.\n *\n * Tests keep each entry equal to its block's own list.\n */\nexport const PRIVACY_BLOCKS: Record<string, PrivacyBlock> = {\n account: {\n packages: [\"@marktiderman/genesis-supabase\"],\n collects: [appFunctionality(\"email address\"), appFunctionality(\"user id\"), appFunctionality(\"name\")],\n },\n observability: {\n packages: [\"@marktiderman/genesis-native\", \"@sentry/react-native\"],\n collects: [\n appFunctionality(\"crash data\"),\n appFunctionality(\"performance data\"),\n appFunctionality(\"other diagnostic data\"),\n appFunctionality(\"user id\", \"analytics\"),\n { type: \"product interaction\", purposes: [\"analytics\"], linked: true, tracking: false },\n ],\n },\n push: {\n packages: [\"@marktiderman/genesis-native\", \"expo-notifications\"],\n collects: [appFunctionality(\"device ID\")],\n },\n support: {\n packages: [\"@marktiderman/genesis-support\"],\n collects: [\n appFunctionality(\"user id\"),\n appFunctionality(\"customer support\"),\n appFunctionality(\"other user content\"),\n appFunctionality(\"photos or videos\"),\n appFunctionality(\"other diagnostic data\"),\n ],\n },\n};\n\n/** The variant from options, else `APP_VARIANT`, else production. An unknown value throws. */\nexport function resolveVariant(given?: string): AppVariant {\n const value = given ?? process.env.APP_VARIANT ?? \"production\";\n if (!(APP_VARIANTS as readonly string[]).includes(value)) {\n throw new GenesisConfigError(`APP_VARIANT is \"${value}\"; expected one of ${APP_VARIANTS.join(\", \")}`);\n }\n return value as AppVariant;\n}\n\nexport function applyVariant(config: ExpoConfig, variant: AppVariant, options: WithGenesisOptions[\"variants\"] = {}): ExpoConfig {\n if (variant === \"production\") return config;\n const suffix = { ...DEFAULT_VARIANT_SUFFIXES[variant], ...options[variant] };\n // A value that already ends in the suffix was suffixed by an earlier run: leave it.\n const add = (value: string, end: string) => (end && value.endsWith(end) ? value : value + end);\n const next: ExpoConfig = { ...config, name: add(config.name, suffix.name) };\n if (config.ios?.bundleIdentifier) next.ios = { ...config.ios, bundleIdentifier: add(config.ios.bundleIdentifier, suffix.id) };\n if (config.android?.package) next.android = { ...config.android, package: add(config.android.package, suffix.id) };\n // Every build registering the same scheme would let a link open the wrong one. Production keeps the base.\n if (typeof config.scheme === \"string\") next.scheme = add(config.scheme, suffix.scheme);\n else if (Array.isArray(config.scheme)) next.scheme = config.scheme.map((scheme) => add(scheme, suffix.scheme));\n return next;\n}\n\nexport function applyLinks(config: ExpoConfig, links: GenesisLinks | undefined): ExpoConfig {\n if (!links) return config;\n const services = links.webcredentials === false ? [\"applinks\"] : [\"applinks\", \"webcredentials\"];\n const domains = links.hosts.flatMap((host) => services.map((service) => `${service}:${host}`));\n const associatedDomains = union(config.ios?.associatedDomains ?? [], domains);\n\n const data = links.hosts.flatMap((host) =>\n links.paths?.length ? links.paths.map((pathPrefix) => ({ scheme: \"https\", host, pathPrefix })) : [{ scheme: \"https\", host }],\n );\n const filter = { action: \"VIEW\", autoVerify: true, data, category: [\"BROWSABLE\", \"DEFAULT\"] };\n const existing = config.android?.intentFilters ?? [];\n const intentFilters = existing.some((f) => JSON.stringify(f) === JSON.stringify(filter)) ? existing : [...existing, filter];\n\n return {\n ...config,\n ios: { ...config.ios, associatedDomains },\n android: { ...config.android, intentFilters },\n };\n}\n\n/** The required-reason APIs for the packages listed in package.json `dependencies`. */\nexport function privacyApisFor(dependencies: Record<string, unknown>): PrivacyApi[] {\n return Object.keys(PRIVACY_APIS)\n .filter((pkg) => pkg in dependencies)\n .flatMap((pkg) => PRIVACY_APIS[pkg]!);\n}\n\n/** Merge required-reason APIs into `ios.privacyManifests`, keeping every entry and reason the app declares. */\nexport function applyPrivacyApis(config: ExpoConfig, apis: PrivacyApi[]): ExpoConfig {\n if (apis.length === 0) return config;\n const manifests = config.ios?.privacyManifests ?? {};\n const types = (manifests.NSPrivacyAccessedAPITypes ?? []).map((t) => ({ ...t, NSPrivacyAccessedAPITypeReasons: [...t.NSPrivacyAccessedAPITypeReasons] }));\n for (const api of apis) {\n const found = types.find((t) => t.NSPrivacyAccessedAPIType === api.NSPrivacyAccessedAPIType);\n if (found) found.NSPrivacyAccessedAPITypeReasons = union(found.NSPrivacyAccessedAPITypeReasons, api.NSPrivacyAccessedAPITypeReasons);\n else types.push({ ...api, NSPrivacyAccessedAPITypeReasons: [...api.NSPrivacyAccessedAPITypeReasons] });\n }\n return { ...config, ios: { ...config.ios, privacyManifests: { ...manifests, NSPrivacyAccessedAPITypes: types } } };\n}\n\n/** The Genesis blocks whose packages are all in `dependencies`. */\nexport function privacyBlocksFor(dependencies: Record<string, unknown>): string[] {\n return Object.keys(PRIVACY_BLOCKS).filter((id) => PRIVACY_BLOCKS[id]!.packages.every((pkg) => pkg in dependencies));\n}\n\n/**\n * The data the app collects: `privacy.collects` when given, else the union of\n * the blocks' (`privacy.blocks`, else those found in `dependencies`). A type\n * two blocks collect appears once, with every purpose either gives, linked or\n * tracking if either says so. An unknown block id throws.\n */\nexport function collectedDataFor(privacy: GenesisPrivacy, dependencies: Record<string, unknown>): GenesisDataUse[] {\n if (privacy.collects) return mergeDataUses(privacy.collects);\n const blocks = privacy.blocks ?? privacyBlocksFor(dependencies);\n const unknown = blocks.filter((id) => !(id in PRIVACY_BLOCKS));\n if (unknown.length) {\n throw new GenesisConfigError(`privacy.blocks: ${unknown.map((id) => `\"${id}\"`).join(\", \")} not one of ${Object.keys(PRIVACY_BLOCKS).join(\", \")}; list other data in privacy.collects`);\n }\n return mergeDataUses(blocks.flatMap((id) => PRIVACY_BLOCKS[id]!.collects));\n}\n\nfunction mergeDataUses(uses: readonly GenesisDataUse[]): GenesisDataUse[] {\n const byType = new Map<string, GenesisDataUse>();\n for (const use of uses) {\n // By Apple's type, so \"user ID\" and \"user id\" are one entry.\n const key = privacyDataType(use.type) ?? use.type;\n const seen = byType.get(key);\n byType.set(\n key,\n seen\n ? { type: use.type, purposes: union(seen.purposes, use.purposes), linked: seen.linked || use.linked, tracking: seen.tracking || use.tracking }\n : { ...use, purposes: [...use.purposes] },\n );\n }\n return [...byType.values()];\n}\n\n/**\n * Write the collected data types and `NSPrivacyTracking` into\n * `ios.privacyManifests`. The app's own entries win: a type it already lists\n * is left as it wrote it, and an `NSPrivacyTracking` it set stays. Tracking\n * defaults to whether any entry tracks; an entry that tracks with tracking\n * set false throws, since the manifest would contradict itself.\n */\nexport function applyPrivacyData(config: ExpoConfig, uses: GenesisDataUse[], tracking?: boolean): ExpoConfig {\n const manifests = config.ios?.privacyManifests ?? {};\n if (tracking !== undefined && manifests.NSPrivacyTracking !== undefined && tracking !== manifests.NSPrivacyTracking) {\n throw new GenesisConfigError(`privacy.tracking is ${tracking} but app.config sets ios.privacyManifests.NSPrivacyTracking to ${manifests.NSPrivacyTracking}; set it in one place`);\n }\n const tracks = uses.some((u) => u.tracking);\n const NSPrivacyTracking = manifests.NSPrivacyTracking ?? tracking ?? tracks;\n if (tracks && NSPrivacyTracking === false) {\n const which = uses.filter((u) => u.tracking).map((u) => u.type);\n throw new GenesisConfigError(`privacy: ${which.join(\", \")} is used for tracking but NSPrivacyTracking is false; set privacy.tracking to true and list NSPrivacyTrackingDomains`);\n }\n const existing = (manifests.NSPrivacyCollectedDataTypes ?? []).map((t) => ({ ...t, NSPrivacyCollectedDataTypePurposes: [...t.NSPrivacyCollectedDataTypePurposes] }));\n const listed = new Set(existing.map((t) => t.NSPrivacyCollectedDataType));\n const added = uses\n .map((u) => ({\n NSPrivacyCollectedDataType: privacyDataType(u.type)!,\n NSPrivacyCollectedDataTypeLinked: u.linked,\n NSPrivacyCollectedDataTypeTracking: u.tracking,\n NSPrivacyCollectedDataTypePurposes: u.purposes.map((p) => PRIVACY_PURPOSES[p]!),\n }))\n .filter((t) => !listed.has(t.NSPrivacyCollectedDataType));\n return {\n ...config,\n ios: { ...config.ios, privacyManifests: { ...manifests, NSPrivacyTracking, NSPrivacyCollectedDataTypes: [...existing, ...added] } },\n };\n}\n\nexport function applyExportCompliance(config: ExpoConfig): ExpoConfig {\n if (config.ios?.config?.usesNonExemptEncryption !== undefined) return config;\n return { ...config, ios: { ...config.ios, config: { ...config.ios?.config, usesNonExemptEncryption: false } } };\n}\n\nexport function applyFingerprint(config: ExpoConfig): ExpoConfig {\n if (config.runtimeVersion !== undefined || config.ios?.runtimeVersion !== undefined || config.android?.runtimeVersion !== undefined) {\n return config;\n }\n return { ...config, runtimeVersion: { policy: \"fingerprint\" } };\n}\n\n/** The Genesis config plugin. Use it in `plugins` or call it directly in app.config.ts. */\nexport const withGenesis: ConfigPlugin<WithGenesisOptions | void> = (config, props) => {\n const options = props ?? {};\n const root = options.projectRoot ?? (config as { _internal?: { projectRoot?: string } })._internal?.projectRoot ?? process.cwd();\n let next = applyVariant(config, resolveVariant(options.variant), options.variants);\n const file = options.links !== false || options.privacyManifest !== false ? readGenesisConfig(root) : null;\n if (options.links !== false) next = applyLinks(next, file?.links);\n if (options.privacyManifest !== false) {\n const dependencies = readDependencies(root);\n const privacy = { ...file?.privacy, ...(options.privacy ? validatePrivacy(options.privacy, \"withGenesis({ privacy })\") : {}) };\n next = applyPrivacyApis(next, privacyApisFor(dependencies));\n if (!privacy.blocks && !privacy.collects && !config.ios?.privacyManifests?.NSPrivacyCollectedDataTypes) {\n // Not a throw: the default is right for an app that is only Genesis blocks. Loud, because\n // anything else the app sends is missing from it.\n console.warn(\n `[genesis] privacy manifest: collected data types are only those of the Genesis blocks found in package.json (${privacyBlocksFor(dependencies).join(\", \") || \"none\"}). If the app sends anything else, list everything it collects in genesis.config.json privacy.collects; to keep this list, set privacy.blocks.`,\n );\n }\n next = applyPrivacyData(next, collectedDataFor(privacy, dependencies), privacy.tracking);\n }\n if (options.exportCompliance !== false) next = applyExportCompliance(next);\n if (options.fingerprint !== false) next = applyFingerprint(next);\n return next;\n};\n\nexport default withGenesis;\n\nfunction readDependencies(root: string): Record<string, unknown> {\n const file = path.join(root, \"package.json\");\n if (!existsSync(file)) return {};\n try {\n const deps = JSON.parse(readFileSync(file, \"utf8\"))?.dependencies;\n return deps && typeof deps === \"object\" ? deps : {};\n } catch (err) {\n throw new GenesisConfigError(`${file} is not valid JSON: ${(err as Error).message}`);\n }\n}\n\nfunction union(a: string[], b: string[]): string[] {\n return [...new Set([...a, ...b])];\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "packages": {
3
3
  "@marktiderman/genesis-chat": {
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "blocks": {
6
6
  "chat": {
7
7
  "feature": {
@@ -53,7 +53,7 @@
53
53
  }
54
54
  },
55
55
  "@marktiderman/genesis-core": {
56
- "version": "1.10.0"
56
+ "version": "1.11.0"
57
57
  },
58
58
  "@marktiderman/genesis-switchboard": {
59
59
  "version": "2.1.0"
@@ -65,7 +65,7 @@
65
65
  "version": "0.2.0"
66
66
  },
67
67
  "@marktiderman/genesis-features": {
68
- "version": "0.4.1"
68
+ "version": "0.5.0"
69
69
  },
70
70
  "@marktiderman/genesis-forms": {
71
71
  "version": "0.9.2"
@@ -89,13 +89,13 @@
89
89
  "version": "0.6.3"
90
90
  },
91
91
  "@marktiderman/genesis": {
92
- "version": "0.9.10"
92
+ "version": "0.9.11"
93
93
  },
94
94
  "@marktiderman/genesis-cli": {
95
- "version": "1.11.2"
95
+ "version": "1.12.0"
96
96
  },
97
97
  "@marktiderman/genesis-native": {
98
- "version": "0.4.2",
98
+ "version": "0.4.3",
99
99
  "blocks": {
100
100
  "push": {
101
101
  "feature": {
@@ -273,7 +273,7 @@
273
273
  }
274
274
  },
275
275
  "@marktiderman/genesis-notifications": {
276
- "version": "0.2.0",
276
+ "version": "0.2.1",
277
277
  "blocks": {
278
278
  "notifications": {
279
279
  "feature": {
@@ -329,7 +329,7 @@
329
329
  }
330
330
  },
331
331
  "@marktiderman/genesis-sites": {
332
- "version": "0.3.1",
332
+ "version": "0.3.2",
333
333
  "blocks": {
334
334
  "sites": {
335
335
  "feature": {
@@ -379,7 +379,7 @@
379
379
  "version": "0.3.1"
380
380
  },
381
381
  "@marktiderman/genesis-supabase": {
382
- "version": "0.6.0",
382
+ "version": "0.6.1",
383
383
  "blocks": {
384
384
  "account": {
385
385
  "feature": {
@@ -511,7 +511,7 @@
511
511
  }
512
512
  },
513
513
  "@marktiderman/genesis-support": {
514
- "version": "0.2.2",
514
+ "version": "0.2.3",
515
515
  "blocks": {
516
516
  "support-feedback": {
517
517
  "feature": {
@@ -701,7 +701,7 @@
701
701
  }
702
702
  },
703
703
  "@marktiderman/genesis-ui": {
704
- "version": "2.17.0"
704
+ "version": "2.17.1"
705
705
  },
706
706
  "@marktiderman/genesis-ui-native": {
707
707
  "version": "2.5.0"
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { FileSystem, ScaffoldLogger, ScaffoldOptions, ScaffoldResult, planScaffold, runScaffold, validateConsumerName } from './scaffolder.js';
2
2
  import postgres from 'postgres';
3
3
  export { RunDoctorOptions, defineDoctorPlugin, formatReport, runDoctor } from './doctor.js';
4
- export { D as DoctorConfig, f as DoctorConfigError, g as DoctorContext, h as DoctorPlugin, i as DoctorResult, F as Finding, c as GenesisConfigError, j as GenesisConfigFile, b as GenesisLinks, r as readGenesisConfig, v as validateLinks } from './config-QC_Ewwwp.js';
4
+ export { D as DoctorConfig, f as DoctorConfigError, g as DoctorContext, h as DoctorPlugin, i as DoctorResult, F as Finding, c as GenesisConfigError, j as GenesisConfigFile, b as GenesisLinks, r as readGenesisConfig, v as validateLinks } from './config-4MhgqkFT.js';
5
5
 
6
6
  type StorageType = "string" | "number" | "boolean" | "datetime" | "json";
7
7
  interface IntrospectedColumn {