@expo/config-plugins 7.7.0 → 7.8.1

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.
Files changed (68) hide show
  1. package/build/android/BuildProperties.js.map +1 -1
  2. package/build/android/Colors.js.map +1 -1
  3. package/build/android/EasBuild.js.map +1 -1
  4. package/build/android/GoogleMapsApiKey.js.map +1 -1
  5. package/build/android/GoogleServices.js.map +1 -1
  6. package/build/android/IntentFilters.js.map +1 -1
  7. package/build/android/Manifest.js.map +1 -1
  8. package/build/android/Name.js.map +1 -1
  9. package/build/android/Orientation.js.map +1 -1
  10. package/build/android/Package.js.map +1 -1
  11. package/build/android/Paths.js.map +1 -1
  12. package/build/android/Permissions.js.map +1 -1
  13. package/build/android/PrimaryColor.js.map +1 -1
  14. package/build/android/Properties.js.map +1 -1
  15. package/build/android/Resources.js.map +1 -1
  16. package/build/android/Scheme.js.map +1 -1
  17. package/build/android/StatusBar.js.map +1 -1
  18. package/build/android/Strings.js.map +1 -1
  19. package/build/android/Updates.d.ts +1 -0
  20. package/build/android/Updates.js +4 -0
  21. package/build/android/Updates.js.map +1 -1
  22. package/build/android/Version.js.map +1 -1
  23. package/build/ios/Bitcode.js.map +1 -1
  24. package/build/ios/BuildProperties.js.map +1 -1
  25. package/build/ios/BuildScheme.js.map +1 -1
  26. package/build/ios/BundleIdentifier.js +21 -17
  27. package/build/ios/BundleIdentifier.js.map +1 -1
  28. package/build/ios/DeviceFamily.js.map +1 -1
  29. package/build/ios/Entitlements.js.map +1 -1
  30. package/build/ios/Google.js.map +1 -1
  31. package/build/ios/Locales.js.map +1 -1
  32. package/build/ios/Maps.js +0 -1
  33. package/build/ios/Maps.js.map +1 -1
  34. package/build/ios/Name.js.map +1 -1
  35. package/build/ios/Orientation.js.map +1 -1
  36. package/build/ios/Paths.js.map +1 -1
  37. package/build/ios/ProvisioningProfile.js.map +1 -1
  38. package/build/ios/RequiresFullScreen.js.map +1 -1
  39. package/build/ios/Scheme.js.map +1 -1
  40. package/build/ios/Swift.js.map +1 -1
  41. package/build/ios/Target.js.map +1 -1
  42. package/build/ios/Updates.js.map +1 -1
  43. package/build/ios/UsesNonExemptEncryption.js.map +1 -1
  44. package/build/ios/Version.js.map +1 -1
  45. package/build/ios/codeMod.js.map +1 -1
  46. package/build/ios/utils/Xcodeproj.d.ts +7 -0
  47. package/build/ios/utils/Xcodeproj.js +89 -0
  48. package/build/ios/utils/Xcodeproj.js.map +1 -1
  49. package/build/plugins/createBaseMod.js.map +1 -1
  50. package/build/plugins/ios-plugins.js.map +1 -1
  51. package/build/plugins/mod-compiler.js.map +1 -1
  52. package/build/plugins/withAndroidBaseMods.js.map +1 -1
  53. package/build/plugins/withIosBaseMods.js.map +1 -1
  54. package/build/plugins/withMod.js.map +1 -1
  55. package/build/plugins/withPlugins.js.map +1 -1
  56. package/build/plugins/withStaticPlugin.js.map +1 -1
  57. package/build/utils/Updates.js.map +1 -1
  58. package/build/utils/XML.js.map +1 -1
  59. package/build/utils/errors.js +3 -6
  60. package/build/utils/errors.js.map +1 -1
  61. package/build/utils/generateCode.js +2 -2
  62. package/build/utils/generateCode.js.map +1 -1
  63. package/build/utils/matchBrackets.js.map +1 -1
  64. package/build/utils/modules.js.map +1 -1
  65. package/build/utils/obj.js.map +1 -1
  66. package/build/utils/plugin-resolver.js.map +1 -1
  67. package/build/utils/sortObject.js.map +1 -1
  68. package/package.json +13 -11
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-resolver.js","names":["_assert","data","_interopRequireDefault","require","_findUp","path","_interopRequireWildcard","_resolveFrom","_errors","_modules","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","pluginFileName","exports","findUpPackageJson","root","packageJson","findUp","sync","cwd","assert","resolvePluginForModule","projectRoot","modulePath","resolved","resolveFrom","silent","PluginError","moduleNameIsDirectFileReference","isPluginFile","filePath","findUpPlugin","pathIsFilePath","name","match","_name$split","slashCount","split","sep","length","startsWith","resolveExpoPluginFile","pluginModuleFile","fileExists","moduleRoot","dirname","pluginFile","normalizeStaticPlugin","plugin","Array","isArray","undefined","assertInternalProjectRoot","resolveConfigPluginFunction","pluginReference","resolveConfigPluginFunctionWithInfo","result","requirePluginFile","error","SyntaxError","learnMoreLink","pluginError","message","stack","resolveConfigPluginExport"],"sources":["../../src/utils/plugin-resolver.ts"],"sourcesContent":["import assert from 'assert';\nimport findUp from 'find-up';\nimport * as path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { PluginError } from './errors';\nimport { fileExists } from './modules';\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\n\n// Default plugin entry file name.\nexport const pluginFileName = 'app.plugin.js';\n\nfunction findUpPackageJson(root: string): string {\n const packageJson = findUp.sync('package.json', { cwd: root });\n assert(packageJson, `No package.json found for module \"${root}\"`);\n return packageJson;\n}\n\nexport function resolvePluginForModule(projectRoot: string, modulePath: string) {\n const resolved = resolveFrom.silent(projectRoot, modulePath);\n if (!resolved) {\n throw new PluginError(\n `Failed to resolve plugin for module \"${modulePath}\" relative to \"${projectRoot}\"`,\n 'PLUGIN_NOT_FOUND'\n );\n }\n // If the modulePath is something like `@bacon/package/index.js` or `expo-foo/build/app`\n // then skip resolving the module `app.plugin.js`\n if (moduleNameIsDirectFileReference(modulePath)) {\n return { isPluginFile: false, filePath: resolved };\n }\n return findUpPlugin(resolved);\n}\n\n// TODO: Test windows\nfunction pathIsFilePath(name: string): boolean {\n // Matches lines starting with: . / ~/\n return !!name.match(/^(\\.|~\\/|\\/)/g);\n}\n\nexport function moduleNameIsDirectFileReference(name: string): boolean {\n if (pathIsFilePath(name)) {\n return true;\n }\n\n const slashCount = name.split(path.sep)?.length;\n // Orgs (like @expo/config ) should have more than one slash to be a direct file.\n if (name.startsWith('@')) {\n return slashCount > 2;\n }\n\n // Regular packages should be considered direct reference if they have more than one slash.\n return slashCount > 1;\n}\n\nfunction resolveExpoPluginFile(root: string): string | null {\n // Find the expo plugin root file\n const pluginModuleFile = resolveFrom.silent(\n root,\n // use ./ so it isn't resolved as a node module\n `./${pluginFileName}`\n );\n\n // If the default expo plugin file exists use it.\n if (pluginModuleFile && fileExists(pluginModuleFile)) {\n return pluginModuleFile;\n }\n return null;\n}\n\nfunction findUpPlugin(root: string): { filePath: string; isPluginFile: boolean } {\n // Get the closest package.json to the node module\n const packageJson = findUpPackageJson(root);\n // resolve the root folder for the node module\n const moduleRoot = path.dirname(packageJson);\n // use whatever the initial resolved file was ex: `node_modules/my-package/index.js` or `./something.js`\n const pluginFile = resolveExpoPluginFile(moduleRoot);\n return { filePath: pluginFile ?? root, isPluginFile: !!pluginFile };\n}\n\nexport function normalizeStaticPlugin(plugin: StaticPlugin | ConfigPlugin | string): StaticPlugin {\n if (Array.isArray(plugin)) {\n assert(\n plugin.length > 0 && plugin.length < 3,\n `Wrong number of arguments provided for static config plugin, expected either 1 or 2, got ${plugin.length}`\n );\n return plugin;\n }\n return [plugin, undefined];\n}\n\nexport function assertInternalProjectRoot(projectRoot?: string): asserts projectRoot {\n assert(\n projectRoot,\n `Unexpected: Config \\`_internal.projectRoot\\` isn't defined by expo-cli, this is a bug.`\n );\n}\n\n// Resolve the module function and assert type\nexport function resolveConfigPluginFunction(projectRoot: string, pluginReference: string) {\n const { plugin } = resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference);\n return plugin;\n}\n\n// Resolve the module function and assert type\nexport function resolveConfigPluginFunctionWithInfo(projectRoot: string, pluginReference: string) {\n const { filePath: pluginFile, isPluginFile } = resolvePluginForModule(\n projectRoot,\n pluginReference\n );\n let result: any;\n try {\n result = requirePluginFile(pluginFile);\n } catch (error) {\n if (error instanceof SyntaxError) {\n const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;\n // If the plugin reference is a node module, and that node module has a syntax error, then it probably doesn't have an official config plugin.\n if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {\n const pluginError = new PluginError(\n `Package \"${pluginReference}\" does not contain a valid config plugin.\\n${learnMoreLink}\\n\\n${error.message}`,\n 'INVALID_PLUGIN_IMPORT'\n );\n pluginError.stack = error.stack;\n throw pluginError;\n }\n }\n throw error;\n }\n\n const plugin = resolveConfigPluginExport({\n plugin: result,\n pluginFile,\n pluginReference,\n isPluginFile,\n });\n return { plugin, pluginFile, pluginReference, isPluginFile };\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param props.plugin plugin results\n * @param props.pluginFile plugin file path\n * @param props.pluginReference the string used to reference the plugin\n * @param props.isPluginFile is file path from the app.plugin.js module root\n */\nexport function resolveConfigPluginExport({\n plugin,\n pluginFile,\n pluginReference,\n isPluginFile,\n}: {\n plugin: any;\n pluginFile: string;\n pluginReference: string;\n isPluginFile: boolean;\n}): ConfigPlugin<unknown> {\n if (plugin.default != null) {\n plugin = plugin.default;\n }\n if (typeof plugin !== 'function') {\n const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;\n // If the plugin reference is a node module, and that node module does not export a function then it probably doesn't have a config plugin.\n if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {\n throw new PluginError(\n `Package \"${pluginReference}\" does not contain a valid config plugin. Module must export a function from file: ${pluginFile}\\n${learnMoreLink}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n throw new PluginError(\n `Plugin \"${pluginReference}\" must export a function from file: ${pluginFile}. ${learnMoreLink}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n\n return plugin;\n}\n\nfunction requirePluginFile(filePath: string): any {\n try {\n return require(filePath);\n } catch (error) {\n // TODO: Improve error messages\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EA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,"file":"plugin-resolver.js","names":["_assert","data","_interopRequireDefault","require","_findUp","path","_interopRequireWildcard","_resolveFrom","_errors","_modules","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","pluginFileName","exports","findUpPackageJson","root","packageJson","findUp","sync","cwd","assert","resolvePluginForModule","projectRoot","modulePath","resolved","resolveFrom","silent","PluginError","moduleNameIsDirectFileReference","isPluginFile","filePath","findUpPlugin","pathIsFilePath","name","match","_name$split","slashCount","split","sep","length","startsWith","resolveExpoPluginFile","pluginModuleFile","fileExists","moduleRoot","dirname","pluginFile","normalizeStaticPlugin","plugin","Array","isArray","undefined","assertInternalProjectRoot","resolveConfigPluginFunction","pluginReference","resolveConfigPluginFunctionWithInfo","result","requirePluginFile","error","SyntaxError","learnMoreLink","pluginError","message","stack","resolveConfigPluginExport"],"sources":["../../src/utils/plugin-resolver.ts"],"sourcesContent":["import assert from 'assert';\nimport findUp from 'find-up';\nimport * as path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { PluginError } from './errors';\nimport { fileExists } from './modules';\nimport { ConfigPlugin, StaticPlugin } from '../Plugin.types';\n\n// Default plugin entry file name.\nexport const pluginFileName = 'app.plugin.js';\n\nfunction findUpPackageJson(root: string): string {\n const packageJson = findUp.sync('package.json', { cwd: root });\n assert(packageJson, `No package.json found for module \"${root}\"`);\n return packageJson;\n}\n\nexport function resolvePluginForModule(projectRoot: string, modulePath: string) {\n const resolved = resolveFrom.silent(projectRoot, modulePath);\n if (!resolved) {\n throw new PluginError(\n `Failed to resolve plugin for module \"${modulePath}\" relative to \"${projectRoot}\"`,\n 'PLUGIN_NOT_FOUND'\n );\n }\n // If the modulePath is something like `@bacon/package/index.js` or `expo-foo/build/app`\n // then skip resolving the module `app.plugin.js`\n if (moduleNameIsDirectFileReference(modulePath)) {\n return { isPluginFile: false, filePath: resolved };\n }\n return findUpPlugin(resolved);\n}\n\n// TODO: Test windows\nfunction pathIsFilePath(name: string): boolean {\n // Matches lines starting with: . / ~/\n return !!name.match(/^(\\.|~\\/|\\/)/g);\n}\n\nexport function moduleNameIsDirectFileReference(name: string): boolean {\n if (pathIsFilePath(name)) {\n return true;\n }\n\n const slashCount = name.split(path.sep)?.length;\n // Orgs (like @expo/config ) should have more than one slash to be a direct file.\n if (name.startsWith('@')) {\n return slashCount > 2;\n }\n\n // Regular packages should be considered direct reference if they have more than one slash.\n return slashCount > 1;\n}\n\nfunction resolveExpoPluginFile(root: string): string | null {\n // Find the expo plugin root file\n const pluginModuleFile = resolveFrom.silent(\n root,\n // use ./ so it isn't resolved as a node module\n `./${pluginFileName}`\n );\n\n // If the default expo plugin file exists use it.\n if (pluginModuleFile && fileExists(pluginModuleFile)) {\n return pluginModuleFile;\n }\n return null;\n}\n\nfunction findUpPlugin(root: string): { filePath: string; isPluginFile: boolean } {\n // Get the closest package.json to the node module\n const packageJson = findUpPackageJson(root);\n // resolve the root folder for the node module\n const moduleRoot = path.dirname(packageJson);\n // use whatever the initial resolved file was ex: `node_modules/my-package/index.js` or `./something.js`\n const pluginFile = resolveExpoPluginFile(moduleRoot);\n return { filePath: pluginFile ?? root, isPluginFile: !!pluginFile };\n}\n\nexport function normalizeStaticPlugin(plugin: StaticPlugin | ConfigPlugin | string): StaticPlugin {\n if (Array.isArray(plugin)) {\n assert(\n plugin.length > 0 && plugin.length < 3,\n `Wrong number of arguments provided for static config plugin, expected either 1 or 2, got ${plugin.length}`\n );\n return plugin;\n }\n return [plugin, undefined];\n}\n\nexport function assertInternalProjectRoot(projectRoot?: string): asserts projectRoot {\n assert(\n projectRoot,\n `Unexpected: Config \\`_internal.projectRoot\\` isn't defined by expo-cli, this is a bug.`\n );\n}\n\n// Resolve the module function and assert type\nexport function resolveConfigPluginFunction(projectRoot: string, pluginReference: string) {\n const { plugin } = resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference);\n return plugin;\n}\n\n// Resolve the module function and assert type\nexport function resolveConfigPluginFunctionWithInfo(projectRoot: string, pluginReference: string) {\n const { filePath: pluginFile, isPluginFile } = resolvePluginForModule(\n projectRoot,\n pluginReference\n );\n let result: any;\n try {\n result = requirePluginFile(pluginFile);\n } catch (error) {\n if (error instanceof SyntaxError) {\n const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;\n // If the plugin reference is a node module, and that node module has a syntax error, then it probably doesn't have an official config plugin.\n if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {\n const pluginError = new PluginError(\n `Package \"${pluginReference}\" does not contain a valid config plugin.\\n${learnMoreLink}\\n\\n${error.message}`,\n 'INVALID_PLUGIN_IMPORT'\n );\n pluginError.stack = error.stack;\n throw pluginError;\n }\n }\n throw error;\n }\n\n const plugin = resolveConfigPluginExport({\n plugin: result,\n pluginFile,\n pluginReference,\n isPluginFile,\n });\n return { plugin, pluginFile, pluginReference, isPluginFile };\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param props.plugin plugin results\n * @param props.pluginFile plugin file path\n * @param props.pluginReference the string used to reference the plugin\n * @param props.isPluginFile is file path from the app.plugin.js module root\n */\nexport function resolveConfigPluginExport({\n plugin,\n pluginFile,\n pluginReference,\n isPluginFile,\n}: {\n plugin: any;\n pluginFile: string;\n pluginReference: string;\n isPluginFile: boolean;\n}): ConfigPlugin<unknown> {\n if (plugin.default != null) {\n plugin = plugin.default;\n }\n if (typeof plugin !== 'function') {\n const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;\n // If the plugin reference is a node module, and that node module does not export a function then it probably doesn't have a config plugin.\n if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {\n throw new PluginError(\n `Package \"${pluginReference}\" does not contain a valid config plugin. Module must export a function from file: ${pluginFile}\\n${learnMoreLink}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n throw new PluginError(\n `Plugin \"${pluginReference}\" must export a function from file: ${pluginFile}. ${learnMoreLink}`,\n 'INVALID_PLUGIN_TYPE'\n );\n }\n\n return plugin;\n}\n\nfunction requirePluginFile(filePath: string): any {\n try {\n return require(filePath);\n } catch (error) {\n // TODO: Improve error messages\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,KAAA;EAAA,MAAAJ,IAAA,GAAAK,uBAAA,CAAAH,OAAA;EAAAE,IAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuC,SAAAS,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,G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/I,qBACF,CAAC;IACH;IACA,MAAM,KAAIjC,qBAAW,EAClB,WAAU2B,eAAgB,uCAAsCR,UAAW,KAAIc,aAAc,EAAC,EAC/F,qBACF,CAAC;EACH;EAEA,OAAOZ,MAAM;AACf;AAEA,SAASS,iBAAiBA,CAAC3B,QAAgB,EAAO;EAChD,IAAI;IACF,OAAO/C,OAAO,CAAC+C,QAAQ,CAAC;EAC1B,CAAC,CAAC,OAAO4B,KAAK,EAAE;IACd;IACA,MAAMA,KAAK;EACb;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"sortObject.js","names":["sortObject","obj","compareFn","Object","keys","sort","reduce","acc","key","sortObjWithOrder","order","sorted","sortWithOrder","groupOrder","Set","concat","length","shift","index","indexOf","item","splice","push","reverseSortString","a","b","exports"],"sources":["../../src/utils/sortObject.ts"],"sourcesContent":["export function sortObject<T extends Record<string, any> = Record<string, any>>(\n obj: T,\n compareFn?: (a: string, b: string) => number\n): T {\n return Object.keys(obj)\n .sort(compareFn)\n .reduce(\n (acc, key) => ({\n ...acc,\n [key]: obj[key],\n }),\n {}\n ) as T;\n}\n\nexport function sortObjWithOrder<T extends Record<string, any> = Record<string, any>>(\n obj: T,\n order: string[]\n): T {\n const sorted = sortWithOrder(Object.keys(obj), order);\n\n return sorted.reduce(\n (acc, key) => ({\n ...acc,\n [key]: obj[key],\n }),\n {}\n ) as T;\n}\n\nexport function sortWithOrder(obj: string[], order: string[]): string[] {\n const groupOrder = [...new Set(order.concat(obj))];\n const sorted: string[] = [];\n\n while (groupOrder.length) {\n const key = groupOrder.shift()!;\n const index = obj.indexOf(key);\n if (index > -1) {\n const [item] = obj.splice(index, 1);\n sorted.push(item);\n }\n }\n\n return sorted;\n}\n\nexport const reverseSortString = (a: string, b: string) => {\n if (a < b) return 1;\n if (a > b) return -1;\n return 0;\n};\n"],"mappings":";;;;;;;;;AAAO,SAASA,UAAUA,CACxBC,GAAM,EACNC,SAA4C,EACzC;EACH,OAAOC,MAAM,CAACC,IAA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C,CAAC;EACpB,OAAO,CAAC;AACV,CAAC;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"sortObject.js","names":["sortObject","obj","compareFn","Object","keys","sort","reduce","acc","key","sortObjWithOrder","order","sorted","sortWithOrder","groupOrder","Set","concat","length","shift","index","indexOf","item","splice","push","reverseSortString","a","b","exports"],"sources":["../../src/utils/sortObject.ts"],"sourcesContent":["export function sortObject<T extends Record<string, any> = Record<string, any>>(\n obj: T,\n compareFn?: (a: string, b: string) => number\n): T {\n return Object.keys(obj)\n .sort(compareFn)\n .reduce(\n (acc, key) => ({\n ...acc,\n [key]: obj[key],\n }),\n {}\n ) as T;\n}\n\nexport function sortObjWithOrder<T extends Record<string, any> = Record<string, any>>(\n obj: T,\n order: string[]\n): T {\n const sorted = sortWithOrder(Object.keys(obj), order);\n\n return sorted.reduce(\n (acc, key) => ({\n ...acc,\n [key]: obj[key],\n }),\n {}\n ) as T;\n}\n\nexport function sortWithOrder(obj: string[], order: string[]): string[] {\n const groupOrder = [...new Set(order.concat(obj))];\n const sorted: string[] = [];\n\n while (groupOrder.length) {\n const key = groupOrder.shift()!;\n const index = obj.indexOf(key);\n if (index > -1) {\n const [item] = obj.splice(index, 1);\n sorted.push(item);\n }\n }\n\n return sorted;\n}\n\nexport const reverseSortString = (a: string, b: string) => {\n if (a < b) return 1;\n if (a > b) return -1;\n return 0;\n};\n"],"mappings":";;;;;;;;;AAAO,SAASA,UAAUA,CACxBC,GAAM,EACNC,SAA4C,EACzC;EACH,OAAOC,MAAM,CAACC,IAAI,CAACH,GAAG,CAAC,CACpBI,IAAI,CAACH,SAAS,CAAC,CACfI,MAAM,CACL,CAACC,GAAG,EAAEC,GAAG,MAAM;IACb,GAAGD,GAAG;IACN,CAACC,GAAG,GAAGP,GAAG,CAACO,GAAG;EAChB,CAAC,CAAC,EACF,CAAC,CACH,CAAC;AACL;AAEO,SAASC,gBAAgBA,CAC9BR,GAAM,EACNS,KAAe,EACZ;EACH,MAAMC,MAAM,GAAGC,aAAa,CAACT,MAAM,CAACC,IAAI,CAACH,GAAG,CAAC,EAAES,KAAK,CAAC;EAErD,OAAOC,MAAM,CAACL,MAAM,CAClB,CAACC,GAAG,EAAEC,GAAG,MAAM;IACb,GAAGD,GAAG;IACN,CAACC,GAAG,GAAGP,GAAG,CAACO,GAAG;EAChB,CAAC,CAAC,EACF,CAAC,CACH,CAAC;AACH;AAEO,SAASI,aAAaA,CAACX,GAAa,EAAES,KAAe,EAAY;EACtE,MAAMG,UAAU,GAAG,CAAC,GAAG,IAAIC,GAAG,CAACJ,KAAK,CAACK,MAAM,CAACd,GAAG,CAAC,CAAC,CAAC;EAClD,MAAMU,MAAgB,GAAG,EAAE;EAE3B,OAAOE,UAAU,CAACG,MAAM,EAAE;IACxB,MAAMR,GAAG,GAAGK,UAAU,CAACI,KAAK,CAAC,CAAE;IAC/B,MAAMC,KAAK,GAAGjB,GAAG,CAACkB,OAAO,CAACX,GAAG,CAAC;IAC9B,IAAIU,KAAK,GAAG,CAAC,CAAC,EAAE;MACd,MAAM,CAACE,IAAI,CAAC,GAAGnB,GAAG,CAACoB,MAAM,CAACH,KAAK,EAAE,CAAC,CAAC;MACnCP,MAAM,CAACW,IAAI,CAACF,IAAI,CAAC;IACnB;EACF;EAEA,OAAOT,MAAM;AACf;AAEO,MAAMY,iBAAiB,GAAGA,CAACC,CAAS,EAAEC,CAAS,KAAK;EACzD,IAAID,CAAC,GAAGC,CAAC,EAAE,OAAO,CAAC;EACnB,IAAID,CAAC,GAAGC,CAAC,EAAE,OAAO,CAAC,CAAC;EACpB,OAAO,CAAC;AACV,CAAC;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA"}
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@expo/config-plugins",
3
- "version": "7.7.0",
3
+ "version": "7.8.1",
4
4
  "description": "A library for Expo config plugins",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
7
- "watch": "tsc --watch --preserveWatchOutput",
8
7
  "build": "tsc --emitDeclarationOnly && babel src --out-dir build --extensions \".ts\" --source-maps --ignore \"src/**/__mocks__/*\",\"src/**/__tests__/*\",\"src/**/__integration_tests__/*\"",
9
- "prepare": "yarn run clean && yarn build",
10
- "clean": "rimraf build ./tsconfig.tsbuildinfo",
11
- "lint": "eslint .",
12
- "test": "jest"
8
+ "clean": "expo-module clean",
9
+ "lint": "expo-module lint",
10
+ "prepare": "expo-module clean && yarn run build",
11
+ "prepublishOnly": "expo-module prepublishOnly",
12
+ "test": "expo-module test",
13
+ "typecheck": "expo-module typecheck"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -33,9 +34,9 @@
33
34
  ],
34
35
  "dependencies": {
35
36
  "@expo/config-types": "^50.0.0-alpha.1",
36
- "@expo/fingerprint": "^0.4.0",
37
- "@expo/json-file": "~8.2.37",
38
- "@expo/plist": "^0.0.20",
37
+ "@expo/fingerprint": "^0.6.0",
38
+ "@expo/json-file": "~8.3.0",
39
+ "@expo/plist": "^0.1.0",
39
40
  "@expo/sdk-runtime-versions": "^1.0.0",
40
41
  "@react-native/normalize-color": "^2.0.0",
41
42
  "chalk": "^4.1.2",
@@ -52,10 +53,11 @@
52
53
  "devDependencies": {
53
54
  "@types/debug": "^4.1.5",
54
55
  "@types/find-up": "^4.0.0",
55
- "@types/xml2js": "~0.4.11"
56
+ "@types/xml2js": "~0.4.11",
57
+ "expo-module-scripts": "^3.3.0"
56
58
  },
57
59
  "publishConfig": {
58
60
  "access": "public"
59
61
  },
60
- "gitHead": "3142a086578deffd8704a8f1b6f0f661527d836c"
62
+ "gitHead": "1a7c4e8ffed182e00cf1cf654ca2401441a7377a"
61
63
  }