@expo/config-plugins 4.0.2 → 4.0.7
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/README.md +14 -0
- package/build/Plugin.types.d.ts +4 -0
- package/build/Plugin.types.js.map +1 -1
- package/build/android/Updates.d.ts +10 -10
- package/build/android/Updates.js.map +1 -1
- package/build/android/codeMod.d.ts +20 -0
- package/build/android/codeMod.js +109 -0
- package/build/android/codeMod.js.map +1 -0
- package/build/android/index.d.ts +2 -6
- package/build/android/index.js +1 -86
- package/build/android/index.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/ios/Bitcode.d.ts +33 -0
- package/build/ios/Bitcode.js +131 -0
- package/build/ios/Bitcode.js.map +1 -0
- package/build/ios/Maps.js +1 -0
- package/build/ios/Maps.js.map +1 -1
- package/build/ios/Paths.d.ts +1 -0
- package/build/ios/Paths.js +25 -0
- package/build/ios/Paths.js.map +1 -1
- package/build/ios/Updates.d.ts +10 -10
- package/build/ios/Updates.js.map +1 -1
- package/build/ios/codeMod.d.ts +81 -0
- package/build/ios/codeMod.js +306 -0
- package/build/ios/codeMod.js.map +1 -0
- package/build/ios/index.d.ts +3 -5
- package/build/ios/index.js +6 -57
- package/build/ios/index.js.map +1 -1
- package/build/plugins/android-plugins.d.ts +7 -0
- package/build/plugins/android-plugins.js +19 -2
- package/build/plugins/android-plugins.js.map +1 -1
- package/build/plugins/ios-plugins.d.ts +6 -6
- package/build/plugins/ios-plugins.js.map +1 -1
- package/build/plugins/withAndroidBaseMods.d.ts +2 -0
- package/build/plugins/withAndroidBaseMods.js +32 -0
- package/build/plugins/withAndroidBaseMods.js.map +1 -1
- package/build/plugins/withStaticPlugin.js +16 -5
- package/build/plugins/withStaticPlugin.js.map +1 -1
- package/build/utils/Updates.d.ts +5 -4
- package/build/utils/Updates.js +1 -1
- package/build/utils/Updates.js.map +1 -1
- package/build/utils/commonCodeMod.d.ts +32 -0
- package/build/utils/commonCodeMod.js +71 -0
- package/build/utils/commonCodeMod.js.map +1 -0
- package/build/utils/matchBrackets.d.ts +7 -0
- package/build/utils/matchBrackets.js +80 -0
- package/build/utils/matchBrackets.js.map +1 -0
- package/package.json +3 -3
- package/build/android/Branch.d.ts +0 -5
- package/build/android/Branch.js +0 -54
- package/build/android/Branch.js.map +0 -1
- package/build/android/Facebook.d.ts +0 -13
- package/build/android/Facebook.js +0 -236
- package/build/android/Facebook.js.map +0 -1
- package/build/android/NavigationBar.d.ts +0 -9
- package/build/android/NavigationBar.js +0 -141
- package/build/android/NavigationBar.js.map +0 -1
- package/build/android/RootViewBackgroundColor.d.ts +0 -6
- package/build/android/RootViewBackgroundColor.js +0 -81
- package/build/android/RootViewBackgroundColor.js.map +0 -1
- package/build/android/UserInterfaceStyle.d.ts +0 -11
- package/build/android/UserInterfaceStyle.js +0 -125
- package/build/android/UserInterfaceStyle.js.map +0 -1
- package/build/ios/Branch.d.ts +0 -5
- package/build/ios/Branch.js +0 -42
- package/build/ios/Branch.js.map +0 -1
- package/build/ios/Facebook.d.ts +0 -176
- package/build/ios/Facebook.js +0 -232
- package/build/ios/Facebook.js.map +0 -1
- package/build/ios/RootViewBackgroundColor.d.ts +0 -6
- package/build/ios/RootViewBackgroundColor.js +0 -70
- package/build/ios/RootViewBackgroundColor.js.map +0 -1
- package/build/ios/UserInterfaceStyle.d.ts +0 -5
- package/build/ios/UserInterfaceStyle.js +0 -59
- package/build/ios/UserInterfaceStyle.js.map +0 -1
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.addObjcImports = addObjcImports;
|
|
7
|
+
exports.findObjcInterfaceCodeBlock = findObjcInterfaceCodeBlock;
|
|
8
|
+
exports.findObjcFunctionCodeBlock = findObjcFunctionCodeBlock;
|
|
9
|
+
exports.insertContentsInsideObjcFunctionBlock = insertContentsInsideObjcFunctionBlock;
|
|
10
|
+
exports.insertContentsInsideObjcInterfaceBlock = insertContentsInsideObjcInterfaceBlock;
|
|
11
|
+
exports.findSwiftFunctionCodeBlock = findSwiftFunctionCodeBlock;
|
|
12
|
+
exports.insertContentsInsideSwiftClassBlock = insertContentsInsideSwiftClassBlock;
|
|
13
|
+
exports.insertContentsInsideSwiftFunctionBlock = insertContentsInsideSwiftFunctionBlock;
|
|
14
|
+
|
|
15
|
+
function _commonCodeMod() {
|
|
16
|
+
const data = require("../utils/commonCodeMod");
|
|
17
|
+
|
|
18
|
+
_commonCodeMod = function () {
|
|
19
|
+
return data;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _matchBrackets() {
|
|
26
|
+
const data = require("../utils/matchBrackets");
|
|
27
|
+
|
|
28
|
+
_matchBrackets = function () {
|
|
29
|
+
return data;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return data;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Add Objective-C import
|
|
37
|
+
* @param source source contents
|
|
38
|
+
* @param imports array of imports, e.g. ['<Foundation/Foundation.h>']
|
|
39
|
+
* @returns updated contents
|
|
40
|
+
*/
|
|
41
|
+
function addObjcImports(source, imports) {
|
|
42
|
+
const lines = source.split('\n'); // Try to insert statements after first #import where would probably not in #if block
|
|
43
|
+
|
|
44
|
+
const lineIndexWithFirstImport = lines.findIndex(line => line.match(/^#import .*$/));
|
|
45
|
+
|
|
46
|
+
for (const importElement of imports) {
|
|
47
|
+
if (!source.includes(importElement)) {
|
|
48
|
+
const importStatement = `#import ${importElement}`;
|
|
49
|
+
lines.splice(lineIndexWithFirstImport + 1, 0, importStatement);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return lines.join('\n');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Find code block of Objective-C interface or implementation
|
|
57
|
+
*
|
|
58
|
+
* @param contents source contents
|
|
59
|
+
* @param declaration interface/implementation, e.g. '@interface Foo'
|
|
60
|
+
* @returns found CodeBlock, or null if not found
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
function findObjcInterfaceCodeBlock(contents, declaration) {
|
|
65
|
+
const start = contents.search(new RegExp(`^${declaration}\\W`, 'm'));
|
|
66
|
+
|
|
67
|
+
if (start < 0) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let end = contents.indexOf('\n@end', start);
|
|
72
|
+
end += 5; // '\n@end'.length === 5
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
start,
|
|
76
|
+
end,
|
|
77
|
+
code: contents.substring(start, end)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Find code block of Objective-C function without declaration, will return only {} block
|
|
82
|
+
*
|
|
83
|
+
* @param contents source contents
|
|
84
|
+
* @param selector function selector, e.g. 'doSomething:withSomeValue:'
|
|
85
|
+
* @returns found CodeBlock, or null if not found.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
function findObjcFunctionCodeBlock(contents, selector) {
|
|
90
|
+
const symbols = selector.split(':');
|
|
91
|
+
const argsCount = symbols.length - 1;
|
|
92
|
+
let pattern = '^[\\-+]\\s*\\(.+?\\)';
|
|
93
|
+
|
|
94
|
+
if (argsCount === 0) {
|
|
95
|
+
pattern += `${symbols[0]}\\s+`;
|
|
96
|
+
} else {
|
|
97
|
+
for (let i = 0; i < argsCount; ++i) {
|
|
98
|
+
const argSymbol = `${symbols[i]}:\\(.+\\)\\w+`;
|
|
99
|
+
pattern += `${argSymbol}\\s+`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
pattern += '{';
|
|
104
|
+
let start = contents.search(new RegExp(pattern, 'm'));
|
|
105
|
+
|
|
106
|
+
if (start < 0) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
start = contents.indexOf('{', start);
|
|
111
|
+
const end = (0, _matchBrackets().findMatchingBracketPosition)(contents, '{', start);
|
|
112
|
+
return {
|
|
113
|
+
start,
|
|
114
|
+
end,
|
|
115
|
+
code: contents.substring(start, end + 1)
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Insert contents to the Objective-C function block
|
|
120
|
+
*
|
|
121
|
+
* @param srcContents source contents
|
|
122
|
+
* @param selector function selector, e.g. 'doSomething:withSomeValue:'
|
|
123
|
+
* @param insertion code to insert
|
|
124
|
+
* @param options insertion options
|
|
125
|
+
* @returns updated contents
|
|
126
|
+
*/
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
function insertContentsInsideObjcFunctionBlock(srcContents, selector, insertion, options) {
|
|
130
|
+
return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'objc');
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Insert contents to the Objective-C interface/implementation block
|
|
134
|
+
*
|
|
135
|
+
* @param srcContents source contents
|
|
136
|
+
* @param declaration interface/implementation, e.g. '@interface Foo'
|
|
137
|
+
* @param insertion code to insert
|
|
138
|
+
* @param options insertion options
|
|
139
|
+
* @returns updated contents
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
function insertContentsInsideObjcInterfaceBlock(srcContents, declaration, insertion, options) {
|
|
144
|
+
const codeBlock = findObjcInterfaceCodeBlock(srcContents, declaration);
|
|
145
|
+
|
|
146
|
+
if (!codeBlock) {
|
|
147
|
+
return srcContents;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const {
|
|
151
|
+
position
|
|
152
|
+
} = options;
|
|
153
|
+
|
|
154
|
+
if (position === 'head') {
|
|
155
|
+
const firstNewLineIndex = srcContents.indexOf('\n', codeBlock.start);
|
|
156
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, insertion, firstNewLineIndex);
|
|
157
|
+
} else if (position === 'tail') {
|
|
158
|
+
const endLen = '@end'.length;
|
|
159
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, insertion, codeBlock.end - endLen);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return srcContents;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Find code block of Swift function without declaration, will return only {} block
|
|
166
|
+
*
|
|
167
|
+
* @param contents source contents
|
|
168
|
+
* @param selector function selector, e.g. 'doSomething(_:withSomeValue:)'
|
|
169
|
+
* @returns found CodeBlock, or null if not found.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
function findSwiftFunctionCodeBlock(contents, selector) {
|
|
174
|
+
const parenthesesIndex = selector.indexOf('('); // `functName` === 'doSomething' of 'doSomething(_:withSomeValue:)'
|
|
175
|
+
|
|
176
|
+
const funcName = selector.substring(0, parenthesesIndex); // `argLabels` === ['_', 'withSomeValue'] 'doSomething(_:withSomeValue:)'
|
|
177
|
+
|
|
178
|
+
const argLabels = selector.substring(parenthesesIndex + 1, selector.length - 2).split(':');
|
|
179
|
+
let searchOffset = 0;
|
|
180
|
+
const funcCandidateRegExp = new RegExp(`\\sfunc\\s+${funcName}\\(`, 'm');
|
|
181
|
+
let funcCandidateOffset = (0, _commonCodeMod().searchFromOffset)(contents, funcCandidateRegExp, searchOffset);
|
|
182
|
+
|
|
183
|
+
while (funcCandidateOffset >= 0) {
|
|
184
|
+
// Parse function parameters
|
|
185
|
+
const paramsStartOffset = contents.indexOf('(', funcCandidateOffset);
|
|
186
|
+
const paramsEndOffset = (0, _matchBrackets().findMatchingBracketPosition)(contents, '(', paramsStartOffset);
|
|
187
|
+
const paramsString = contents.substring(paramsStartOffset + 1, paramsEndOffset);
|
|
188
|
+
const params = paramsString.split(',').map(parseSwiftFunctionParam); // Prepare offset for next round
|
|
189
|
+
|
|
190
|
+
searchOffset = paramsEndOffset + 1;
|
|
191
|
+
funcCandidateOffset = (0, _commonCodeMod().searchFromOffset)(contents, funcCandidateRegExp, searchOffset); // Try to match function parameters
|
|
192
|
+
|
|
193
|
+
if (argLabels.length !== params.length) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
for (let i = 0; i < argLabels.length; ++i) {
|
|
198
|
+
if (argLabels[i] !== params[i].argumentLabel) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
} // This function is matched one, get the code block.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
const codeBlockStart = contents.indexOf('{', paramsEndOffset);
|
|
205
|
+
const codeBlockEnd = (0, _matchBrackets().findMatchingBracketPosition)(contents, '{', paramsEndOffset);
|
|
206
|
+
const codeBlock = contents.substring(codeBlockStart, codeBlockEnd + 1);
|
|
207
|
+
return {
|
|
208
|
+
start: codeBlockStart,
|
|
209
|
+
end: codeBlockEnd,
|
|
210
|
+
code: codeBlock
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return null;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function parseSwiftFunctionParam(paramTuple) {
|
|
218
|
+
const semiIndex = paramTuple.indexOf(':');
|
|
219
|
+
const [argumentLabel, parameterName] = paramTuple.substring(0, semiIndex).split(/\s+/);
|
|
220
|
+
const typeString = paramTuple.substring(semiIndex + 1).trim();
|
|
221
|
+
return {
|
|
222
|
+
argumentLabel,
|
|
223
|
+
parameterName,
|
|
224
|
+
typeString
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Insert contents to the swift class block
|
|
229
|
+
*
|
|
230
|
+
* @param srcContents source contents
|
|
231
|
+
* @param declaration class/extension declaration, e.g. 'class AppDelegate'
|
|
232
|
+
* @param insertion code to append
|
|
233
|
+
* @param options insertion options
|
|
234
|
+
* @returns updated contents
|
|
235
|
+
*/
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
function insertContentsInsideSwiftClassBlock(srcContents, declaration, insertion, options) {
|
|
239
|
+
const start = srcContents.search(new RegExp(`\\s*${declaration}.*?[\\(\\{]`));
|
|
240
|
+
|
|
241
|
+
if (start < 0) {
|
|
242
|
+
throw new Error(`Unable to find class code block - declaration[${declaration}]`);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const {
|
|
246
|
+
position
|
|
247
|
+
} = options;
|
|
248
|
+
|
|
249
|
+
if (position === 'head') {
|
|
250
|
+
const firstBracketIndex = srcContents.indexOf('{', start);
|
|
251
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, insertion, firstBracketIndex + 1);
|
|
252
|
+
} else if (position === 'tail') {
|
|
253
|
+
const endBracketIndex = (0, _matchBrackets().findMatchingBracketPosition)(srcContents, '{', start);
|
|
254
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, insertion, endBracketIndex);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return srcContents;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Insert contents to the Swift function block
|
|
261
|
+
*
|
|
262
|
+
* @param srcContents source contents
|
|
263
|
+
* @param selector function selector, e.g. 'doSomething:withSomeValue:'
|
|
264
|
+
* @param insertion code to insert
|
|
265
|
+
* @param options insertion options
|
|
266
|
+
* @returns updated contents
|
|
267
|
+
*/
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
function insertContentsInsideSwiftFunctionBlock(srcContents, selector, insertion, options) {
|
|
271
|
+
return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'swift');
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, language) {
|
|
275
|
+
var _options$indent;
|
|
276
|
+
|
|
277
|
+
const codeBlock = language === 'objc' ? findObjcFunctionCodeBlock(srcContents, selector) : findSwiftFunctionCodeBlock(srcContents, selector);
|
|
278
|
+
|
|
279
|
+
if (!codeBlock) {
|
|
280
|
+
return srcContents;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const {
|
|
284
|
+
position
|
|
285
|
+
} = options;
|
|
286
|
+
const indent = ' '.repeat((_options$indent = options.indent) !== null && _options$indent !== void 0 ? _options$indent : 2);
|
|
287
|
+
|
|
288
|
+
if (position === 'head') {
|
|
289
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, `\n${indent}${insertion}`, codeBlock.start + 1);
|
|
290
|
+
} else if (position === 'tail') {
|
|
291
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, `\n${indent}${insertion}`, codeBlock.end - 1);
|
|
292
|
+
} else if (position === 'tailBeforeLastReturn') {
|
|
293
|
+
let lastReturnIndex = srcContents.lastIndexOf(' return ', codeBlock.end);
|
|
294
|
+
|
|
295
|
+
if (lastReturnIndex < 0) {
|
|
296
|
+
throw new Error(`Cannot find last return statement:\n${srcContents}`);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
lastReturnIndex += 1; // +1 for the prefix space
|
|
300
|
+
|
|
301
|
+
srcContents = (0, _commonCodeMod().insertContentsAtOffset)(srcContents, `${insertion}\n${indent}`, lastReturnIndex);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return srcContents;
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=codeMod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ios/codeMod.ts"],"names":["addObjcImports","source","imports","lines","split","lineIndexWithFirstImport","findIndex","line","match","importElement","includes","importStatement","splice","join","findObjcInterfaceCodeBlock","contents","declaration","start","search","RegExp","end","indexOf","code","substring","findObjcFunctionCodeBlock","selector","symbols","argsCount","length","pattern","i","argSymbol","insertContentsInsideObjcFunctionBlock","srcContents","insertion","options","insertContentsInsideFunctionBlock","insertContentsInsideObjcInterfaceBlock","codeBlock","position","firstNewLineIndex","endLen","findSwiftFunctionCodeBlock","parenthesesIndex","funcName","argLabels","searchOffset","funcCandidateRegExp","funcCandidateOffset","paramsStartOffset","paramsEndOffset","paramsString","params","map","parseSwiftFunctionParam","argumentLabel","codeBlockStart","codeBlockEnd","paramTuple","semiIndex","parameterName","typeString","trim","insertContentsInsideSwiftClassBlock","Error","firstBracketIndex","endBracketIndex","insertContentsInsideSwiftFunctionBlock","language","indent","repeat","lastReturnIndex","lastIndexOf"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAaA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAwBC,MAAxB,EAAwCC,OAAxC,EAAmE;AACxE,QAAMC,KAAK,GAAGF,MAAM,CAACG,KAAP,CAAa,IAAb,CAAd,CADwE,CAExE;;AACA,QAAMC,wBAAwB,GAAGF,KAAK,CAACG,SAAN,CAAgBC,IAAI,IAAIA,IAAI,CAACC,KAAL,CAAW,cAAX,CAAxB,CAAjC;;AACA,OAAK,MAAMC,aAAX,IAA4BP,OAA5B,EAAqC;AACnC,QAAI,CAACD,MAAM,CAACS,QAAP,CAAgBD,aAAhB,CAAL,EAAqC;AACnC,YAAME,eAAe,GAAI,WAAUF,aAAc,EAAjD;AACAN,MAAAA,KAAK,CAACS,MAAN,CAAaP,wBAAwB,GAAG,CAAxC,EAA2C,CAA3C,EAA8CM,eAA9C;AACD;AACF;;AACD,SAAOR,KAAK,CAACU,IAAN,CAAW,IAAX,CAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,0BAAT,CACLC,QADK,EAELC,WAFK,EAGa;AAClB,QAAMC,KAAK,GAAGF,QAAQ,CAACG,MAAT,CAAgB,IAAIC,MAAJ,CAAY,IAAGH,WAAY,KAA3B,EAAiC,GAAjC,CAAhB,CAAd;;AACA,MAAIC,KAAK,GAAG,CAAZ,EAAe;AACb,WAAO,IAAP;AACD;;AAED,MAAIG,GAAG,GAAGL,QAAQ,CAAC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CAACkC,MAAnB,6DAA6B,CAA7B,CAAf;;AAEA,MAAI9B,QAAQ,KAAK,MAAjB,EAAyB;AACvBN,IAAAA,WAAW,GAAG,6CACZA,WADY,EAEX,KAAIoC,MAAO,GAAEnC,SAAU,EAFZ,EAGZI,SAAS,CAACrB,KAAV,GAAkB,CAHN,CAAd;AAKD,GAND,MAMO,IAAIsB,QAAQ,KAAK,MAAjB,EAAyB;AAC9BN,IAAAA,WAAW,GAAG,6CAAuBA,WAAvB,EAAqC,KAAIoC,MAAO,GAAEnC,SAAU,EAA5D,EAA+DI,SAAS,CAAClB,GAAV,GAAgB,CAA/E,CAAd;AACD,GAFM,MAEA,IAAImB,QAAQ,KAAK,sBAAjB,EAAyC;AAC9C,QAAIgC,eAAe,GAAGtC,WAAW,CAACuC,WAAZ,CAAwB,UAAxB,EAAoClC,SAAS,CAAClB,GAA9C,CAAtB;;AACA,QAAImD,eAAe,GAAG,CAAtB,EAAyB;AACvB,YAAM,IAAIP,KAAJ,CAAW,uCAAsC/B,WAAY,EAA7D,CAAN;AACD;;AACDsC,IAAAA,eAAe,IAAI,CAAnB,CAL8C,CAKxB;;AACtBtC,IAAAA,WAAW,GAAG,6CAAuBA,WAAvB,EAAqC,GAAEC,SAAU,KAAImC,MAAO,EAA5D,EAA+DE,eAA/D,CAAd;AACD;;AAED,SAAOtC,WAAP;AACD","sourcesContent":["import { CodeBlock, insertContentsAtOffset, searchFromOffset } from '../utils/commonCodeMod';\nimport { findMatchingBracketPosition } from '../utils/matchBrackets';\n\ninterface SwiftFunctionParam {\n argumentLabel: string;\n parameterName: string;\n typeString: string;\n}\n\ninterface InsertContentFunctionOptions {\n position: 'head' | 'tail' | 'tailBeforeLastReturn';\n indent?: number;\n}\n\n/**\n * Add Objective-C import\n * @param source source contents\n * @param imports array of imports, e.g. ['<Foundation/Foundation.h>']\n * @returns updated contents\n */\nexport function addObjcImports(source: string, imports: string[]): string {\n const lines = source.split('\\n');\n // Try to insert statements after first #import where would probably not in #if block\n const lineIndexWithFirstImport = lines.findIndex(line => line.match(/^#import .*$/));\n for (const importElement of imports) {\n if (!source.includes(importElement)) {\n const importStatement = `#import ${importElement}`;\n lines.splice(lineIndexWithFirstImport + 1, 0, importStatement);\n }\n }\n return lines.join('\\n');\n}\n\n/**\n * Find code block of Objective-C interface or implementation\n *\n * @param contents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @returns found CodeBlock, or null if not found\n */\nexport function findObjcInterfaceCodeBlock(\n contents: string,\n declaration: string\n): CodeBlock | null {\n const start = contents.search(new RegExp(`^${declaration}\\\\W`, 'm'));\n if (start < 0) {\n return null;\n }\n\n let end = contents.indexOf('\\n@end', start);\n end += 5; // '\\n@end'.length === 5\n\n return {\n start,\n end,\n code: contents.substring(start, end),\n };\n}\n\n/**\n * Find code block of Objective-C function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findObjcFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const symbols = selector.split(':');\n const argsCount = symbols.length - 1;\n let pattern = '^[\\\\-+]\\\\s*\\\\(.+?\\\\)';\n if (argsCount === 0) {\n pattern += `${symbols[0]}\\\\s+`;\n } else {\n for (let i = 0; i < argsCount; ++i) {\n const argSymbol = `${symbols[i]}:\\\\(.+\\\\)\\\\w+`;\n pattern += `${argSymbol}\\\\s+`;\n }\n }\n pattern += '{';\n let start = contents.search(new RegExp(pattern, 'm'));\n if (start < 0) {\n return null;\n }\n start = contents.indexOf('{', start);\n\n const end = findMatchingBracketPosition(contents, '{', start);\n return {\n start,\n end,\n code: contents.substring(start, end + 1),\n };\n}\n\n/**\n * Insert contents to the Objective-C function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'objc');\n}\n\n/**\n * Insert contents to the Objective-C interface/implementation block\n *\n * @param srcContents source contents\n * @param declaration interface/implementation, e.g. '@interface Foo'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideObjcInterfaceBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const codeBlock = findObjcInterfaceCodeBlock(srcContents, declaration);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstNewLineIndex = srcContents.indexOf('\\n', codeBlock.start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstNewLineIndex);\n } else if (position === 'tail') {\n const endLen = '@end'.length;\n srcContents = insertContentsAtOffset(srcContents, insertion, codeBlock.end - endLen);\n }\n return srcContents;\n}\n\n/**\n * Find code block of Swift function without declaration, will return only {} block\n *\n * @param contents source contents\n * @param selector function selector, e.g. 'doSomething(_:withSomeValue:)'\n * @returns found CodeBlock, or null if not found.\n */\nexport function findSwiftFunctionCodeBlock(contents: string, selector: string): CodeBlock | null {\n const parenthesesIndex = selector.indexOf('(');\n // `functName` === 'doSomething' of 'doSomething(_:withSomeValue:)'\n const funcName = selector.substring(0, parenthesesIndex);\n // `argLabels` === ['_', 'withSomeValue'] 'doSomething(_:withSomeValue:)'\n const argLabels = selector.substring(parenthesesIndex + 1, selector.length - 2).split(':');\n\n let searchOffset = 0;\n const funcCandidateRegExp = new RegExp(`\\\\sfunc\\\\s+${funcName}\\\\(`, 'm');\n let funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n while (funcCandidateOffset >= 0) {\n // Parse function parameters\n const paramsStartOffset = contents.indexOf('(', funcCandidateOffset);\n const paramsEndOffset = findMatchingBracketPosition(contents, '(', paramsStartOffset);\n const paramsString = contents.substring(paramsStartOffset + 1, paramsEndOffset);\n const params = paramsString.split(',').map(parseSwiftFunctionParam);\n\n // Prepare offset for next round\n searchOffset = paramsEndOffset + 1;\n funcCandidateOffset = searchFromOffset(contents, funcCandidateRegExp, searchOffset);\n\n // Try to match function parameters\n if (argLabels.length !== params.length) {\n continue;\n }\n for (let i = 0; i < argLabels.length; ++i) {\n if (argLabels[i] !== params[i].argumentLabel) {\n continue;\n }\n }\n\n // This function is matched one, get the code block.\n const codeBlockStart = contents.indexOf('{', paramsEndOffset);\n const codeBlockEnd = findMatchingBracketPosition(contents, '{', paramsEndOffset);\n const codeBlock = contents.substring(codeBlockStart, codeBlockEnd + 1);\n return {\n start: codeBlockStart,\n end: codeBlockEnd,\n code: codeBlock,\n };\n }\n\n return null;\n}\n\nfunction parseSwiftFunctionParam(paramTuple: string): SwiftFunctionParam {\n const semiIndex = paramTuple.indexOf(':');\n const [argumentLabel, parameterName] = paramTuple.substring(0, semiIndex).split(/\\s+/);\n const typeString = paramTuple.substring(semiIndex + 1).trim();\n return {\n argumentLabel,\n parameterName,\n typeString,\n };\n}\n\n/**\n * Insert contents to the swift class block\n *\n * @param srcContents source contents\n * @param declaration class/extension declaration, e.g. 'class AppDelegate'\n * @param insertion code to append\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftClassBlock(\n srcContents: string,\n declaration: string,\n insertion: string,\n options: {\n position: 'head' | 'tail';\n }\n): string {\n const start = srcContents.search(new RegExp(`\\\\s*${declaration}.*?[\\\\(\\\\{]`));\n if (start < 0) {\n throw new Error(`Unable to find class code block - declaration[${declaration}]`);\n }\n\n const { position } = options;\n if (position === 'head') {\n const firstBracketIndex = srcContents.indexOf('{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, firstBracketIndex + 1);\n } else if (position === 'tail') {\n const endBracketIndex = findMatchingBracketPosition(srcContents, '{', start);\n srcContents = insertContentsAtOffset(srcContents, insertion, endBracketIndex);\n }\n return srcContents;\n}\n\n/**\n * Insert contents to the Swift function block\n *\n * @param srcContents source contents\n * @param selector function selector, e.g. 'doSomething:withSomeValue:'\n * @param insertion code to insert\n * @param options insertion options\n * @returns updated contents\n */\nexport function insertContentsInsideSwiftFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions\n): string {\n return insertContentsInsideFunctionBlock(srcContents, selector, insertion, options, 'swift');\n}\n\nfunction insertContentsInsideFunctionBlock(\n srcContents: string,\n selector: string,\n insertion: string,\n options: InsertContentFunctionOptions,\n language: 'objc' | 'swift'\n): string {\n const codeBlock =\n language === 'objc'\n ? findObjcFunctionCodeBlock(srcContents, selector)\n : findSwiftFunctionCodeBlock(srcContents, selector);\n if (!codeBlock) {\n return srcContents;\n }\n\n const { position } = options;\n const indent = ' '.repeat(options.indent ?? 2);\n\n if (position === 'head') {\n srcContents = insertContentsAtOffset(\n srcContents,\n `\\n${indent}${insertion}`,\n codeBlock.start + 1\n );\n } else if (position === 'tail') {\n srcContents = insertContentsAtOffset(srcContents, `\\n${indent}${insertion}`, codeBlock.end - 1);\n } else if (position === 'tailBeforeLastReturn') {\n let lastReturnIndex = srcContents.lastIndexOf(' return ', codeBlock.end);\n if (lastReturnIndex < 0) {\n throw new Error(`Cannot find last return statement:\\n${srcContents}`);\n }\n lastReturnIndex += 1; // +1 for the prefix space\n srcContents = insertContentsAtOffset(srcContents, `${insertion}\\n${indent}`, lastReturnIndex);\n }\n\n return srcContents;\n}\n"],"file":"codeMod.js"}
|
package/build/ios/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as Bitcode from './Bitcode';
|
|
2
2
|
import * as BuildScheme from './BuildScheme';
|
|
3
3
|
import * as BundleIdentifier from './BundleIdentifier';
|
|
4
4
|
import * as DeviceFamily from './DeviceFamily';
|
|
5
5
|
import * as Entitlements from './Entitlements';
|
|
6
|
-
import * as Facebook from './Facebook';
|
|
7
6
|
import * as Google from './Google';
|
|
8
7
|
import { ExpoPlist, InfoPlist } from './IosConfig.types';
|
|
9
8
|
import * as JsEngine from './JsEngine';
|
|
@@ -15,14 +14,13 @@ import * as Paths from './Paths';
|
|
|
15
14
|
import * as Permissions from './Permissions';
|
|
16
15
|
import * as ProvisioningProfile from './ProvisioningProfile';
|
|
17
16
|
import * as RequiresFullScreen from './RequiresFullScreen';
|
|
18
|
-
import * as RootViewBackgroundColor from './RootViewBackgroundColor';
|
|
19
17
|
import * as Scheme from './Scheme';
|
|
20
18
|
import * as Swift from './Swift';
|
|
21
19
|
import * as Target from './Target';
|
|
22
20
|
import * as Updates from './Updates';
|
|
23
|
-
import * as UserInterfaceStyle from './UserInterfaceStyle';
|
|
24
21
|
import * as UsesNonExemptEncryption from './UsesNonExemptEncryption';
|
|
25
22
|
import * as Version from './Version';
|
|
26
23
|
import * as XcodeProjectFile from './XcodeProjectFile';
|
|
27
24
|
import * as XcodeUtils from './utils/Xcodeproj';
|
|
28
|
-
export {
|
|
25
|
+
export { InfoPlist, ExpoPlist, Entitlements, Paths, Permissions, XcodeUtils };
|
|
26
|
+
export { Bitcode, BundleIdentifier, BuildScheme, DeviceFamily, Google, Maps, Locales, JsEngine, Name, Orientation, ProvisioningProfile, RequiresFullScreen, Scheme, Swift, Target, Updates, UsesNonExemptEncryption, Version, XcodeProjectFile, };
|
package/build/ios/index.js
CHANGED
|
@@ -15,22 +15,22 @@ Object.defineProperty(exports, "InfoPlist", {
|
|
|
15
15
|
return _IosConfig().InfoPlist;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
exports.XcodeUtils = exports.XcodeProjectFile = exports.Version = exports.UsesNonExemptEncryption = exports.
|
|
18
|
+
exports.XcodeUtils = exports.XcodeProjectFile = exports.Version = exports.UsesNonExemptEncryption = exports.Updates = exports.Target = exports.Swift = exports.Scheme = exports.RequiresFullScreen = exports.ProvisioningProfile = exports.Permissions = exports.Paths = exports.Orientation = exports.Name = exports.Maps = exports.Locales = exports.JsEngine = exports.Google = exports.Entitlements = exports.DeviceFamily = exports.BundleIdentifier = exports.BuildScheme = exports.Bitcode = void 0;
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
const data = _interopRequireWildcard(require("./
|
|
20
|
+
function Bitcode() {
|
|
21
|
+
const data = _interopRequireWildcard(require("./Bitcode"));
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Bitcode = function () {
|
|
24
24
|
return data;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "Bitcode", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function () {
|
|
33
|
-
return
|
|
33
|
+
return Bitcode();
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -102,23 +102,6 @@ Object.defineProperty(exports, "Entitlements", {
|
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
104
|
|
|
105
|
-
function Facebook() {
|
|
106
|
-
const data = _interopRequireWildcard(require("./Facebook"));
|
|
107
|
-
|
|
108
|
-
Facebook = function () {
|
|
109
|
-
return data;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
return data;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
Object.defineProperty(exports, "Facebook", {
|
|
116
|
-
enumerable: true,
|
|
117
|
-
get: function () {
|
|
118
|
-
return Facebook();
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
105
|
function Google() {
|
|
123
106
|
const data = _interopRequireWildcard(require("./Google"));
|
|
124
107
|
|
|
@@ -299,23 +282,6 @@ Object.defineProperty(exports, "RequiresFullScreen", {
|
|
|
299
282
|
}
|
|
300
283
|
});
|
|
301
284
|
|
|
302
|
-
function RootViewBackgroundColor() {
|
|
303
|
-
const data = _interopRequireWildcard(require("./RootViewBackgroundColor"));
|
|
304
|
-
|
|
305
|
-
RootViewBackgroundColor = function () {
|
|
306
|
-
return data;
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
return data;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
Object.defineProperty(exports, "RootViewBackgroundColor", {
|
|
313
|
-
enumerable: true,
|
|
314
|
-
get: function () {
|
|
315
|
-
return RootViewBackgroundColor();
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
|
|
319
285
|
function Scheme() {
|
|
320
286
|
const data = _interopRequireWildcard(require("./Scheme"));
|
|
321
287
|
|
|
@@ -384,23 +350,6 @@ Object.defineProperty(exports, "Updates", {
|
|
|
384
350
|
}
|
|
385
351
|
});
|
|
386
352
|
|
|
387
|
-
function UserInterfaceStyle() {
|
|
388
|
-
const data = _interopRequireWildcard(require("./UserInterfaceStyle"));
|
|
389
|
-
|
|
390
|
-
UserInterfaceStyle = function () {
|
|
391
|
-
return data;
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
return data;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
Object.defineProperty(exports, "UserInterfaceStyle", {
|
|
398
|
-
enumerable: true,
|
|
399
|
-
get: function () {
|
|
400
|
-
return UserInterfaceStyle();
|
|
401
|
-
}
|
|
402
|
-
});
|
|
403
|
-
|
|
404
353
|
function UsesNonExemptEncryption() {
|
|
405
354
|
const data = _interopRequireWildcard(require("./UsesNonExemptEncryption"));
|
|
406
355
|
|
package/build/ios/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ios/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAA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;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA","sourcesContent":["import * as Bitcode from './Bitcode';\nimport * as BuildScheme from './BuildScheme';\nimport * as BundleIdentifier from './BundleIdentifier';\nimport * as DeviceFamily from './DeviceFamily';\nimport * as Entitlements from './Entitlements';\nimport * as Google from './Google';\nimport { ExpoPlist, InfoPlist } from './IosConfig.types';\nimport * as JsEngine from './JsEngine';\nimport * as Locales from './Locales';\nimport * as Maps from './Maps';\nimport * as Name from './Name';\nimport * as Orientation from './Orientation';\nimport * as Paths from './Paths';\nimport * as Permissions from './Permissions';\nimport * as ProvisioningProfile from './ProvisioningProfile';\nimport * as RequiresFullScreen from './RequiresFullScreen';\nimport * as Scheme from './Scheme';\nimport * as Swift from './Swift';\nimport * as Target from './Target';\nimport * as Updates from './Updates';\nimport * as UsesNonExemptEncryption from './UsesNonExemptEncryption';\nimport * as Version from './Version';\nimport * as XcodeProjectFile from './XcodeProjectFile';\nimport * as XcodeUtils from './utils/Xcodeproj';\n\n// We can change this to export * as X with TypeScript 3.8+\n// https://devblogs.microsoft.com/typescript/announcing-typescript-3-8-beta/#export-star-as-namespace-syntax\n// .. but we should wait for this to be the default VSCode version.\nexport { InfoPlist, ExpoPlist, Entitlements, Paths, Permissions, XcodeUtils };\n\nexport {\n Bitcode,\n BundleIdentifier,\n BuildScheme,\n DeviceFamily,\n Google,\n Maps,\n Locales,\n JsEngine,\n Name,\n Orientation,\n ProvisioningProfile,\n RequiresFullScreen,\n Scheme,\n Swift,\n Target,\n Updates,\n UsesNonExemptEncryption,\n Version,\n XcodeProjectFile,\n};\n"],"file":"index.js"}
|
|
@@ -52,6 +52,13 @@ export declare const withAndroidStyles: ConfigPlugin<Mod<Resources.ResourceXML>>
|
|
|
52
52
|
* @param action
|
|
53
53
|
*/
|
|
54
54
|
export declare const withMainActivity: ConfigPlugin<Mod<Paths.ApplicationProjectFile>>;
|
|
55
|
+
/**
|
|
56
|
+
* Provides the project MainApplication for modification.
|
|
57
|
+
*
|
|
58
|
+
* @param config
|
|
59
|
+
* @param action
|
|
60
|
+
*/
|
|
61
|
+
export declare const withMainApplication: ConfigPlugin<Mod<Paths.ApplicationProjectFile>>;
|
|
55
62
|
/**
|
|
56
63
|
* Provides the project /build.gradle for modification.
|
|
57
64
|
*
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createAndroidManifestPlugin = createAndroidManifestPlugin;
|
|
7
7
|
exports.createStringsXmlPlugin = createStringsXmlPlugin;
|
|
8
|
-
exports.withGradleProperties = exports.withSettingsGradle = exports.withAppBuildGradle = exports.withProjectBuildGradle = exports.withMainActivity = exports.withAndroidStyles = exports.withAndroidColorsNight = exports.withAndroidColors = exports.withStringsXml = exports.withAndroidManifest = void 0;
|
|
8
|
+
exports.withGradleProperties = exports.withSettingsGradle = exports.withAppBuildGradle = exports.withProjectBuildGradle = exports.withMainApplication = exports.withMainActivity = exports.withAndroidStyles = exports.withAndroidColorsNight = exports.withAndroidColors = exports.withStringsXml = exports.withAndroidManifest = void 0;
|
|
9
9
|
|
|
10
10
|
function _withMod() {
|
|
11
11
|
const data = require("./withMod");
|
|
@@ -152,7 +152,7 @@ const withMainActivity = (config, action) => {
|
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
154
|
/**
|
|
155
|
-
* Provides the project
|
|
155
|
+
* Provides the project MainApplication for modification.
|
|
156
156
|
*
|
|
157
157
|
* @param config
|
|
158
158
|
* @param action
|
|
@@ -161,6 +161,23 @@ const withMainActivity = (config, action) => {
|
|
|
161
161
|
|
|
162
162
|
exports.withMainActivity = withMainActivity;
|
|
163
163
|
|
|
164
|
+
const withMainApplication = (config, action) => {
|
|
165
|
+
return (0, _withMod().withMod)(config, {
|
|
166
|
+
platform: 'android',
|
|
167
|
+
mod: 'mainApplication',
|
|
168
|
+
action
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Provides the project /build.gradle for modification.
|
|
173
|
+
*
|
|
174
|
+
* @param config
|
|
175
|
+
* @param action
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
exports.withMainApplication = withMainApplication;
|
|
180
|
+
|
|
164
181
|
const withProjectBuildGradle = (config, action) => {
|
|
165
182
|
return (0, _withMod().withMod)(config, {
|
|
166
183
|
platform: 'android',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/android-plugins.ts"],"names":["createAndroidManifestPlugin","action","name","withUnknown","config","withAndroidManifest","modResults","Object","defineProperty","value","createStringsXmlPlugin","withStringsXml","platform","mod","withAndroidColors","withAndroidColorsNight","withAndroidStyles","withMainActivity","withProjectBuildGradle","withAppBuildGradle","withSettingsGradle","withGradleProperties"],"mappings":";;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,2BAAT,CACLC,MADK,EAELC,IAFK,EAGS;AACd,QAAMC,WAAyB,GAAGC,MAAM,IACtCC,mBAAmB,CAACD,MAAD,EAAS,MAAMA,MAAN,IAAgB;AAC1CA,IAAAA,MAAM,CAACE,UAAP,GAAoB,MAAML,MAAM,CAACG,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAhC;AACA,WAAOF,MAAP;AACD,GAHkB,CADrB;;AAKA,MAAIF,IAAJ,EAAU;AACRK,IAAAA,MAAM,CAACC,cAAP,CAAsBL,WAAtB,EAAmC,MAAnC,EAA2C;AACzCM,MAAAA,KAAK,EAAEP;AADkC,KAA3C;AAGD;;AACD,SAAOC,WAAP;AACD;;AAEM,SAASO,sBAAT,CACLT,MADK,EAELC,IAFK,EAGS;AACd,QAAMC,WAAyB,GAAGC,MAAM,IACtCO,cAAc,CAACP,MAAD,EAAS,MAAMA,MAAN,IAAgB;AACrCA,I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A;AAHqB,GAAhB,CAAP;AAKD,CATM;AAWP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMe,iBAA2D,GAAG,CAACZ,MAAD,EAASH,MAAT,KAAoB;AAC7F,SAAO,wBAAQG,MAAR,EAAgB;AACrBQ,IAAAA,QAAQ,EAAE,SADW;AAErBC,IAAAA,GAAG,EAAE,QAFgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMgB,gBAAiE,GAAG,CAC/Eb,MAD+E,EAE/EH,MAF+E,KAG5E;AACH,SAAO,wBAAQG,MAAR,EAAgB;AACrBQ,IAAAA,QAAQ,EAAE,SADW;AAErBC,IAAAA,GAAG,EAAE,cAFgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM;AAWP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMiB,sBAAkE,GAAG,
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/android-plugins.ts"],"names":["createAndroidManifestPlugin","action","name","withUnknown","config","withAndroidManifest","modResults","Object","defineProperty","value","createStringsXmlPlugin","withStringsXml","platform","mod","withAndroidColors","withAndroidColorsNight","withAndroidStyles","withMainActivity","withMainApplication","withProjectBuildGradle","withAppBuildGradle","withSettingsGradle","withGradleProperties"],"mappings":";;;;;;;;;AAIA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMA;AACA;AACA;AACA;AACA;AACO,SAASA,2BAAT,CACLC,MADK,EAELC,IAFK,EAGS;AACd,QAAMC,WAAyB,GAAGC,MAAM,IACtCC,mBAAmB,CAACD,MAAD,EAAS,MAAMA,MAAN,IAAgB;AAC1CA,IAAAA,MAAM,CAACE,UAAP,GAAoB,MAAML,MAAM,CAACG,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAhC;AACA,WAAOF,MAAP;AACD,GAHkB,CADrB;;AAKA,MAAIF,IAAJ,EAAU;AACRK,IAAAA,MAAM,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FgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM;AAWP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMmB,kBAA8D,GAAG,CAAChB,MAAD,EAASH,MAAT,KAAoB;AAChG,SAAO,wBAAQG,MAAR,EAAgB;AACrBQ,IAAAA,QAAQ,EAAE,SADW;AAErBC,IAAAA,GAAG,EAAE,gBAFgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMoB,kBAA8D,GAAG,CAACjB,MAAD,EAASH,MAAT,KAAoB;AAChG,SAAO,wBAAQG,MAAR,EAAgB;AACrBQ,IAAAA,QAAQ,EAAE,SADW;AAErBC,IAAAA,GAAG,EAAE,gBAFgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMqB,oBAAoE,GAAG,CAClFlB,MADkF,EAElFH,MAFkF,KAG/E;AACH,SAAO,wBAAQG,MAAR,EAAgB;AACrBQ,IAAAA,QAAQ,EAAE,SADW;AAErBC,IAAAA,GAAG,EAAE,kBAFgB;AAGrBZ,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { ConfigPlugin, Mod } from '../Plugin.types';\nimport { Manifest, Paths, Properties, Resources } from '../android';\nimport { withMod } from './withMod';\n\ntype OptionalPromise<T> = T | Promise<T>;\n\ntype MutateDataAction<T> = (expo: ExpoConfig, data: T) => OptionalPromise<T>;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createAndroidManifestPlugin(\n action: MutateDataAction<Manifest.AndroidManifest>,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withAndroidManifest(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\nexport function createStringsXmlPlugin(\n action: MutateDataAction<Resources.ResourceXML>,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withStringsXml(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * Provides the AndroidManifest.xml for modification.\n *\n * @param config\n * @param action\n */\nexport const withAndroidManifest: ConfigPlugin<Mod<Manifest.AndroidManifest>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'manifest',\n action,\n });\n};\n\n/**\n * Provides the strings.xml for modification.\n *\n * @param config\n * @param action\n */\nexport const withStringsXml: ConfigPlugin<Mod<Resources.ResourceXML>> = (config, action) => {\n return withMod(config, {\n platform: 'android',\n mod: 'strings',\n action,\n });\n};\n\n/**\n * Provides the `android/app/src/main/res/values/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n *\n * @param config\n * @param action\n */\nexport const withAndroidColors: ConfigPlugin<Mod<Resources.ResourceXML>> = (config, action) => {\n return withMod(config, {\n platform: 'android',\n mod: 'colors',\n action,\n });\n};\n\n/**\n * Provides the `android/app/src/main/res/values-night/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n *\n * @param config\n * @param action\n */\nexport const withAndroidColorsNight: ConfigPlugin<Mod<Resources.ResourceXML>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'colorsNight',\n action,\n });\n};\n\n/**\n * Provides the `android/app/src/main/res/values/styles.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n *\n * @param config\n * @param action\n */\nexport const withAndroidStyles: ConfigPlugin<Mod<Resources.ResourceXML>> = (config, action) => {\n return withMod(config, {\n platform: 'android',\n mod: 'styles',\n action,\n });\n};\n\n/**\n * Provides the project MainActivity for modification.\n *\n * @param config\n * @param action\n */\nexport const withMainActivity: ConfigPlugin<Mod<Paths.ApplicationProjectFile>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'mainActivity',\n action,\n });\n};\n\n/**\n * Provides the project MainApplication for modification.\n *\n * @param config\n * @param action\n */\nexport const withMainApplication: ConfigPlugin<Mod<Paths.ApplicationProjectFile>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'mainApplication',\n action,\n });\n};\n\n/**\n * Provides the project /build.gradle for modification.\n *\n * @param config\n * @param action\n */\nexport const withProjectBuildGradle: ConfigPlugin<Mod<Paths.GradleProjectFile>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'projectBuildGradle',\n action,\n });\n};\n\n/**\n * Provides the app/build.gradle for modification.\n *\n * @param config\n * @param action\n */\nexport const withAppBuildGradle: ConfigPlugin<Mod<Paths.GradleProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'android',\n mod: 'appBuildGradle',\n action,\n });\n};\n\n/**\n * Provides the /settings.gradle for modification.\n *\n * @param config\n * @param action\n */\nexport const withSettingsGradle: ConfigPlugin<Mod<Paths.GradleProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'android',\n mod: 'settingsGradle',\n action,\n });\n};\n\n/**\n * Provides the /gradle.properties for modification.\n *\n * @param config\n * @param action\n */\nexport const withGradleProperties: ConfigPlugin<Mod<Properties.PropertiesItem[]>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'android',\n mod: 'gradleProperties',\n action,\n });\n};\n"],"file":"android-plugins.js"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
-
import { JSONObject } from '@expo/json-file';
|
|
3
|
-
import { XcodeProject } from 'xcode';
|
|
4
|
-
import { ConfigPlugin, Mod } from '../Plugin.types';
|
|
5
|
-
import { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';
|
|
6
|
-
import { AppDelegateProjectFile } from '../ios/Paths';
|
|
1
|
+
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import type { JSONObject } from '@expo/json-file';
|
|
3
|
+
import type { XcodeProject } from 'xcode';
|
|
4
|
+
import type { ConfigPlugin, Mod } from '../Plugin.types';
|
|
5
|
+
import type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';
|
|
6
|
+
import type { AppDelegateProjectFile } from '../ios/Paths';
|
|
7
7
|
declare type MutateInfoPlistAction = (expo: ExpoConfig, infoPlist: InfoPlist) => InfoPlist;
|
|
8
8
|
/**
|
|
9
9
|
* Helper method for creating mods from existing config functions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/ios-plugins.ts"],"names":["createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","platform","mod","ios","infoPlist","entitlements","withExpoPlist","withXcodeProject","withPodfileProperties"],"mappings":";;;;;;;;;AAOA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAT,CAA+BC,MAA/B,EAA8DC,IAA9D,EAA2F;AAChG,QAAMC,WAAyB,GAAGC,MAAM,IACtCC,aAAa,CAACD,MAAD,EAAS,MAAMA,MAAN,IAAgB;AACpCA,IAAAA,MAAM,CAACE,UAAP,GAAoB,MAAML,MAAM,CAACG,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAhC;AACA,WAAOF,MAAP;AACD,GAHY,CADf;;AAKA,MAAIF,IAAJ,EAAU;AACRK,IAAAA,MAAM,CAACC,cAAP,CAAsBL,WAAtB,EAAmC,MAAnC,EAA2C;AACzCM,MAAAA,KAAK,EAAEP;AADkC,KAA3C;AAGD;;AACD,SAAOC,WAAP;AACD;;AAID;AACA;AACA;AACA;AACA;AACO,SAASO,wBAAT,CACLT,MADK,EAELC,IAFK,EAGS;AACd,QAAMC,WAAyB,GAAGC,M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BAAoBG,MAApB,EAA4B;AACjCS,IAAAA,QAAQ,EAAE,KADuB;AAEjCC,IAAAA,GAAG,EAAE,cAF4B;;AAGjC,UAAMb,MAAN,CAAaG,MAAb,EAAqB;AACnBA,MAAAA,MAAM,GAAG,MAAMH,MAAM,CAACG,MAAD,CAArB;;AACA,UAAI,CAACA,MAAM,CAACW,GAAZ,EAAiB;AACfX,QAAAA,MAAM,CAACW,GAAP,GAAa,EAAb;AACD;;AACDX,MAAAA,MAAM,CAACW,GAAP,CAAWE,YAAX,GAA0Bb,MAAM,CAACE,UAAjC;AACA,aAAOF,MAAP;AACD;;AAVgC,GAA5B,CAAP;AAYD,CAbM;AAeP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMc,aAA2C,GAAG,CAACd,MAAD,EAASH,MAAT,KAAoB;AAC7E,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMkB,gBAAiD,GAAG,CAACf,MAAD,EAASH,MAAT,KAAoB;AACnF,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,WAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CANM;AAQP;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMmB,qBAAgE,GAAG,CAC9EhB,MAD8E,EAE9EH,MAF8E,KAG3E;AACH,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,mBAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM","sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport { XcodeProject } from 'xcode';\n\nimport { ConfigPlugin, Mod } from '../Plugin.types';\nimport { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';\nimport { AppDelegateProjectFile } from '../ios/Paths';\nimport { withMod } from './withMod';\n\ntype MutateInfoPlistAction = (expo: ExpoConfig, infoPlist: InfoPlist) => InfoPlist;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createInfoPlistPlugin(action: MutateInfoPlistAction, name?: string): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withInfoPlist(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\ntype MutateEntitlementsPlistAction = (expo: ExpoConfig, entitlements: JSONObject) => JSONObject;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createEntitlementsPlugin(\n action: MutateEntitlementsPlistAction,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withEntitlementsPlist(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * Provides the AppDelegate file for modification.\n *\n * @param config\n * @param action\n */\nexport const withAppDelegate: ConfigPlugin<Mod<AppDelegateProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'appDelegate',\n action,\n });\n};\n\n/**\n * Provides the Info.plist file for modification.\n * Keeps the config's expo.ios.infoPlist object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withInfoPlist: ConfigPlugin<Mod<InfoPlist>> = (config, action) => {\n return withMod<InfoPlist>(config, {\n platform: 'ios',\n mod: 'infoPlist',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the main .entitlements file for modification.\n * Keeps the config's expo.ios.entitlements object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withEntitlementsPlist: ConfigPlugin<Mod<JSONObject>> = (config, action) => {\n return withMod<JSONObject>(config, {\n platform: 'ios',\n mod: 'entitlements',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the Expo.plist for modification.\n *\n * @param config\n * @param action\n */\nexport const withExpoPlist: ConfigPlugin<Mod<ExpoPlist>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'expoPlist',\n action,\n });\n};\n\n/**\n * Provides the main .xcodeproj for modification.\n *\n * @param config\n * @param action\n */\nexport const withXcodeProject: ConfigPlugin<Mod<XcodeProject>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'xcodeproj',\n action,\n });\n};\n\n/**\n * Provides the Podfile.properties.json for modification.\n *\n * @param config\n * @param action\n */\nexport const withPodfileProperties: ConfigPlugin<Mod<Record<string, string>>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfileProperties',\n action,\n });\n};\n"],"file":"ios-plugins.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/ios-plugins.ts"],"names":["createInfoPlistPlugin","action","name","withUnknown","config","withInfoPlist","modResults","Object","defineProperty","value","createEntitlementsPlugin","withEntitlementsPlist","withAppDelegate","platform","mod","ios","infoPlist","entitlements","withExpoPlist","withXcodeProject","withPodfileProperties"],"mappings":";;;;;;;;;AAOA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAT,CAA+BC,MAA/B,EAA8DC,IAA9D,EAA2F;AAChG,QAAMC,WAAyB,GAAGC,MAAM,IACtCC,aAAa,CAACD,MAAD,EAAS,MAAMA,MAAN,IAAgB;AACpCA,IAAAA,MAAM,CAACE,UAAP,GAAoB,MAAML,MAAM,CAACG,MAAD,EAASA,MAAM,CAACE,UAAhB,CAAhC;AAC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MAAMmB,qBAAgE,GAAG,CAC9EhB,MAD8E,EAE9EH,MAF8E,KAG3E;AACH,SAAO,wBAAQG,MAAR,EAAgB;AACrBS,IAAAA,QAAQ,EAAE,KADW;AAErBC,IAAAA,GAAG,EAAE,mBAFgB;AAGrBb,IAAAA;AAHqB,GAAhB,CAAP;AAKD,CATM","sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\nimport type { JSONObject } from '@expo/json-file';\nimport type { XcodeProject } from 'xcode';\n\nimport type { ConfigPlugin, Mod } from '../Plugin.types';\nimport type { ExpoPlist, InfoPlist } from '../ios/IosConfig.types';\nimport type { AppDelegateProjectFile } from '../ios/Paths';\nimport { withMod } from './withMod';\n\ntype MutateInfoPlistAction = (expo: ExpoConfig, infoPlist: InfoPlist) => InfoPlist;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createInfoPlistPlugin(action: MutateInfoPlistAction, name?: string): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withInfoPlist(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\ntype MutateEntitlementsPlistAction = (expo: ExpoConfig, entitlements: JSONObject) => JSONObject;\n\n/**\n * Helper method for creating mods from existing config functions.\n *\n * @param action\n */\nexport function createEntitlementsPlugin(\n action: MutateEntitlementsPlistAction,\n name: string\n): ConfigPlugin {\n const withUnknown: ConfigPlugin = config =>\n withEntitlementsPlist(config, async config => {\n config.modResults = await action(config, config.modResults);\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * Provides the AppDelegate file for modification.\n *\n * @param config\n * @param action\n */\nexport const withAppDelegate: ConfigPlugin<Mod<AppDelegateProjectFile>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'appDelegate',\n action,\n });\n};\n\n/**\n * Provides the Info.plist file for modification.\n * Keeps the config's expo.ios.infoPlist object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withInfoPlist: ConfigPlugin<Mod<InfoPlist>> = (config, action) => {\n return withMod<InfoPlist>(config, {\n platform: 'ios',\n mod: 'infoPlist',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.infoPlist = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the main .entitlements file for modification.\n * Keeps the config's expo.ios.entitlements object in sync with the data.\n *\n * @param config\n * @param action\n */\nexport const withEntitlementsPlist: ConfigPlugin<Mod<JSONObject>> = (config, action) => {\n return withMod<JSONObject>(config, {\n platform: 'ios',\n mod: 'entitlements',\n async action(config) {\n config = await action(config);\n if (!config.ios) {\n config.ios = {};\n }\n config.ios.entitlements = config.modResults;\n return config;\n },\n });\n};\n\n/**\n * Provides the Expo.plist for modification.\n *\n * @param config\n * @param action\n */\nexport const withExpoPlist: ConfigPlugin<Mod<ExpoPlist>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'expoPlist',\n action,\n });\n};\n\n/**\n * Provides the main .xcodeproj for modification.\n *\n * @param config\n * @param action\n */\nexport const withXcodeProject: ConfigPlugin<Mod<XcodeProject>> = (config, action) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'xcodeproj',\n action,\n });\n};\n\n/**\n * Provides the Podfile.properties.json for modification.\n *\n * @param config\n * @param action\n */\nexport const withPodfileProperties: ConfigPlugin<Mod<Record<string, string>>> = (\n config,\n action\n) => {\n return withMod(config, {\n platform: 'ios',\n mod: 'podfileProperties',\n action,\n });\n};\n"],"file":"ios-plugins.js"}
|