expo-livekit-screen-share 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.ts +1 -1
- package/build/index.js +46 -11
- package/package.json +3 -2
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -29,9 +29,10 @@ function getAppGroupIdentifier(bundleIdentifier) {
|
|
|
29
29
|
function getExtensionBundleIdentifier(bundleIdentifier, extensionName) {
|
|
30
30
|
return `${bundleIdentifier}.${extensionName}`;
|
|
31
31
|
}
|
|
32
|
+
const DOWNLOAD_TIMEOUT_MS = 30000;
|
|
32
33
|
function httpsGet(url) {
|
|
33
34
|
return new Promise((resolve, reject) => {
|
|
34
|
-
https_1.default
|
|
35
|
+
const req = https_1.default
|
|
35
36
|
.get(url, (res) => {
|
|
36
37
|
if (res.statusCode &&
|
|
37
38
|
res.statusCode >= 300 &&
|
|
@@ -49,6 +50,10 @@ function httpsGet(url) {
|
|
|
49
50
|
res.on("end", () => resolve(data));
|
|
50
51
|
})
|
|
51
52
|
.on("error", reject);
|
|
53
|
+
req.setTimeout(DOWNLOAD_TIMEOUT_MS, () => {
|
|
54
|
+
req.destroy();
|
|
55
|
+
reject(new Error(`Download timed out after ${DOWNLOAD_TIMEOUT_MS}ms: ${url}`));
|
|
56
|
+
});
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
59
|
async function downloadSwiftFiles(cacheDir) {
|
|
@@ -201,25 +206,55 @@ function withScreenSharePodfilePostInstall(config, extensionName) {
|
|
|
201
206
|
const podfilePath = path_1.default.join(iosPath, "Podfile");
|
|
202
207
|
let podfileContent = fs_1.default.readFileSync(podfilePath, "utf8");
|
|
203
208
|
const snippet = `
|
|
204
|
-
# [expo-livekit-screen-share]
|
|
209
|
+
# [expo-livekit-screen-share] Override ccache compiler on extension target
|
|
205
210
|
installer.aggregate_targets
|
|
206
211
|
.map(&:user_project)
|
|
207
212
|
.uniq(&:path)
|
|
208
213
|
.each do |project|
|
|
209
214
|
extension_target = project.native_targets.find { |t| t.name == '${extensionName}' }
|
|
210
215
|
next unless extension_target
|
|
211
|
-
extension_target.build_configurations.each do |
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
+
extension_target.build_configurations.each do |ext_config|
|
|
217
|
+
ext_config.build_settings['CC'] = '$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'
|
|
218
|
+
ext_config.build_settings['CXX'] = '$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++'
|
|
219
|
+
ext_config.build_settings['LD'] = '$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang'
|
|
220
|
+
ext_config.build_settings['LDPLUSPLUS'] = '$(DEVELOPER_DIR)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++'
|
|
216
221
|
end
|
|
217
222
|
project.save()
|
|
218
223
|
end`;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
224
|
+
if (podfileContent.includes("post_install") &&
|
|
225
|
+
!podfileContent.includes("expo-livekit-screen-share")) {
|
|
226
|
+
// Insert snippet inside the existing post_install block, before its closing `end`.
|
|
227
|
+
// The Podfile structure is:
|
|
228
|
+
// post_install do |installer|
|
|
229
|
+
// react_native_post_install(...)
|
|
230
|
+
// end
|
|
231
|
+
// We insert before that final `end`.
|
|
232
|
+
const lines = podfileContent.split("\n");
|
|
233
|
+
let postInstallDepth = 0;
|
|
234
|
+
let insertIndex = -1;
|
|
235
|
+
for (let i = 0; i < lines.length; i++) {
|
|
236
|
+
const trimmed = lines[i].trim();
|
|
237
|
+
if (trimmed.match(/^post_install\s+do/)) {
|
|
238
|
+
postInstallDepth = 1;
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (postInstallDepth > 0) {
|
|
242
|
+
if (trimmed.match(/\bdo\b(\s+\|.*\|)?\s*$/)) {
|
|
243
|
+
postInstallDepth++;
|
|
244
|
+
}
|
|
245
|
+
if (trimmed === "end") {
|
|
246
|
+
postInstallDepth--;
|
|
247
|
+
if (postInstallDepth === 0) {
|
|
248
|
+
insertIndex = i;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (insertIndex !== -1) {
|
|
255
|
+
lines.splice(insertIndex, 0, snippet);
|
|
256
|
+
podfileContent = lines.join("\n");
|
|
257
|
+
}
|
|
223
258
|
}
|
|
224
259
|
fs_1.default.writeFileSync(podfilePath, podfileContent);
|
|
225
260
|
return mod;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-livekit-screen-share",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Expo config plugin for LiveKit screen sharing on iOS (Broadcast Upload Extension) and Android (foreground service)",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
],
|
|
22
22
|
"files": [
|
|
23
23
|
"build",
|
|
24
|
-
"README.md"
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "bun run tsc",
|