1 line
1.8 KiB
Plaintext
1 line
1.8 KiB
Plaintext
{"version":3,"file":"AssetContents.js","sourceRoot":"","sources":["../../src/ios/AssetContents.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0B;AAC1B,+BAA4B;AA2B5B;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAC1C,SAAiB,EACjB,EAAE,MAAM,EAAgC;IAExC,MAAM,kBAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAE9B,MAAM,kBAAE,CAAC,SAAS,CAChB,WAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAChC,IAAI,CAAC,SAAS,CACZ;QACE,MAAM;QACN,IAAI,EAAE;YACJ,OAAO,EAAE,CAAC;YACV,8EAA8E;YAC9E,MAAM,EAAE,MAAM;SACf;KACF,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;AACJ,CAAC;AArBD,wDAqBC","sourcesContent":["import fs from 'fs-extra';\nimport { join } from 'path';\n\nexport type ContentsJsonImageIdiom = 'iphone' | 'ipad' | 'ios-marketing' | 'universal';\n\nexport type ContentsJsonImageAppearance = {\n appearance: 'luminosity';\n value: 'dark';\n};\n\nexport type ContentsJsonImageScale = '1x' | '2x' | '3x';\n\nexport interface ContentsJsonImage {\n appearances?: ContentsJsonImageAppearance[];\n idiom: ContentsJsonImageIdiom;\n size?: string;\n scale: ContentsJsonImageScale;\n filename?: string;\n}\n\nexport interface ContentsJson {\n images: ContentsJsonImage[];\n info: {\n version: number;\n author: string;\n };\n}\n\n/**\n * Writes the Config.json which is used to assign images to their respective platform, dpi, and idiom.\n *\n * @param directory path to add the Contents.json to.\n * @param contents image json data\n */\nexport async function writeContentsJsonAsync(\n directory: string,\n { images }: Pick<ContentsJson, 'images'>\n): Promise<void> {\n await fs.ensureDir(directory);\n\n await fs.writeFile(\n join(directory, 'Contents.json'),\n JSON.stringify(\n {\n images,\n info: {\n version: 1,\n // common practice is for the tool that generated the icons to be the \"author\"\n author: 'expo',\n },\n },\n null,\n 2\n )\n );\n}\n"]} |