@expo/config-plugins 5.0.4 → 6.0.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.
Files changed (190) hide show
  1. package/build/Plugin.types.d.ts +7 -7
  2. package/build/Plugin.types.js +0 -9
  3. package/build/Plugin.types.js.map +1 -1
  4. package/build/android/AllowBackup.js +0 -15
  5. package/build/android/AllowBackup.js.map +1 -1
  6. package/build/android/BuildProperties.js +2 -16
  7. package/build/android/BuildProperties.js.map +1 -1
  8. package/build/android/Colors.js +3 -25
  9. package/build/android/Colors.js.map +1 -1
  10. package/build/android/EasBuild.js +2 -22
  11. package/build/android/EasBuild.js.map +1 -1
  12. package/build/android/EasBuildGradleScript.js.map +1 -1
  13. package/build/android/GoogleMapsApiKey.js +0 -12
  14. package/build/android/GoogleMapsApiKey.js.map +1 -1
  15. package/build/android/GoogleServices.js +10 -48
  16. package/build/android/GoogleServices.js.map +1 -1
  17. package/build/android/IntentFilters.d.ts +1 -1
  18. package/build/android/IntentFilters.js +8 -24
  19. package/build/android/IntentFilters.js.map +1 -1
  20. package/build/android/Manifest.d.ts +19 -19
  21. package/build/android/Manifest.js +7 -66
  22. package/build/android/Manifest.js.map +1 -1
  23. package/build/android/Name.js +6 -27
  24. package/build/android/Name.js.map +1 -1
  25. package/build/android/Orientation.js +2 -12
  26. package/build/android/Orientation.js.map +1 -1
  27. package/build/android/Package.js +26 -111
  28. package/build/android/Package.js.map +1 -1
  29. package/build/android/Paths.d.ts +2 -2
  30. package/build/android/Paths.js +0 -47
  31. package/build/android/Paths.js.map +1 -1
  32. package/build/android/Permissions.js +8 -52
  33. package/build/android/Permissions.js.map +1 -1
  34. package/build/android/PrimaryColor.js +0 -18
  35. package/build/android/PrimaryColor.js.map +1 -1
  36. package/build/android/Properties.d.ts +1 -1
  37. package/build/android/Properties.js +0 -9
  38. package/build/android/Properties.js.map +1 -1
  39. package/build/android/Resources.d.ts +4 -4
  40. package/build/android/Resources.js +9 -29
  41. package/build/android/Resources.js.map +1 -1
  42. package/build/android/Scheme.d.ts +1 -1
  43. package/build/android/Scheme.js +13 -66
  44. package/build/android/Scheme.js.map +1 -1
  45. package/build/android/StatusBar.js +5 -33
  46. package/build/android/StatusBar.js.map +1 -1
  47. package/build/android/Strings.js +0 -14
  48. package/build/android/Strings.js.map +1 -1
  49. package/build/android/Styles.js +7 -34
  50. package/build/android/Styles.js.map +1 -1
  51. package/build/android/Updates.d.ts +2 -0
  52. package/build/android/Updates.js +50 -47
  53. package/build/android/Updates.js.map +1 -1
  54. package/build/android/Version.js +3 -29
  55. package/build/android/Version.js.map +1 -1
  56. package/build/android/WindowSoftInputMode.js +0 -14
  57. package/build/android/WindowSoftInputMode.js.map +1 -1
  58. package/build/android/codeMod.js +6 -22
  59. package/build/android/codeMod.js.map +1 -1
  60. package/build/android/index.js +0 -94
  61. package/build/android/index.js.map +1 -1
  62. package/build/index.js +2 -65
  63. package/build/index.js.map +1 -1
  64. package/build/ios/Bitcode.d.ts +1 -1
  65. package/build/ios/Bitcode.js +8 -28
  66. package/build/ios/Bitcode.js.map +1 -1
  67. package/build/ios/BuildProperties.js +2 -14
  68. package/build/ios/BuildProperties.js.map +1 -1
  69. package/build/ios/BuildScheme.js +2 -34
  70. package/build/ios/BuildScheme.js.map +1 -1
  71. package/build/ios/BundleIdentifier.js +13 -72
  72. package/build/ios/BundleIdentifier.js.map +1 -1
  73. package/build/ios/DeviceFamily.js +6 -24
  74. package/build/ios/DeviceFamily.js.map +1 -1
  75. package/build/ios/Entitlements.js +4 -45
  76. package/build/ios/Entitlements.js.map +1 -1
  77. package/build/ios/Google.d.ts +2 -2
  78. package/build/ios/Google.js +11 -66
  79. package/build/ios/Google.js.map +1 -1
  80. package/build/ios/IosConfig.types.d.ts +6 -11
  81. package/build/ios/IosConfig.types.js.map +1 -1
  82. package/build/ios/Locales.d.ts +3 -3
  83. package/build/ios/Locales.js +12 -43
  84. package/build/ios/Locales.js.map +1 -1
  85. package/build/ios/Maps.js +15 -53
  86. package/build/ios/Maps.js.map +1 -1
  87. package/build/ios/Name.js +7 -31
  88. package/build/ios/Name.js.map +1 -1
  89. package/build/ios/Orientation.js +2 -10
  90. package/build/ios/Orientation.js.map +1 -1
  91. package/build/ios/Paths.d.ts +2 -2
  92. package/build/ios/Paths.js +8 -73
  93. package/build/ios/Paths.js.map +1 -1
  94. package/build/ios/Permissions.js +1 -16
  95. package/build/ios/Permissions.js.map +1 -1
  96. package/build/ios/ProvisioningProfile.d.ts +1 -1
  97. package/build/ios/ProvisioningProfile.js +0 -18
  98. package/build/ios/ProvisioningProfile.js.map +1 -1
  99. package/build/ios/RequiresFullScreen.js +19 -31
  100. package/build/ios/RequiresFullScreen.js.map +1 -1
  101. package/build/ios/Scheme.js +10 -32
  102. package/build/ios/Scheme.js.map +1 -1
  103. package/build/ios/Swift.js +16 -50
  104. package/build/ios/Swift.js.map +1 -1
  105. package/build/ios/Target.js +0 -30
  106. package/build/ios/Target.js.map +1 -1
  107. package/build/ios/Updates.js +10 -49
  108. package/build/ios/Updates.js.map +1 -1
  109. package/build/ios/UsesNonExemptEncryption.js +4 -10
  110. package/build/ios/UsesNonExemptEncryption.js.map +1 -1
  111. package/build/ios/Version.js +4 -11
  112. package/build/ios/Version.js.map +1 -1
  113. package/build/ios/XcodeProjectFile.js +5 -23
  114. package/build/ios/XcodeProjectFile.js.map +1 -1
  115. package/build/ios/codeMod.js +19 -60
  116. package/build/ios/codeMod.js.map +1 -1
  117. package/build/ios/index.js +0 -97
  118. package/build/ios/index.js.map +1 -1
  119. package/build/ios/utils/Xcodeproj.d.ts +6 -6
  120. package/build/ios/utils/Xcodeproj.js +15 -101
  121. package/build/ios/utils/Xcodeproj.js.map +1 -1
  122. package/build/ios/utils/getInfoPlistPath.js +2 -15
  123. package/build/ios/utils/getInfoPlistPath.js.map +1 -1
  124. package/build/ios/utils/string.js +0 -1
  125. package/build/ios/utils/string.js.map +1 -1
  126. package/build/plugins/android-plugins.d.ts +2 -2
  127. package/build/plugins/android-plugins.js +11 -42
  128. package/build/plugins/android-plugins.js.map +1 -1
  129. package/build/plugins/createBaseMod.d.ts +3 -3
  130. package/build/plugins/createBaseMod.js +8 -25
  131. package/build/plugins/createBaseMod.js.map +1 -1
  132. package/build/plugins/ios-plugins.d.ts +2 -2
  133. package/build/plugins/ios-plugins.js +8 -48
  134. package/build/plugins/ios-plugins.js.map +1 -1
  135. package/build/plugins/mod-compiler.js +21 -72
  136. package/build/plugins/mod-compiler.js.map +1 -1
  137. package/build/plugins/withAndroidBaseMods.d.ts +1 -1
  138. package/build/plugins/withAndroidBaseMods.js +4 -89
  139. package/build/plugins/withAndroidBaseMods.js.map +1 -1
  140. package/build/plugins/withDangerousMod.js +0 -5
  141. package/build/plugins/withDangerousMod.js.map +1 -1
  142. package/build/plugins/withIosBaseMods.d.ts +1 -1
  143. package/build/plugins/withIosBaseMods.js +26 -118
  144. package/build/plugins/withIosBaseMods.js.map +1 -1
  145. package/build/plugins/withMod.d.ts +1 -1
  146. package/build/plugins/withMod.js +24 -59
  147. package/build/plugins/withMod.js.map +1 -1
  148. package/build/plugins/withPlugins.js +0 -9
  149. package/build/plugins/withPlugins.js.map +1 -1
  150. package/build/plugins/withRunOnce.js +3 -9
  151. package/build/plugins/withRunOnce.js.map +1 -1
  152. package/build/plugins/withStaticPlugin.js +21 -43
  153. package/build/plugins/withStaticPlugin.js.map +1 -1
  154. package/build/utils/BuildProperties.types.d.ts +2 -2
  155. package/build/utils/BuildProperties.types.js.map +1 -1
  156. package/build/utils/Updates.d.ts +3 -1
  157. package/build/utils/Updates.js +18 -77
  158. package/build/utils/Updates.js.map +1 -1
  159. package/build/utils/XML.d.ts +1 -1
  160. package/build/utils/XML.js +7 -44
  161. package/build/utils/XML.js.map +1 -1
  162. package/build/utils/commonCodeMod.js +2 -10
  163. package/build/utils/commonCodeMod.js.map +1 -1
  164. package/build/utils/errors.d.ts +1 -1
  165. package/build/utils/errors.js +3 -11
  166. package/build/utils/errors.js.map +1 -1
  167. package/build/utils/fs.js +1 -12
  168. package/build/utils/fs.js.map +1 -1
  169. package/build/utils/generateCode.d.ts +1 -1
  170. package/build/utils/generateCode.js +8 -25
  171. package/build/utils/generateCode.js.map +1 -1
  172. package/build/utils/history.d.ts +1 -1
  173. package/build/utils/history.js +0 -6
  174. package/build/utils/history.js.map +1 -1
  175. package/build/utils/matchBrackets.d.ts +3 -3
  176. package/build/utils/matchBrackets.js +2 -17
  177. package/build/utils/matchBrackets.js.map +1 -1
  178. package/build/utils/modules.js +0 -10
  179. package/build/utils/modules.js.map +1 -1
  180. package/build/utils/obj.js +0 -4
  181. package/build/utils/obj.js.map +1 -1
  182. package/build/utils/plugin-resolver.js +25 -69
  183. package/build/utils/plugin-resolver.js.map +1 -1
  184. package/build/utils/sortObject.js +4 -10
  185. package/build/utils/sortObject.js.map +1 -1
  186. package/build/utils/versions.js +0 -10
  187. package/build/utils/versions.js.map +1 -1
  188. package/build/utils/warnings.js +1 -9
  189. package/build/utils/warnings.js.map +1 -1
  190. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"obj.js","names":["get","obj","key","branches","split","current","branch","shift","undefined"],"sources":["../../src/utils/obj.ts"],"sourcesContent":["/** `lodash.get` */\nexport function get(obj: any, key: string): any {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (!(branch in current)) {\n return undefined;\n }\n current = current[branch];\n }\n return current;\n}\n"],"mappings":";;;;;;;AAAA;AACO,SAASA,GAAT,CAAaC,GAAb,EAAuBC,GAAvB,EAAyC;EAC9C,MAAMC,QAAQ,GAAGD,GAAG,CAACE,KAAJ,CAAU,GAAV,CAAjB;EACA,IAAIC,OAAY,GAAGJ,GAAnB;EACA,IAAIK,MAAJ;;EACA,OAAQA,MAAM,GAAGH,QAAQ,CAACI,KAAT,EAAjB,EAAoC;IAClC,IAAI,EAAED,MAAM,IAAID,OAAZ,CAAJ,EAA0B;MACxB,OAAOG,SAAP;IACD;;IACDH,OAAO,GAAGA,OAAO,CAACC,MAAD,CAAjB;EACD;;EACD,OAAOD,OAAP;AACD"}
1
+ {"version":3,"file":"obj.js","names":["get","obj","key","branches","split","current","branch","shift","undefined"],"sources":["../../src/utils/obj.ts"],"sourcesContent":["/** `lodash.get` */\nexport function get(obj: any, key: string): any {\n const branches = key.split('.');\n let current: any = obj;\n let branch: string | undefined;\n while ((branch = branches.shift())) {\n if (!(branch in current)) {\n return undefined;\n }\n current = current[branch];\n }\n return current;\n}\n"],"mappings":";;;;;;AAAA;AACO,SAASA,GAAG,CAACC,GAAQ,EAAEC,GAAW,EAAO;EAC9C,MAAMC,QAAQ,GAAGD,GAAG,CAACE,KAAK,CAAC,GAAG,CAAC;EAC/B,IAAIC,OAAY,GAAGJ,GAAG;EACtB,IAAIK,MAA0B;EAC9B,OAAQA,MAAM,GAAGH,QAAQ,CAACI,KAAK,EAAE,EAAG;IAClC,IAAI,EAAED,MAAM,IAAID,OAAO,CAAC,EAAE;MACxB,OAAOG,SAAS;IAClB;IACAH,OAAO,GAAGA,OAAO,CAACC,MAAM,CAAC;EAC3B;EACA,OAAOD,OAAO;AAChB"}
@@ -11,199 +11,160 @@ exports.resolveConfigPluginExport = resolveConfigPluginExport;
11
11
  exports.resolveConfigPluginFunction = resolveConfigPluginFunction;
12
12
  exports.resolveConfigPluginFunctionWithInfo = resolveConfigPluginFunctionWithInfo;
13
13
  exports.resolvePluginForModule = resolvePluginForModule;
14
-
15
14
  function _assert() {
16
15
  const data = _interopRequireDefault(require("assert"));
17
-
18
16
  _assert = function () {
19
17
  return data;
20
18
  };
21
-
22
19
  return data;
23
20
  }
24
-
25
21
  function _findUp() {
26
22
  const data = _interopRequireDefault(require("find-up"));
27
-
28
23
  _findUp = function () {
29
24
  return data;
30
25
  };
31
-
32
26
  return data;
33
27
  }
34
-
35
28
  function path() {
36
29
  const data = _interopRequireWildcard(require("path"));
37
-
38
30
  path = function () {
39
31
  return data;
40
32
  };
41
-
42
33
  return data;
43
34
  }
44
-
45
35
  function _resolveFrom() {
46
36
  const data = _interopRequireDefault(require("resolve-from"));
47
-
48
37
  _resolveFrom = function () {
49
38
  return data;
50
39
  };
51
-
52
40
  return data;
53
41
  }
54
-
55
42
  function _errors() {
56
43
  const data = require("./errors");
57
-
58
44
  _errors = function () {
59
45
  return data;
60
46
  };
61
-
62
47
  return data;
63
48
  }
64
-
65
49
  function _modules() {
66
50
  const data = require("./modules");
67
-
68
51
  _modules = function () {
69
52
  return data;
70
53
  };
71
-
72
54
  return data;
73
55
  }
74
-
75
56
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
76
-
77
57
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
78
-
79
58
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
80
-
81
59
  // Default plugin entry file name.
82
60
  const pluginFileName = 'app.plugin.js';
83
61
  exports.pluginFileName = pluginFileName;
84
-
85
62
  function findUpPackageJson(root) {
86
63
  const packageJson = _findUp().default.sync('package.json', {
87
64
  cwd: root
88
65
  });
89
-
90
66
  (0, _assert().default)(packageJson, `No package.json found for module "${root}"`);
91
67
  return packageJson;
92
68
  }
93
-
94
69
  function resolvePluginForModule(projectRoot, modulePath) {
95
70
  const resolved = _resolveFrom().default.silent(projectRoot, modulePath);
96
-
97
71
  if (!resolved) {
98
72
  throw new (_errors().PluginError)(`Failed to resolve plugin for module "${modulePath}" relative to "${projectRoot}"`, 'PLUGIN_NOT_FOUND');
99
- } // If the modulePath is something like `@bacon/package/index.js` or `expo-foo/build/app`
73
+ }
74
+ // If the modulePath is something like `@bacon/package/index.js` or `expo-foo/build/app`
100
75
  // then skip resolving the module `app.plugin.js`
101
-
102
-
103
76
  if (moduleNameIsDirectFileReference(modulePath)) {
104
77
  return {
105
78
  isPluginFile: false,
106
79
  filePath: resolved
107
80
  };
108
81
  }
109
-
110
82
  return findUpPlugin(resolved);
111
- } // TODO: Test windows
112
-
83
+ }
113
84
 
85
+ // TODO: Test windows
114
86
  function pathIsFilePath(name) {
115
87
  // Matches lines starting with: . / ~/
116
88
  return !!name.match(/^(\.|~\/|\/)/g);
117
89
  }
118
-
119
90
  function moduleNameIsDirectFileReference(name) {
120
91
  var _name$split;
121
-
122
92
  if (pathIsFilePath(name)) {
123
93
  return true;
124
94
  }
125
-
126
- const slashCount = (_name$split = name.split(path().sep)) === null || _name$split === void 0 ? void 0 : _name$split.length; // Orgs (like @expo/config ) should have more than one slash to be a direct file.
127
-
95
+ const slashCount = (_name$split = name.split(path().sep)) === null || _name$split === void 0 ? void 0 : _name$split.length;
96
+ // Orgs (like @expo/config ) should have more than one slash to be a direct file.
128
97
  if (name.startsWith('@')) {
129
98
  return slashCount > 2;
130
- } // Regular packages should be considered direct reference if they have more than one slash.
131
-
99
+ }
132
100
 
101
+ // Regular packages should be considered direct reference if they have more than one slash.
133
102
  return slashCount > 1;
134
103
  }
135
-
136
104
  function resolveExpoPluginFile(root) {
137
105
  // Find the expo plugin root file
138
- const pluginModuleFile = _resolveFrom().default.silent(root, // use ./ so it isn't resolved as a node module
139
- `./${pluginFileName}`); // If the default expo plugin file exists use it.
140
-
106
+ const pluginModuleFile = _resolveFrom().default.silent(root,
107
+ // use ./ so it isn't resolved as a node module
108
+ `./${pluginFileName}`);
141
109
 
110
+ // If the default expo plugin file exists use it.
142
111
  if (pluginModuleFile && (0, _modules().fileExists)(pluginModuleFile)) {
143
112
  return pluginModuleFile;
144
113
  }
145
-
146
114
  return null;
147
115
  }
148
-
149
116
  function findUpPlugin(root) {
150
117
  // Get the closest package.json to the node module
151
- const packageJson = findUpPackageJson(root); // resolve the root folder for the node module
152
-
153
- const moduleRoot = path().dirname(packageJson); // use whatever the initial resolved file was ex: `node_modules/my-package/index.js` or `./something.js`
154
-
118
+ const packageJson = findUpPackageJson(root);
119
+ // resolve the root folder for the node module
120
+ const moduleRoot = path().dirname(packageJson);
121
+ // use whatever the initial resolved file was ex: `node_modules/my-package/index.js` or `./something.js`
155
122
  const pluginFile = resolveExpoPluginFile(moduleRoot);
156
123
  return {
157
124
  filePath: pluginFile !== null && pluginFile !== void 0 ? pluginFile : root,
158
125
  isPluginFile: !!pluginFile
159
126
  };
160
127
  }
161
-
162
128
  function normalizeStaticPlugin(plugin) {
163
129
  if (Array.isArray(plugin)) {
164
130
  (0, _assert().default)(plugin.length > 0 && plugin.length < 3, `Wrong number of arguments provided for static config plugin, expected either 1 or 2, got ${plugin.length}`);
165
131
  return plugin;
166
132
  }
167
-
168
133
  return [plugin, undefined];
169
134
  }
170
-
171
135
  function assertInternalProjectRoot(projectRoot) {
172
136
  (0, _assert().default)(projectRoot, `Unexpected: Config \`_internal.projectRoot\` isn't defined by expo-cli, this is a bug.`);
173
- } // Resolve the module function and assert type
174
-
137
+ }
175
138
 
139
+ // Resolve the module function and assert type
176
140
  function resolveConfigPluginFunction(projectRoot, pluginReference) {
177
141
  const {
178
142
  plugin
179
143
  } = resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference);
180
144
  return plugin;
181
- } // Resolve the module function and assert type
182
-
145
+ }
183
146
 
147
+ // Resolve the module function and assert type
184
148
  function resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference) {
185
149
  const {
186
150
  filePath: pluginFile,
187
151
  isPluginFile
188
152
  } = resolvePluginForModule(projectRoot, pluginReference);
189
153
  let result;
190
-
191
154
  try {
192
155
  result = requirePluginFile(pluginFile);
193
156
  } catch (error) {
194
157
  if (error instanceof SyntaxError) {
195
- const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`; // 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.
196
-
158
+ const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;
159
+ // 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.
197
160
  if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {
198
161
  const pluginError = new (_errors().PluginError)(`Package "${pluginReference}" does not contain a valid config plugin.\n${learnMoreLink}\n\n${error.message}`, 'INVALID_PLUGIN_IMPORT');
199
162
  pluginError.stack = error.stack;
200
163
  throw pluginError;
201
164
  }
202
165
  }
203
-
204
166
  throw error;
205
167
  }
206
-
207
168
  const plugin = resolveConfigPluginExport({
208
169
  plugin: result,
209
170
  pluginFile,
@@ -217,6 +178,7 @@ function resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference) {
217
178
  isPluginFile
218
179
  };
219
180
  }
181
+
220
182
  /**
221
183
  * - Resolve the exported contents of an Expo config (be it default or module.exports)
222
184
  * - Assert no promise exports
@@ -228,8 +190,6 @@ function resolveConfigPluginFunctionWithInfo(projectRoot, pluginReference) {
228
190
  * @param props.pluginReference the string used to reference the plugin
229
191
  * @param props.isPluginFile is file path from the app.plugin.js module root
230
192
  */
231
-
232
-
233
193
  function resolveConfigPluginExport({
234
194
  plugin,
235
195
  pluginFile,
@@ -239,20 +199,16 @@ function resolveConfigPluginExport({
239
199
  if (plugin.default != null) {
240
200
  plugin = plugin.default;
241
201
  }
242
-
243
202
  if (typeof plugin !== 'function') {
244
- const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`; // 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.
245
-
203
+ const learnMoreLink = `Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin`;
204
+ // 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.
246
205
  if (!isPluginFile && !moduleNameIsDirectFileReference(pluginReference)) {
247
206
  throw new (_errors().PluginError)(`Package "${pluginReference}" does not contain a valid config plugin. Module must export a function from file: ${pluginFile}\n${learnMoreLink}`, 'INVALID_PLUGIN_TYPE');
248
207
  }
249
-
250
208
  throw new (_errors().PluginError)(`Plugin "${pluginReference}" must export a function from file: ${pluginFile}. ${learnMoreLink}`, 'INVALID_PLUGIN_TYPE');
251
209
  }
252
-
253
210
  return plugin;
254
211
  }
255
-
256
212
  function requirePluginFile(filePath) {
257
213
  try {
258
214
  return require(filePath);
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-resolver.js","names":["pluginFileName","findUpPackageJson","root","packageJson","findUp","sync","cwd","assert","resolvePluginForModule","projectRoot","modulePath","resolved","resolveFrom","silent","PluginError","moduleNameIsDirectFileReference","isPluginFile","filePath","findUpPlugin","pathIsFilePath","name","match","slashCount","split","path","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","default","require"],"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 { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { PluginError } from './errors';\nimport { fileExists } from './modules';\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;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;AAEA;AACO,MAAMA,cAAc,GAAG,eAAvB;;;AAEP,SAASC,iBAAT,CAA2BC,IAA3B,EAAiD;EAC/C,MAAMC,WAAW,GAAGC,iBAAA,CAAOC,IAAP,CAAY,cAAZ,EAA4B;IAAEC,GAAG,EAAEJ;EAAP,CAA5B,CAApB;;EACA,IAAAK,iBAAA,EAAOJ,WAAP,EAAqB,qCAAoCD,IAAK,GAA9D;EACA,OAAOC,WAAP;AACD;;AAEM,SAASK,sBAAT,CAAgCC,WAAhC,EAAqDC,UAArD,EAAyE;EAC9E,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1F,EAEJ,qBAFI,CAAN;EAID;;EAED,OAAOZ,MAAP;AACD;;AAED,SAASS,iBAAT,CAA2B3B,QAA3B,EAAkD;EAChD,IAAI;IACF,OAAOoC,OAAO,CAACpC,QAAD,CAAd;EACD,CAFD,CAEE,OAAO4B,KAAP,EAAc;IACd;IACA,MAAMA,KAAN;EACD;AACF"}
1
+ {"version":3,"file":"plugin-resolver.js","names":["pluginFileName","findUpPackageJson","root","packageJson","findUp","sync","cwd","assert","resolvePluginForModule","projectRoot","modulePath","resolved","resolveFrom","silent","PluginError","moduleNameIsDirectFileReference","isPluginFile","filePath","findUpPlugin","pathIsFilePath","name","match","slashCount","split","path","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","default","require"],"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 { ConfigPlugin, StaticPlugin } from '../Plugin.types';\nimport { PluginError } from './errors';\nimport { fileExists } from './modules';\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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAuC;AAAA;AAAA;AAEvC;AACO,MAAMA,cAAc,GAAG,eAAe;AAAC;AAE9C,SAASC,iBAAiB,CAACC,IAAY,EAAU;EAC/C,MAAMC,WAAW,GAAGC,iBAAM,CAACC,IAAI,CAAC,cAAc,EAAE;IAAEC,GAAG,EAAEJ;EAAK,CAAC,CAAC;EAC9D,IAAAK,iBAAM,EAACJ,WAAW,EAAG,qCAAoCD,IAAK,GAAE,CAAC;EACjE,OAAOC,WAAW;AACpB;AAEO,SAASK,sBAAsB,CAACC,WAAmB,EAAEC,UAAkB,EAAE;EAC9E,MAAMC,QAAQ,GAAGC,sBAAW,CAACC,MAAM,CAACJ,WAAW,EAAEC,UAAU,CAAC;EAC5D,IAAI,CAACC,QAAQ,EAAE;IACb,MAAM,KAAIG,qBAAW,EAClB,wCAAuCJ,UAAW,kBAAiBD,WAAY,GAAE,EAClF,kBAAkB,CACnB;EACH;EACA;EACA;EACA,IAAIM,+BAA+B,CAACL,UAAU,CAAC,EAAE;IAC/C,OAAO;MAAEM,YAAY,EAAE,KAAK;MAAEC,QAAQ,EAAEN;IAAS,CAAC;EACpD;EACA,OAAOO,YAA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Q,eAAe;IACfzB;EACF,CAAC,CAAC;EACF,OAAO;IAAEmB,MAAM;IAAEF,UAAU;IAAEQ,eAAe;IAAEzB;EAAa,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASmC,yBAAyB,CAAC;EACxChB,MAAM;EACNF,UAAU;EACVQ,eAAe;EACfzB;AAMF,CAAC,EAAyB;EACxB,IAAImB,MAAM,CAACiB,OAAO,IAAI,IAAI,EAAE;IAC1BjB,MAAM,GAAGA,MAAM,CAACiB,OAAO;EACzB;EACA,IAAI,OAAOjB,MAAM,KAAK,UAAU,EAAE;IAChC,MAAMY,aAAa,GAAI,4EAA2E;IAClG;IACA,IAAI,CAAC/B,YAAY,IAAI,CAACD,+BAA+B,CAAC0B,eAAe,CAAC,EAAE;MACtE,MAAM,KAAI3B,qBAAW,EAClB,YAAW2B,eAAgB,sFAAqFR,UAAW,KAAIc,aAAc,EAAC,EAC/I,qBAAqB,CACtB;IACH;IACA,MAAM,KAAIjC,qBAAW,EAClB,WAAU2B,eAAgB,uCAAsCR,UAAW,KAAIc,aAAc,EAAC,EAC/F,qBAAqB,CACtB;EACH;EAEA,OAAOZ,MAAM;AACf;AAEA,SAASS,iBAAiB,CAAC3B,QAAgB,EAAO;EAChD,IAAI;IACF,OAAOoC,OAAO,CAACpC,QAAQ,CAAC;EAC1B,CAAC,CAAC,OAAO4B,KAAK,EAAE;IACd;IACA,MAAMA,KAAK;EACb;AACF"}
@@ -7,42 +7,36 @@ exports.reverseSortString = void 0;
7
7
  exports.sortObjWithOrder = sortObjWithOrder;
8
8
  exports.sortObject = sortObject;
9
9
  exports.sortWithOrder = sortWithOrder;
10
-
11
10
  function sortObject(obj, compareFn) {
12
- return Object.keys(obj).sort(compareFn).reduce((acc, key) => ({ ...acc,
11
+ return Object.keys(obj).sort(compareFn).reduce((acc, key) => ({
12
+ ...acc,
13
13
  [key]: obj[key]
14
14
  }), {});
15
15
  }
16
-
17
16
  function sortObjWithOrder(obj, order) {
18
17
  const sorted = sortWithOrder(Object.keys(obj), order);
19
- return sorted.reduce((acc, key) => ({ ...acc,
18
+ return sorted.reduce((acc, key) => ({
19
+ ...acc,
20
20
  [key]: obj[key]
21
21
  }), {});
22
22
  }
23
-
24
23
  function sortWithOrder(obj, order) {
25
24
  const groupOrder = [...new Set(order.concat(obj))];
26
25
  const sorted = [];
27
-
28
26
  while (groupOrder.length) {
29
27
  const key = groupOrder.shift();
30
28
  const index = obj.indexOf(key);
31
-
32
29
  if (index > -1) {
33
30
  const [item] = obj.splice(index, 1);
34
31
  sorted.push(item);
35
32
  }
36
33
  }
37
-
38
34
  return sorted;
39
35
  }
40
-
41
36
  const reverseSortString = (a, b) => {
42
37
  if (a < b) return 1;
43
38
  if (a > b) return -1;
44
39
  return 0;
45
40
  };
46
-
47
41
  exports.reverseSortString = reverseSortString;
48
42
  //# sourceMappingURL=sortObject.js.map
@@ -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"],"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,UAAT,CACLC,GADK,EAELC,SAFK,EAGF;EACH,OAAOC,MAAM,CAACC,IAAP,CAAYH,GAAZ,EACJI,IADI,CACCH,SADD,EAEJI,MAFI,CAGH,CAACC,GAAD,EAAMC,GAAN,MAAe,EACb,GAAGD,GADU;IAEb,CAACC,GAAD,GAAOP,GAAG,CAACO,GAAD;EAFG,CAAf,CAHG,EAOH,EAPG,CAAP;AASD;;AAEM,SAASC,gBAAT,CACLR,GADK,EAELS,KAFK,EAGF;EACH,MAAMC,MAAM,GAAGC,aAAa,CAACT,MAAM,CAACC,IAAP,CAAYH,GAAZ,CAAD,EAAmBS,KAAnB,CAA5B;EAEA,OAAOC,MAAM,CAACL,MAAP,CACL,CAACC,GAAD,EAAMC,GAAN,MAAe,EACb,GAAGD,GADU;IAEb,CAACC,GAAD,GAAOP,GAAG,CAACO,GAAD;EAFG,CAAf,CADK,EAKL,EALK,CAAP;AAOD;;AAEM,SAASI,aAAT,CAAuBX,GAAvB,EAAsCS,KAAtC,EAAiE;EACtE,MAAMG,UAAU,GAAG,CAAC,GAAG,IAAIC,GAAJ,CAAQJ,KAAK,CAACK,MAAN,CAAad,GAAb,CAAR,CAAJ,CAAnB;EACA,MAAMU,MAAgB,GAAG,EAAzB;;EAEA,OAAOE,UAAU,CAACG,MAAlB,EAA0B;IACxB,MAAMR,GAAG,GAAGK,UAAU,CAACI,KAAX,EAAZ;IACA,MAAMC,KAAK,GAAGjB,GAAG,CAACkB,OAAJ,CAAYX,GAAZ,CAAd;;IACA,IAAIU,KAAK,GAAG,CAAC,CAAb,EAAgB;MACd,MAAM,CAACE,IAAD,IAASnB,GAAG,CAACoB,MAAJ,CAAWH,KAAX,EAAkB,CAAlB,CAAf;MACAP,MAAM,CAACW,IAAP,CAAYF,IAAZ;IACD;EACF;;EAED,OAAOT,MAAP;AACD;;AAEM,MAAMY,iBAAiB,GAAG,CAACC,CAAD,EAAYC,CAAZ,KAA0B;EACzD,IAAID,CAAC,GAAGC,CAAR,EAAW,OAAO,CAAP;EACX,IAAID,CAAC,GAAGC,CAAR,EAAW,OAAO,CAAC,CAAR;EACX,OAAO,CAAP;AACD,CAJM"}
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"],"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,UAAU,CACxBC,GAAM,EACNC,SAA4C,EACzC;EACH,OAAOC,MAAM,CAACC,IAAI,CAACH,GAAG,CAAC,CACpBI,IAAI,CAACH,SAAS,CAAC,CACfI,MAA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Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.gteSdkVersion = gteSdkVersion;
7
7
  exports.lteSdkVersion = lteSdkVersion;
8
-
9
8
  function _semver() {
10
9
  const data = _interopRequireDefault(require("semver"));
11
-
12
10
  _semver = function () {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
-
21
16
  function gteSdkVersion(exp, sdkVersion) {
22
17
  if (!exp.sdkVersion) {
23
18
  return false;
24
19
  }
25
-
26
20
  if (exp.sdkVersion === 'UNVERSIONED') {
27
21
  return true;
28
22
  }
29
-
30
23
  try {
31
24
  return _semver().default.gte(exp.sdkVersion, sdkVersion);
32
25
  } catch {
33
26
  throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);
34
27
  }
35
28
  }
36
-
37
29
  function lteSdkVersion(exp, sdkVersion) {
38
30
  if (!exp.sdkVersion) {
39
31
  return false;
40
32
  }
41
-
42
33
  if (exp.sdkVersion === 'UNVERSIONED') {
43
34
  return false;
44
35
  }
45
-
46
36
  try {
47
37
  return _semver().default.lte(exp.sdkVersion, sdkVersion);
48
38
  } catch {
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","names":["gteSdkVersion","exp","sdkVersion","semver","gte","Error","lteSdkVersion","lte"],"sources":["../../src/utils/versions.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport semver from 'semver';\n\nexport function gteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return true;\n }\n\n try {\n return semver.gte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n\nexport function lteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return false;\n }\n\n try {\n return semver.lte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n"],"mappings":";;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEO,SAASA,aAAT,CAAuBC,GAAvB,EAA4DC,UAA5D,EAAyF;EAC9F,IAAI,CAACD,GAAG,CAACC,UAAT,EAAqB;IACnB,OAAO,KAAP;EACD;;EAED,IAAID,GAAG,CAACC,UAAJ,KAAmB,aAAvB,EAAsC;IACpC,OAAO,IAAP;EACD;;EAED,IAAI;IACF,OAAOC,iBAAA,CAAOC,GAAP,CAAWH,GAAG,CAACC,UAAf,EAA2BA,UAA3B,CAAP;EACD,CAFD,CAEE,MAAM;IACN,MAAM,IAAIG,KAAJ,CAAW,GAAEJ,GAAG,CAACC,UAAW,uDAA5B,CAAN;EACD;AACF;;AAEM,SAASI,aAAT,CAAuBL,GAAvB,EAA4DC,UAA5D,EAAyF;EAC9F,IAAI,CAACD,GAAG,CAACC,UAAT,EAAqB;IACnB,OAAO,KAAP;EACD;;EAED,IAAID,GAAG,CAACC,UAAJ,KAAmB,aAAvB,EAAsC;IACpC,OAAO,KAAP;EACD;;EAED,IAAI;IACF,OAAOC,iBAAA,CAAOI,GAAP,CAAWN,GAAG,CAACC,UAAf,EAA2BA,UAA3B,CAAP;EACD,CAFD,CAEE,MAAM;IACN,MAAM,IAAIG,KAAJ,CAAW,GAAEJ,GAAG,CAACC,UAAW,uDAA5B,CAAN;EACD;AACF"}
1
+ {"version":3,"file":"versions.js","names":["gteSdkVersion","exp","sdkVersion","semver","gte","Error","lteSdkVersion","lte"],"sources":["../../src/utils/versions.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport semver from 'semver';\n\nexport function gteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return true;\n }\n\n try {\n return semver.gte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n\nexport function lteSdkVersion(exp: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!exp.sdkVersion) {\n return false;\n }\n\n if (exp.sdkVersion === 'UNVERSIONED') {\n return false;\n }\n\n try {\n return semver.lte(exp.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${exp.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n"],"mappings":";;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4B;AAErB,SAASA,aAAa,CAACC,GAAmC,EAAEC,UAAkB,EAAW;EAC9F,IAAI,CAACD,GAAG,CAACC,UAAU,EAAE;IACnB,OAAO,KAAK;EACd;EAEA,IAAID,GAAG,CAACC,UAAU,KAAK,aAAa,EAAE;IACpC,OAAO,IAAI;EACb;EAEA,IAAI;IACF,OAAOC,iBAAM,CAACC,GAAG,CAACH,GAAG,CAACC,UAAU,EAAEA,UAAU,CAAC;EAC/C,CAAC,CAAC,MAAM;IACN,MAAM,IAAIG,KAAK,CAAE,GAAEJ,GAAG,CAACC,UAAW,uDAAsD,CAAC;EAC3F;AACF;AAEO,SAASI,aAAa,CAACL,GAAmC,EAAEC,UAAkB,EAAW;EAC9F,IAAI,CAACD,GAAG,CAACC,UAAU,EAAE;IACnB,OAAO,KAAK;EACd;EAEA,IAAID,GAAG,CAACC,UAAU,KAAK,aAAa,EAAE;IACpC,OAAO,KAAK;EACd;EAEA,IAAI;IACF,OAAOC,iBAAM,CAACI,GAAG,CAACN,GAAG,CAACC,UAAU,EAAEA,UAAU,CAAC;EAC/C,CAAC,CAAC,MAAM;IACN,MAAM,IAAIG,KAAK,CAAE,GAAEJ,GAAG,CAACC,UAAW,uDAAsD,CAAC;EAC3F;AACF"}
@@ -6,19 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.addWarningAndroid = addWarningAndroid;
7
7
  exports.addWarningForPlatform = addWarningForPlatform;
8
8
  exports.addWarningIOS = addWarningIOS;
9
-
10
9
  function _chalk() {
11
10
  const data = _interopRequireDefault(require("chalk"));
12
-
13
11
  _chalk = function () {
14
12
  return data;
15
13
  };
16
-
17
14
  return data;
18
15
  }
19
-
20
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
17
  /**
23
18
  * Log a warning that doesn't disrupt the spinners.
24
19
  *
@@ -33,6 +28,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
33
28
  function addWarningAndroid(property, text, link) {
34
29
  console.warn(formatWarning('android', property, text, link));
35
30
  }
31
+
36
32
  /**
37
33
  * Log a warning that doesn't disrupt the spinners.
38
34
  *
@@ -44,16 +40,12 @@ function addWarningAndroid(property, text, link) {
44
40
  * @param text Main warning message
45
41
  * @param link Useful link to resources related to the warning
46
42
  */
47
-
48
-
49
43
  function addWarningIOS(property, text, link) {
50
44
  console.warn(formatWarning('ios', property, text, link));
51
45
  }
52
-
53
46
  function addWarningForPlatform(platform, property, text, link) {
54
47
  console.warn(formatWarning(platform, property, text, link));
55
48
  }
56
-
57
49
  function formatWarning(platform, property, warning, link) {
58
50
  return _chalk().default.yellow`${'» ' + _chalk().default.bold(platform)}: ${property}: ${warning}${link ? _chalk().default.gray(' ' + link) : ''}`;
59
51
  }
@@ -1 +1 @@
1
- {"version":3,"file":"warnings.js","names":["addWarningAndroid","property","text","link","console","warn","formatWarning","addWarningIOS","addWarningForPlatform","platform","warning","chalk","yellow","bold","gray"],"sources":["../../src/utils/warnings.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { ModPlatform } from '../Plugin.types';\n\n/**\n * Log a warning that doesn't disrupt the spinners.\n *\n * ```sh\n * » android: android.package: property is invalid https://expo.fyi/android-package\n * ```\n *\n * @param property Name of the config property that triggered the warning (best-effort)\n * @param text Main warning message\n * @param link Useful link to resources related to the warning\n */\nexport function addWarningAndroid(property: string, text: string, link?: string) {\n console.warn(formatWarning('android', property, text, link));\n}\n\n/**\n * Log a warning that doesn't disrupt the spinners.\n *\n * ```sh\n * » ios: ios.bundleIdentifier: property is invalid https://expo.fyi/bundle-identifier\n * ```\n *\n * @param property Name of the config property that triggered the warning (best-effort)\n * @param text Main warning message\n * @param link Useful link to resources related to the warning\n */\nexport function addWarningIOS(property: string, text: string, link?: string) {\n console.warn(formatWarning('ios', property, text, link));\n}\n\nexport function addWarningForPlatform(\n platform: ModPlatform,\n property: string,\n text: string,\n link?: string\n) {\n console.warn(formatWarning(platform, property, text, link));\n}\n\nfunction formatWarning(platform: string, property: string, warning: string, link?: string) {\n return chalk.yellow`${'» ' + chalk.bold(platform)}: ${property}: ${warning}${\n link ? chalk.gray(' ' + link) : ''\n }`;\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAT,CAA2BC,QAA3B,EAA6CC,IAA7C,EAA2DC,IAA3D,EAA0E;EAC/EC,OAAO,CAACC,IAAR,CAAaC,aAAa,CAAC,SAAD,EAAYL,QAAZ,EAAsBC,IAAtB,EAA4BC,IAA5B,CAA1B;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,aAAT,CAAuBN,QAAvB,EAAyCC,IAAzC,EAAuDC,IAAvD,EAAsE;EAC3EC,OAAO,CAACC,IAAR,CAAaC,aAAa,CAAC,KAAD,EAAQL,QAAR,EAAkBC,IAAlB,EAAwBC,IAAxB,CAA1B;AACD;;AAEM,SAASK,qBAAT,CACLC,QADK,EAELR,QAFK,EAGLC,IAHK,EAILC,IAJK,EAKL;EACAC,OAAO,CAACC,IAAR,CAAaC,aAAa,CAACG,QAAD,EAAWR,QAAX,EAAqBC,IAArB,EAA2BC,IAA3B,CAA1B;AACD;;AAED,SAASG,aAAT,CAAuBG,QAAvB,EAAyCR,QAAzC,EAA2DS,OAA3D,EAA4EP,IAA5E,EAA2F;EACzF,OAAOQ,gBAAA,CAAMC,MAAO,GAAE,OAAOD,gBAAA,CAAME,IAAN,CAAWJ,QAAX,CAAqB,KAAIR,QAAS,KAAIS,OAAQ,GACzEP,IAAI,GAAGQ,gBAAA,CAAMG,IAAN,CAAW,MAAMX,IAAjB,CAAH,GAA4B,EACjC,EAFD;AAGD"}
1
+ {"version":3,"file":"warnings.js","names":["addWarningAndroid","property","text","link","console","warn","formatWarning","addWarningIOS","addWarningForPlatform","platform","warning","chalk","yellow","bold","gray"],"sources":["../../src/utils/warnings.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport { ModPlatform } from '../Plugin.types';\n\n/**\n * Log a warning that doesn't disrupt the spinners.\n *\n * ```sh\n * » android: android.package: property is invalid https://expo.fyi/android-package\n * ```\n *\n * @param property Name of the config property that triggered the warning (best-effort)\n * @param text Main warning message\n * @param link Useful link to resources related to the warning\n */\nexport function addWarningAndroid(property: string, text: string, link?: string) {\n console.warn(formatWarning('android', property, text, link));\n}\n\n/**\n * Log a warning that doesn't disrupt the spinners.\n *\n * ```sh\n * » ios: ios.bundleIdentifier: property is invalid https://expo.fyi/bundle-identifier\n * ```\n *\n * @param property Name of the config property that triggered the warning (best-effort)\n * @param text Main warning message\n * @param link Useful link to resources related to the warning\n */\nexport function addWarningIOS(property: string, text: string, link?: string) {\n console.warn(formatWarning('ios', property, text, link));\n}\n\nexport function addWarningForPlatform(\n platform: ModPlatform,\n property: string,\n text: string,\n link?: string\n) {\n console.warn(formatWarning(platform, property, text, link));\n}\n\nfunction formatWarning(platform: string, property: string, warning: string, link?: string) {\n return chalk.yellow`${'» ' + chalk.bold(platform)}: ${property}: ${warning}${\n link ? chalk.gray(' ' + link) : ''\n }`;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA0B;AAI1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,iBAAiB,CAACC,QAAgB,EAAEC,IAAY,EAAEC,IAAa,EAAE;EAC/EC,OAAO,CAACC,IAAI,CAACC,aAAa,CAAC,SAAS,EAAEL,QAAQ,EAAEC,IAAI,EAAEC,IAAI,CAAC,CAAC;AAC9D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,aAAa,CAACN,QAAgB,EAAEC,IAAY,EAAEC,IAAa,EAAE;EAC3EC,OAAO,CAACC,IAAI,CAACC,aAAa,CAAC,KAAK,EAAEL,QAAQ,EAAEC,IAAI,EAAEC,IAAI,CAAC,CAAC;AAC1D;AAEO,SAASK,qBAAqB,CACnCC,QAAqB,EACrBR,QAAgB,EAChBC,IAAY,EACZC,IAAa,EACb;EACAC,OAAO,CAACC,IAAI,CAACC,aAAa,CAACG,QAAQ,EAAER,QAAQ,EAAEC,IAAI,EAAEC,IAAI,CAAC,CAAC;AAC7D;AAEA,SAASG,aAAa,CAACG,QAAgB,EAAER,QAAgB,EAAES,OAAe,EAAEP,IAAa,EAAE;EACzF,OAAOQ,gBAAK,CAACC,MAAO,GAAE,IAAI,GAAGD,gBAAK,CAACE,IAAI,CAACJ,QAAQ,CAAE,KAAIR,QAAS,KAAIS,OAAQ,GACzEP,IAAI,GAAGQ,gBAAK,CAACG,IAAI,CAAC,GAAG,GAAGX,IAAI,CAAC,GAAG,EACjC,EAAC;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/config-plugins",
3
- "version": "5.0.4",
3
+ "version": "6.0.0",
4
4
  "description": "A library for Expo config plugins",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -32,9 +32,9 @@
32
32
  "paths"
33
33
  ],
34
34
  "dependencies": {
35
- "@expo/config-types": "^47.0.0",
36
- "@expo/json-file": "8.2.36",
37
- "@expo/plist": "0.0.18",
35
+ "@expo/config-types": "^48.0.0",
36
+ "@expo/json-file": "~8.2.37",
37
+ "@expo/plist": "^0.0.20",
38
38
  "@expo/sdk-runtime-versions": "^1.0.0",
39
39
  "@react-native/normalize-color": "^2.0.0",
40
40
  "chalk": "^4.1.2",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
59
+ "gitHead": "1815e2eaad8c753588c7b1eb74420174a28e01f4"
60
60
  }