@absolutejs/absolute 0.20.0-beta.93 → 0.20.0-beta.95
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/CHANGELOG.md +12 -0
- package/changelog.json +20 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/cli/{compile-wkfd88w7.js → compile-qg75ewma.js} +2 -2
- package/dist/cli/{dev-01zcxngn.js → dev-sm9px53g.js} +2 -2
- package/dist/cli/{expoDevController-k15hftqn.js → expoDevController-a0jk8d43.js} +6 -1
- package/dist/cli/{expoProject-mmm3s62b.js → expoProject-h38entbj.js} +1 -1
- package/dist/cli/{index-wqhbxtyp.js → index-0t1cxstr.js} +241 -37
- package/dist/cli/{index-v5knwk7v.js → index-51yyq29s.js} +1 -1
- package/dist/cli/{index-kh44yx23.js → index-d8va9b7v.js} +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/cli/{mobile-pbe1a667.js → mobile-dev4mjsa.js} +3 -3
- package/dist/cli/{start-dw5crgp7.js → start-0ddnh0y4.js} +3 -3
- package/dist/mobile/index.js +309 -99
- package/dist/mobile/index.js.map +7 -6
- package/dist/mobile/remoteMacAgentEntry.js +331 -174
- package/dist/src/mobile/expoActivityResultRecovery.d.ts +1 -0
- package/dist/src/mobile/expoBridge.d.ts +2 -2
- package/package.json +3 -2
package/dist/mobile/index.js
CHANGED
|
@@ -19351,7 +19351,7 @@ var init_compatibilityDispatcher = __esm(() => {
|
|
|
19351
19351
|
// src/cli/scripts/telemetry.ts
|
|
19352
19352
|
import { existsSync as existsSync5, mkdirSync, readFileSync as readFileSync6, writeFileSync } from "fs";
|
|
19353
19353
|
import { homedir as homedir3 } from "os";
|
|
19354
|
-
import { join as
|
|
19354
|
+
import { join as join21 } from "path";
|
|
19355
19355
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
19356
19356
|
try {
|
|
19357
19357
|
if (!existsSync5(configPath))
|
|
@@ -19364,14 +19364,14 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
19364
19364
|
}
|
|
19365
19365
|
};
|
|
19366
19366
|
var init_telemetry = __esm(() => {
|
|
19367
|
-
configDir =
|
|
19368
|
-
configPath =
|
|
19367
|
+
configDir = join21(homedir3(), ".absolutejs");
|
|
19368
|
+
configPath = join21(configDir, "telemetry.json");
|
|
19369
19369
|
});
|
|
19370
19370
|
|
|
19371
19371
|
// src/cli/telemetryEvent.ts
|
|
19372
19372
|
import { existsSync as existsSync6, readFileSync as readFileSync7 } from "fs";
|
|
19373
19373
|
import { arch, platform as platform3 } from "os";
|
|
19374
|
-
import { dirname as dirname14, join as
|
|
19374
|
+
import { dirname as dirname14, join as join22, parse } from "path";
|
|
19375
19375
|
var checkCandidate = (candidate) => {
|
|
19376
19376
|
if (!existsSync6(candidate)) {
|
|
19377
19377
|
return null;
|
|
@@ -19391,7 +19391,7 @@ var checkCandidate = (candidate) => {
|
|
|
19391
19391
|
}, findPackageVersion = () => {
|
|
19392
19392
|
let { dir } = import.meta;
|
|
19393
19393
|
while (dir !== parse(dir).root) {
|
|
19394
|
-
const candidate =
|
|
19394
|
+
const candidate = join22(dir, "package.json");
|
|
19395
19395
|
const version = checkCandidate(candidate);
|
|
19396
19396
|
if (version) {
|
|
19397
19397
|
return version;
|
|
@@ -26851,7 +26851,7 @@ var parseAbsoluteMobileBuildPageMetadata = (value) => {
|
|
|
26851
26851
|
};
|
|
26852
26852
|
// src/mobile/buildPipeline.ts
|
|
26853
26853
|
import { readFile as readFile15 } from "fs/promises";
|
|
26854
|
-
import { join as
|
|
26854
|
+
import { join as join17, resolve as resolve13 } from "path";
|
|
26855
26855
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
26856
26856
|
|
|
26857
26857
|
// src/mobile/buildRelease.ts
|
|
@@ -27622,7 +27622,7 @@ import {
|
|
|
27622
27622
|
writeFile as writeFile12
|
|
27623
27623
|
} from "fs/promises";
|
|
27624
27624
|
import { createHash as createHash12 } from "crypto";
|
|
27625
|
-
import { basename as basename4, dirname as dirname10, join as
|
|
27625
|
+
import { basename as basename4, dirname as dirname10, join as join16, relative as relative10, resolve as resolve12, sep as sep6 } from "path";
|
|
27626
27626
|
|
|
27627
27627
|
// src/mobile/updateRuntime.ts
|
|
27628
27628
|
init_deviceCapabilities();
|
|
@@ -28265,6 +28265,127 @@ var absoluteExpoNativeObservabilityPaths = (project) => [
|
|
|
28265
28265
|
...absoluteExpoNativeObservabilityFiles(project).keys()
|
|
28266
28266
|
];
|
|
28267
28267
|
|
|
28268
|
+
// src/mobile/expoActivityResultRecovery.ts
|
|
28269
|
+
import { join as join15 } from "path";
|
|
28270
|
+
var HEADER2 = `// Generated by AbsoluteJS. Edit absolute.config.ts, then run absolute mobile sync.
|
|
28271
|
+
`;
|
|
28272
|
+
var XML_HEADER2 = `<!-- Generated by AbsoluteJS. Edit absolute.config.ts, then run absolute mobile sync. -->
|
|
28273
|
+
`;
|
|
28274
|
+
var moduleConfig2 = `${JSON.stringify({
|
|
28275
|
+
android: {
|
|
28276
|
+
modules: [
|
|
28277
|
+
"expo.modules.absoluteactivityresultrecovery.AbsoluteActivityResultRecoveryModule"
|
|
28278
|
+
]
|
|
28279
|
+
},
|
|
28280
|
+
platforms: ["android"]
|
|
28281
|
+
}, null, 2)}
|
|
28282
|
+
`;
|
|
28283
|
+
var androidBuild2 = `${HEADER2}plugins {
|
|
28284
|
+
id 'com.android.library'
|
|
28285
|
+
id 'expo-module-gradle-plugin'
|
|
28286
|
+
}
|
|
28287
|
+
|
|
28288
|
+
group = 'expo.modules.absoluteactivityresultrecovery'
|
|
28289
|
+
version = '0.0.1'
|
|
28290
|
+
|
|
28291
|
+
android {
|
|
28292
|
+
namespace 'expo.modules.absoluteactivityresultrecovery'
|
|
28293
|
+
defaultConfig {
|
|
28294
|
+
versionCode 1
|
|
28295
|
+
versionName '0.0.1'
|
|
28296
|
+
}
|
|
28297
|
+
lintOptions { abortOnError false }
|
|
28298
|
+
}
|
|
28299
|
+
`;
|
|
28300
|
+
var androidManifest2 = `${XML_HEADER2}<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
|
|
28301
|
+
`;
|
|
28302
|
+
var androidModule2 = `${HEADER2}package expo.modules.absoluteactivityresultrecovery
|
|
28303
|
+
|
|
28304
|
+
import android.content.Intent
|
|
28305
|
+
import android.util.Log
|
|
28306
|
+
import expo.modules.kotlin.modules.Module
|
|
28307
|
+
import expo.modules.kotlin.modules.ModuleDefinition
|
|
28308
|
+
|
|
28309
|
+
data class AbsolutePendingActivityResult(
|
|
28310
|
+
val requestCode: Int,
|
|
28311
|
+
val resultCode: Int,
|
|
28312
|
+
val data: Intent?
|
|
28313
|
+
)
|
|
28314
|
+
|
|
28315
|
+
object AbsoluteActivityResultRecoveryState {
|
|
28316
|
+
@Volatile
|
|
28317
|
+
var applicationRuntimeReady = false
|
|
28318
|
+
|
|
28319
|
+
private val pendingActivityResults = ArrayDeque<AbsolutePendingActivityResult>()
|
|
28320
|
+
|
|
28321
|
+
@Synchronized
|
|
28322
|
+
fun enqueueActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
28323
|
+
if (pendingActivityResults.size == 8) pendingActivityResults.removeFirst()
|
|
28324
|
+
pendingActivityResults.addLast(
|
|
28325
|
+
AbsolutePendingActivityResult(requestCode, resultCode, data?.let(::Intent))
|
|
28326
|
+
)
|
|
28327
|
+
Log.d("AbsoluteJS", "Queued early Android activity result; pending=" + pendingActivityResults.size)
|
|
28328
|
+
}
|
|
28329
|
+
|
|
28330
|
+
@Synchronized
|
|
28331
|
+
fun hasPendingActivityResults() = pendingActivityResults.isNotEmpty()
|
|
28332
|
+
|
|
28333
|
+
@Synchronized
|
|
28334
|
+
fun drainActivityResults(): List<AbsolutePendingActivityResult> {
|
|
28335
|
+
val drained = pendingActivityResults.toList()
|
|
28336
|
+
pendingActivityResults.clear()
|
|
28337
|
+
Log.d("AbsoluteJS", "Replaying queued Android activity results; count=" + drained.size)
|
|
28338
|
+
return drained
|
|
28339
|
+
}
|
|
28340
|
+
}
|
|
28341
|
+
|
|
28342
|
+
class AbsoluteActivityResultRecoveryModule : Module() {
|
|
28343
|
+
override fun definition() = ModuleDefinition {
|
|
28344
|
+
Name("AbsoluteActivityResultRecovery")
|
|
28345
|
+
|
|
28346
|
+
Function("markApplicationRuntimeReady") {
|
|
28347
|
+
AbsoluteActivityResultRecoveryState.applicationRuntimeReady = true
|
|
28348
|
+
Log.d("AbsoluteJS", "Expo application runtime ready for Android activity results")
|
|
28349
|
+
}
|
|
28350
|
+
}
|
|
28351
|
+
}
|
|
28352
|
+
`;
|
|
28353
|
+
var runtime = `${HEADER2}import { requireNativeModule } from 'expo-modules-core';
|
|
28354
|
+
|
|
28355
|
+
type AbsoluteActivityResultRecoveryNative = {
|
|
28356
|
+
markApplicationRuntimeReady(): void;
|
|
28357
|
+
};
|
|
28358
|
+
|
|
28359
|
+
const native = requireNativeModule<AbsoluteActivityResultRecoveryNative>(
|
|
28360
|
+
'AbsoluteActivityResultRecovery'
|
|
28361
|
+
);
|
|
28362
|
+
|
|
28363
|
+
export const markAbsoluteApplicationRuntimeReady = () =>
|
|
28364
|
+
native.markApplicationRuntimeReady();
|
|
28365
|
+
`;
|
|
28366
|
+
var absoluteExpoActivityResultRecoveryFiles = (project) => new Map([
|
|
28367
|
+
[
|
|
28368
|
+
join15(project, "modules/absolute-activity-result-recovery/expo-module.config.json"),
|
|
28369
|
+
moduleConfig2
|
|
28370
|
+
],
|
|
28371
|
+
[
|
|
28372
|
+
join15(project, "modules/absolute-activity-result-recovery/android/build.gradle"),
|
|
28373
|
+
androidBuild2
|
|
28374
|
+
],
|
|
28375
|
+
[
|
|
28376
|
+
join15(project, "modules/absolute-activity-result-recovery/android/src/main/AndroidManifest.xml"),
|
|
28377
|
+
androidManifest2
|
|
28378
|
+
],
|
|
28379
|
+
[
|
|
28380
|
+
join15(project, "modules/absolute-activity-result-recovery/android/src/main/java/expo/modules/absoluteactivityresultrecovery/AbsoluteActivityResultRecoveryModule.kt"),
|
|
28381
|
+
androidModule2
|
|
28382
|
+
],
|
|
28383
|
+
[
|
|
28384
|
+
join15(project, "src/generated/AbsoluteActivityResultRecovery.ts"),
|
|
28385
|
+
runtime
|
|
28386
|
+
]
|
|
28387
|
+
]);
|
|
28388
|
+
|
|
28268
28389
|
// src/mobile/expoProject.ts
|
|
28269
28390
|
var EXPO_GENERATED_HEADER = `// Generated by AbsoluteJS. Edit absolute.config.ts, then run absolute mobile sync.
|
|
28270
28391
|
`;
|
|
@@ -28345,7 +28466,7 @@ var routeSegments = (route) => {
|
|
|
28345
28466
|
return segment;
|
|
28346
28467
|
});
|
|
28347
28468
|
};
|
|
28348
|
-
var routeFile = (project, route) =>
|
|
28469
|
+
var routeFile = (project, route) => join16(project, "app", ...routeSegments(route), "index.tsx");
|
|
28349
28470
|
var packageDependencies = (plan) => Object.fromEntries(plan.requiredPackages.map((spec) => {
|
|
28350
28471
|
const separator = spec.lastIndexOf("@");
|
|
28351
28472
|
return [spec.slice(0, separator), spec.slice(separator + 1)];
|
|
@@ -28353,7 +28474,7 @@ var packageDependencies = (plan) => Object.fromEntries(plan.requiredPackages.map
|
|
|
28353
28474
|
var expoPackage = (auth, sync, devices, updates) => ({
|
|
28354
28475
|
dependencies: {
|
|
28355
28476
|
"@absolutejs/devices": "0.7.0",
|
|
28356
|
-
"@absolutejs/devices-expo": "0.0.
|
|
28477
|
+
"@absolutejs/devices-expo": "0.0.9",
|
|
28357
28478
|
...auth ? {
|
|
28358
28479
|
"@absolutejs/auth": ABSOLUTE_EXPO_AUTH_CORE_VERSION,
|
|
28359
28480
|
[ABSOLUTE_EXPO_AUTH_PACKAGE]: ABSOLUTE_EXPO_AUTH_VERSION
|
|
@@ -28489,6 +28610,7 @@ var expoAppConfig = (config, auth, sync, devices, runtimeFingerprint) => {
|
|
|
28489
28610
|
plugins: [
|
|
28490
28611
|
"expo-router",
|
|
28491
28612
|
["expo-dev-client", { launchMode: "most-recent" }],
|
|
28613
|
+
"./plugins/withAbsoluteActivityResultRecovery",
|
|
28492
28614
|
...auth || config.updates ? ["expo-secure-store"] : [],
|
|
28493
28615
|
...sync ? [
|
|
28494
28616
|
"expo-sqlite",
|
|
@@ -28578,6 +28700,77 @@ const withAbsoluteDevelopmentCa = config => {
|
|
|
28578
28700
|
|
|
28579
28701
|
module.exports = withAbsoluteDevelopmentCa;
|
|
28580
28702
|
`;
|
|
28703
|
+
var expoActivityResultRecoveryPlugin = `${EXPO_GENERATED_HEADER}const { withMainActivity } = require('expo/config-plugins');
|
|
28704
|
+
|
|
28705
|
+
const IMPORT_ANCHOR = 'import android.os.Bundle';
|
|
28706
|
+
const CLASS_ANCHOR = 'class MainActivity : ReactActivity() {';
|
|
28707
|
+
const RECOVERY_MARKER = 'absolutePendingActivityResults';
|
|
28708
|
+
|
|
28709
|
+
const withAbsoluteActivityResultRecovery = config => withMainActivity(config, value => {
|
|
28710
|
+
if (value.modResults.language !== 'kt') {
|
|
28711
|
+
throw new Error('AbsoluteJS Expo activity-result recovery requires a Kotlin MainActivity.');
|
|
28712
|
+
}
|
|
28713
|
+
let source = value.modResults.contents;
|
|
28714
|
+
if (source.includes(RECOVERY_MARKER)) return value;
|
|
28715
|
+
if (!source.includes(IMPORT_ANCHOR) || !source.includes(CLASS_ANCHOR)) {
|
|
28716
|
+
throw new Error('AbsoluteJS could not locate the Expo MainActivity integration points.');
|
|
28717
|
+
}
|
|
28718
|
+
source = source.replace(IMPORT_ANCHOR, [
|
|
28719
|
+
'import android.content.Intent',
|
|
28720
|
+
'import android.os.Bundle',
|
|
28721
|
+
'import android.os.Handler',
|
|
28722
|
+
'import android.os.Looper',
|
|
28723
|
+
'import expo.modules.absoluteactivityresultrecovery.AbsoluteActivityResultRecoveryState'
|
|
28724
|
+
].join('\\n'));
|
|
28725
|
+
source = source.replace(CLASS_ANCHOR, \`\${CLASS_ANCHOR}
|
|
28726
|
+
private val absoluteActivityResultHandler = Handler(Looper.getMainLooper())
|
|
28727
|
+
private var absoluteActivityResultAttempts = 0
|
|
28728
|
+
private val absoluteReplayActivityResults = object : Runnable {
|
|
28729
|
+
override fun run() {
|
|
28730
|
+
if (isFinishing || isDestroyed || !AbsoluteActivityResultRecoveryState.hasPendingActivityResults()) return
|
|
28731
|
+
if (!AbsoluteActivityResultRecoveryState.applicationRuntimeReady) {
|
|
28732
|
+
if (absoluteActivityResultAttempts++ < 240) {
|
|
28733
|
+
absoluteActivityResultHandler.postDelayed(this, 250)
|
|
28734
|
+
}
|
|
28735
|
+
return
|
|
28736
|
+
}
|
|
28737
|
+
absoluteActivityResultAttempts = 0
|
|
28738
|
+
AbsoluteActivityResultRecoveryState.drainActivityResults().forEach { result ->
|
|
28739
|
+
super@MainActivity.onActivityResult(result.requestCode, result.resultCode, result.data)
|
|
28740
|
+
}
|
|
28741
|
+
}
|
|
28742
|
+
}
|
|
28743
|
+
|
|
28744
|
+
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
|
28745
|
+
if (AbsoluteActivityResultRecoveryState.applicationRuntimeReady) {
|
|
28746
|
+
super.onActivityResult(requestCode, resultCode, data)
|
|
28747
|
+
return
|
|
28748
|
+
}
|
|
28749
|
+
AbsoluteActivityResultRecoveryState.enqueueActivityResult(requestCode, resultCode, data)
|
|
28750
|
+
absoluteActivityResultHandler.removeCallbacks(absoluteReplayActivityResults)
|
|
28751
|
+
absoluteActivityResultHandler.postDelayed(absoluteReplayActivityResults, 250)
|
|
28752
|
+
}
|
|
28753
|
+
|
|
28754
|
+
override fun onResume() {
|
|
28755
|
+
super.onResume()
|
|
28756
|
+
if (AbsoluteActivityResultRecoveryState.hasPendingActivityResults()) {
|
|
28757
|
+
absoluteActivityResultAttempts = 0
|
|
28758
|
+
absoluteActivityResultHandler.removeCallbacks(absoluteReplayActivityResults)
|
|
28759
|
+
absoluteActivityResultHandler.post(absoluteReplayActivityResults)
|
|
28760
|
+
}
|
|
28761
|
+
}
|
|
28762
|
+
|
|
28763
|
+
override fun onDestroy() {
|
|
28764
|
+
absoluteActivityResultHandler.removeCallbacks(absoluteReplayActivityResults)
|
|
28765
|
+
super.onDestroy()
|
|
28766
|
+
}
|
|
28767
|
+
\`);
|
|
28768
|
+
value.modResults.contents = source;
|
|
28769
|
+
return value;
|
|
28770
|
+
});
|
|
28771
|
+
|
|
28772
|
+
module.exports = withAbsoluteActivityResultRecovery;
|
|
28773
|
+
`;
|
|
28581
28774
|
var metroConfig = (projectRoot) => `${EXPO_GENERATED_HEADER}const { getDefaultConfig } = require('expo/metro-config');
|
|
28582
28775
|
const path = require('node:path');
|
|
28583
28776
|
|
|
@@ -28595,6 +28788,8 @@ module.exports = config;
|
|
|
28595
28788
|
`;
|
|
28596
28789
|
var layoutSource = (auth, sync, updates, observability) => `${EXPO_GENERATED_HEADER}import { Stack } from 'expo-router';
|
|
28597
28790
|
import '../src/generated/AbsoluteDevices';
|
|
28791
|
+
import { useEffect as useActivityResultRecoveryEffect } from 'react';
|
|
28792
|
+
import { markAbsoluteApplicationRuntimeReady } from '../src/generated/AbsoluteActivityResultRecovery';
|
|
28598
28793
|
${auth ? `import { useEffect, useState } from 'react';
|
|
28599
28794
|
import { startAbsoluteExpoAuth } from '../src/generated/AbsoluteAuth';` : ""}
|
|
28600
28795
|
${sync ? "import { startAbsoluteExpoSync } from '../src/generated/AbsoluteSync';" : ""}
|
|
@@ -28604,6 +28799,9 @@ ${observability ? `import { useEffect as useNativeObservabilityEffect } from 're
|
|
|
28604
28799
|
import { startAbsoluteExpoNativeObservability } from '../src/generated/AbsoluteNativeObservability';` : ""}
|
|
28605
28800
|
|
|
28606
28801
|
export default function AbsoluteLayout() {
|
|
28802
|
+
useActivityResultRecoveryEffect(() => {
|
|
28803
|
+
markAbsoluteApplicationRuntimeReady();
|
|
28804
|
+
}, []);
|
|
28607
28805
|
${updates ? "useUpdateEffect(() => { void startAbsoluteExpoUpdates(); }, []);" : ""}
|
|
28608
28806
|
${observability ? "useNativeObservabilityEffect(() => { void startAbsoluteExpoNativeObservability(); }, []);" : ""}
|
|
28609
28807
|
${auth ? `const [ready, setReady] = useState(false);
|
|
@@ -29468,8 +29666,8 @@ const styles = StyleSheet.create({
|
|
|
29468
29666
|
error: { color: '#b91c1c', fontSize: 16, textAlign: 'center' }
|
|
29469
29667
|
});
|
|
29470
29668
|
`;
|
|
29471
|
-
var nativeWrapperSource = (wrapper, module,
|
|
29472
|
-
import { createAbsoluteNativeRoute, createAbsoluteNativeRouteErrorBoundary } from ${JSON.stringify(portableRelative2(dirname10(wrapper),
|
|
29669
|
+
var nativeWrapperSource = (wrapper, module, runtime2, route) => `${EXPO_GENERATED_HEADER}import ApplicationNativeRoute from ${JSON.stringify(portableRelative2(dirname10(wrapper), module).replace(/\.(?:[cm]?[jt]sx?)$/u, ""))};
|
|
29670
|
+
import { createAbsoluteNativeRoute, createAbsoluteNativeRouteErrorBoundary } from ${JSON.stringify(portableRelative2(dirname10(wrapper), runtime2).replace(/\.(?:[cm]?[jt]sx?)$/u, ""))};
|
|
29473
29671
|
|
|
29474
29672
|
export const ErrorBoundary = createAbsoluteNativeRouteErrorBoundary(${JSON.stringify(route)});
|
|
29475
29673
|
export default createAbsoluteNativeRoute(ApplicationNativeRoute, ${JSON.stringify(route)});
|
|
@@ -29538,7 +29736,7 @@ var pruneManagedFiles = async (paths) => {
|
|
|
29538
29736
|
return removed.filter(Boolean).length;
|
|
29539
29737
|
};
|
|
29540
29738
|
var pruneStaleManagedExpoRoutes = async (project, expected) => {
|
|
29541
|
-
const appDirectory =
|
|
29739
|
+
const appDirectory = join16(project, "app");
|
|
29542
29740
|
if (!await exists3(appDirectory))
|
|
29543
29741
|
return 0;
|
|
29544
29742
|
const files = await walkFiles(appDirectory);
|
|
@@ -29586,7 +29784,7 @@ var writeAbsoluteExpoProject = async (config, options) => {
|
|
|
29586
29784
|
if (missing) {
|
|
29587
29785
|
throw new TypeError(`Expo native route ${missing.route} references missing module ${missing.module}.`);
|
|
29588
29786
|
}
|
|
29589
|
-
const marker =
|
|
29787
|
+
const marker = join16(project, EXPO_PROJECT_MARKER);
|
|
29590
29788
|
if (await exists3(project) && !await exists3(marker)) {
|
|
29591
29789
|
const entries = await readdir4(project);
|
|
29592
29790
|
if (entries.length > 0 && !options.force) {
|
|
@@ -29599,7 +29797,7 @@ var writeAbsoluteExpoProject = async (config, options) => {
|
|
|
29599
29797
|
const authEnabled = Boolean(auth);
|
|
29600
29798
|
const files = new Map([
|
|
29601
29799
|
[
|
|
29602
|
-
|
|
29800
|
+
join16(project, ".gitignore"),
|
|
29603
29801
|
`.expo/
|
|
29604
29802
|
android/
|
|
29605
29803
|
ios/
|
|
@@ -29607,74 +29805,80 @@ node_modules/
|
|
|
29607
29805
|
`
|
|
29608
29806
|
],
|
|
29609
29807
|
[
|
|
29610
|
-
|
|
29808
|
+
join16(project, "app.json"),
|
|
29611
29809
|
jsonSource(expoAppConfig(config, authEnabled, syncEnabled, devices, runtimeFingerprint))
|
|
29612
29810
|
],
|
|
29613
|
-
[
|
|
29811
|
+
[join16(project, "app.config.js"), expoDynamicAppConfig],
|
|
29614
29812
|
[
|
|
29615
|
-
|
|
29813
|
+
join16(project, "package.json"),
|
|
29616
29814
|
jsonSource(expoPackage(authEnabled, syncEnabled, devices, config.updates !== undefined))
|
|
29617
29815
|
],
|
|
29618
|
-
[
|
|
29816
|
+
[join16(project, "metro.config.js"), metroConfig(projectRoot)],
|
|
29619
29817
|
[
|
|
29620
|
-
|
|
29818
|
+
join16(project, "plugins", "withAbsoluteDevelopmentCa.js"),
|
|
29621
29819
|
expoDevelopmentCaPlugin
|
|
29622
29820
|
],
|
|
29623
29821
|
[
|
|
29624
|
-
|
|
29822
|
+
join16(project, "plugins", "withAbsoluteActivityResultRecovery.js"),
|
|
29823
|
+
expoActivityResultRecoveryPlugin
|
|
29824
|
+
],
|
|
29825
|
+
[
|
|
29826
|
+
join16(project, "tsconfig.json"),
|
|
29625
29827
|
jsonSource(expoTsConfig(projectRoot, project, authEnabled, syncEnabled))
|
|
29626
29828
|
],
|
|
29627
29829
|
[
|
|
29628
|
-
|
|
29830
|
+
join16(project, "app", "_layout.tsx"),
|
|
29629
29831
|
layoutSource(authEnabled, syncEnabled, config.updates !== undefined, config.observability !== undefined)
|
|
29630
29832
|
],
|
|
29631
29833
|
[
|
|
29632
|
-
|
|
29834
|
+
join16(project, "app", "__absolute", "native", "index.tsx"),
|
|
29633
29835
|
nativeDiagnosticSource
|
|
29634
29836
|
],
|
|
29635
29837
|
[
|
|
29636
|
-
|
|
29838
|
+
join16(project, "src", "generated", "AbsoluteDevices.ts"),
|
|
29637
29839
|
devicesRuntimeSource(config, devices, authEnabled)
|
|
29638
29840
|
],
|
|
29639
29841
|
[
|
|
29640
|
-
|
|
29842
|
+
join16(project, "src", "generated", "AbsoluteNativeRoute.tsx"),
|
|
29641
29843
|
nativeRouteRuntimeSource(authEnabled)
|
|
29642
29844
|
],
|
|
29643
29845
|
[
|
|
29644
|
-
|
|
29846
|
+
join16(project, "src", "generated", "AbsoluteWebHost.tsx"),
|
|
29645
29847
|
webHostSource(config, auth, syncEnabled)
|
|
29646
29848
|
]
|
|
29647
29849
|
]);
|
|
29850
|
+
for (const [path, source] of absoluteExpoActivityResultRecoveryFiles(project))
|
|
29851
|
+
files.set(path, source);
|
|
29648
29852
|
if (config.observability) {
|
|
29649
29853
|
for (const [path, source] of absoluteExpoNativeObservabilityFiles(project))
|
|
29650
29854
|
files.set(path, source);
|
|
29651
29855
|
}
|
|
29652
29856
|
if (config.updates) {
|
|
29653
|
-
files.set(
|
|
29857
|
+
files.set(join16(project, "src", "generated", "AbsoluteUpdates.ts"), updatesRuntimeSource(config));
|
|
29654
29858
|
}
|
|
29655
29859
|
const expoCodeSigning = config.updates?.expoCodeSigning;
|
|
29656
29860
|
if (expoCodeSigning)
|
|
29657
|
-
files.set(
|
|
29861
|
+
files.set(join16(project, "certs", "absolute-mobile-update.pem"), expoCodeSigning.certificatePem);
|
|
29658
29862
|
if (auth) {
|
|
29659
|
-
files.set(
|
|
29863
|
+
files.set(join16(project, "src", "generated", "AbsoluteAuth.ts"), authRuntimeSource(auth, config.appId));
|
|
29660
29864
|
}
|
|
29661
29865
|
if (syncSchema) {
|
|
29662
|
-
files.set(
|
|
29866
|
+
files.set(join16(project, "src", "generated", "AbsoluteSync.ts"), syncRuntimeSource(config, syncSchema));
|
|
29663
29867
|
}
|
|
29664
|
-
const webAssetsPath =
|
|
29868
|
+
const webAssetsPath = join16(project, "src", "generated", "webAssets.ts");
|
|
29665
29869
|
if (!await exists3(webAssetsPath)) {
|
|
29666
29870
|
files.set(webAssetsPath, emptyWebAssetsSource);
|
|
29667
29871
|
}
|
|
29668
29872
|
if (!config.expoNativeRoutes["/"]) {
|
|
29669
|
-
files.set(
|
|
29873
|
+
files.set(join16(project, "app", "index.tsx"), webRouteSource);
|
|
29670
29874
|
}
|
|
29671
|
-
files.set(
|
|
29672
|
-
const nativeRouteRuntime =
|
|
29875
|
+
files.set(join16(project, "app", "[...absolute].tsx"), catchAllRouteSource);
|
|
29876
|
+
const nativeRouteRuntime = join16(project, "src", "generated", "AbsoluteNativeRoute.tsx");
|
|
29673
29877
|
for (const [route, module] of routeModules) {
|
|
29674
|
-
const wrapper = route === "/" ?
|
|
29878
|
+
const wrapper = route === "/" ? join16(project, "app", "index.tsx") : routeFile(project, route);
|
|
29675
29879
|
files.set(wrapper, nativeWrapperSource(wrapper, module, nativeRouteRuntime, route));
|
|
29676
29880
|
}
|
|
29677
|
-
const removedRoutes = await pruneStaleManagedExpoRoutes(project, new Set([...files.keys()].filter((path) => path.startsWith(`${
|
|
29881
|
+
const removedRoutes = await pruneStaleManagedExpoRoutes(project, new Set([...files.keys()].filter((path) => path.startsWith(`${join16(project, "app")}${sep6}`))));
|
|
29678
29882
|
const removedObservability = config.observability ? 0 : await pruneManagedFiles(absoluteExpoNativeObservabilityPaths(project));
|
|
29679
29883
|
const changes = await Promise.all([...files].map(([path, source]) => writeManagedFile(path, source, true)));
|
|
29680
29884
|
const changed = removedRoutes + removedObservability + changes.filter(Boolean).length;
|
|
@@ -29683,7 +29887,7 @@ node_modules/
|
|
|
29683
29887
|
var walkFiles = async (root, directory = root) => {
|
|
29684
29888
|
const entries = await readdir4(directory, { withFileTypes: true });
|
|
29685
29889
|
const nested = await Promise.all(entries.map((entry) => {
|
|
29686
|
-
const path =
|
|
29890
|
+
const path = join16(directory, entry.name);
|
|
29687
29891
|
if (entry.isDirectory())
|
|
29688
29892
|
return walkFiles(root, path);
|
|
29689
29893
|
if (entry.isFile())
|
|
@@ -29750,11 +29954,11 @@ export const materializeAbsoluteWebBundle = async () => {
|
|
|
29750
29954
|
var syncAbsoluteExpoWebAssets = async (config) => {
|
|
29751
29955
|
if (config.engine !== "expo")
|
|
29752
29956
|
throw new TypeError("Expo asset sync requires mobile.engine: expo.");
|
|
29753
|
-
const marker =
|
|
29957
|
+
const marker = join16(config.nativeProjectDirectory, EXPO_PROJECT_MARKER);
|
|
29754
29958
|
if (!await exists3(marker)) {
|
|
29755
29959
|
throw new TypeError("Expo asset sync requires an AbsoluteJS-managed Expo project. Run mobile init first.");
|
|
29756
29960
|
}
|
|
29757
|
-
const manifestPath =
|
|
29961
|
+
const manifestPath = join16(config.bundleDirectory, "absolute-mobile-manifest.json");
|
|
29758
29962
|
const manifest = JSON.parse(await readFile14(manifestPath, "utf8"));
|
|
29759
29963
|
const nativeDataManifest = expoNativeDataManifest(manifest);
|
|
29760
29964
|
const { appBuild } = nativeDataManifest;
|
|
@@ -29768,16 +29972,16 @@ var syncAbsoluteExpoWebAssets = async (config) => {
|
|
|
29768
29972
|
bundleHash.update("\x00");
|
|
29769
29973
|
});
|
|
29770
29974
|
const bundleId = `amexpo_${bundleHash.digest("hex")}`;
|
|
29771
|
-
const destination =
|
|
29975
|
+
const destination = join16(config.nativeProjectDirectory, "assets", "absolute");
|
|
29772
29976
|
await mkdir11(dirname10(destination), { recursive: true });
|
|
29773
|
-
const staging = await mkdtemp7(
|
|
29977
|
+
const staging = await mkdtemp7(join16(dirname10(destination), `.${basename4(destination)}.stage-`));
|
|
29774
29978
|
let assets;
|
|
29775
29979
|
try {
|
|
29776
29980
|
assets = await Promise.all(files.map(async (source, index) => {
|
|
29777
29981
|
const name = `${String(index).padStart(6, "0")}${EXPO_ASSET_EXTENSION}`;
|
|
29778
|
-
await cp2(source,
|
|
29982
|
+
await cp2(source, join16(staging, name));
|
|
29779
29983
|
return {
|
|
29780
|
-
asset: portableRelative2(
|
|
29984
|
+
asset: portableRelative2(join16(config.nativeProjectDirectory, "src", "generated"), join16(destination, name)),
|
|
29781
29985
|
path: relative10(config.bundleDirectory, source).replaceAll("\\", "/")
|
|
29782
29986
|
};
|
|
29783
29987
|
}));
|
|
@@ -29786,7 +29990,7 @@ var syncAbsoluteExpoWebAssets = async (config) => {
|
|
|
29786
29990
|
await rm10(staging, { force: true, recursive: true });
|
|
29787
29991
|
throw error;
|
|
29788
29992
|
}
|
|
29789
|
-
const generated =
|
|
29993
|
+
const generated = join16(config.nativeProjectDirectory, "src", "generated", "webAssets.ts");
|
|
29790
29994
|
await writeManagedFile(generated, assetModuleSource(assets, bundleId, nativeDataManifest), true);
|
|
29791
29995
|
return { appBuild, assets: assets.length, bundleId, path: destination };
|
|
29792
29996
|
};
|
|
@@ -29827,9 +30031,9 @@ var loadServerApp = async (producerPath) => {
|
|
|
29827
30031
|
var finalizeAbsoluteMobileCompatibilityBuild = async (options) => {
|
|
29828
30032
|
const buildDirectory = resolve13(options.buildDirectory);
|
|
29829
30033
|
const mobile = normalizeAbsoluteMobileConfig(options.mobile, options.projectRoot);
|
|
29830
|
-
const root =
|
|
30034
|
+
const root = join17(buildDirectory, ".absolutejs", "mobile-compatibility");
|
|
29831
30035
|
const [manifestSource, previous] = await Promise.all([
|
|
29832
|
-
readFile15(
|
|
30036
|
+
readFile15(join17(buildDirectory, "manifest.json"), "utf8"),
|
|
29833
30037
|
readAbsoluteMobileMaterializedReleases(root)
|
|
29834
30038
|
]);
|
|
29835
30039
|
const manifest = JSON.parse(manifestSource);
|
|
@@ -30030,6 +30234,7 @@ var ABSOLUTE_EXPO_BRIDGE_MAX_BYTES = 64 * 1024;
|
|
|
30030
30234
|
var ABSOLUTE_EXPO_BRIDGE_METHODS = [
|
|
30031
30235
|
"devices.platform.getInfo",
|
|
30032
30236
|
"devices.lifecycle.getState",
|
|
30237
|
+
"devices.lifecycle.takeRestoredOperations",
|
|
30033
30238
|
"devices.links.getLaunchUrl",
|
|
30034
30239
|
"devices.links.openExternal",
|
|
30035
30240
|
"devices.network.getStatus",
|
|
@@ -30314,7 +30519,7 @@ var generateAbsoluteExpoCodeSigning = async (options) => {
|
|
|
30314
30519
|
// src/mobile/expoDevController.ts
|
|
30315
30520
|
import { spawn } from "child_process";
|
|
30316
30521
|
import { access as access11 } from "fs/promises";
|
|
30317
|
-
import { join as
|
|
30522
|
+
import { join as join18, resolve as resolvePath4 } from "path";
|
|
30318
30523
|
var METRO_READY_TIMEOUT_MS = 120000;
|
|
30319
30524
|
var PROCESS_CLOSE_TIMEOUT_MS = 2000;
|
|
30320
30525
|
var preserveWindowsSubstRealpaths = `
|
|
@@ -30507,10 +30712,15 @@ var encodedWindowsExpoAndroidCommand = (project, androidRoot, appId, args, captu
|
|
|
30507
30712
|
`$env:NODE_ENV = '${mode === "development" ? "development" : "production"}'`,
|
|
30508
30713
|
...preferredDevice ? [] : ["$env:ORG_GRADLE_PROJECT_reactNativeArchitectures = 'x86_64'"],
|
|
30509
30714
|
"New-Item -ItemType Directory -Force -Path $directory | Out-Null",
|
|
30510
|
-
"& robocopy.exe $source $directory /MIR /XD node_modules .expo .git .gradle .cxx .kotlin build /XF bun.lock bun.lockb .absolutejs-preserve-subst.cjs /NFL /NDL /NJH /NJS /NP",
|
|
30715
|
+
"& robocopy.exe $source $directory /MIR /XD node_modules .expo .git .gradle .cxx .kotlin build /XF bun.lock bun.lockb .absolutejs-preserve-subst.cjs .absolutejs-source-lock.sha256 /NFL /NDL /NJH /NJS /NP",
|
|
30511
30716
|
"$copyExit = $LASTEXITCODE",
|
|
30512
30717
|
"if ($copyExit -ge 8) { exit $copyExit }",
|
|
30513
30718
|
"Set-Location $directory",
|
|
30719
|
+
"$sourceLock = @('bun.lock', 'bun.lockb') | ForEach-Object { Join-Path $source $_ } | Where-Object { Test-Path $_ } | Select-Object -First 1",
|
|
30720
|
+
"$sourceLockHash = if ($sourceLock) { (Get-FileHash $sourceLock -Algorithm SHA256).Hash } else { 'none' }",
|
|
30721
|
+
"$lockMarker = Join-Path $directory '.absolutejs-source-lock.sha256'",
|
|
30722
|
+
"$priorLockHash = if (Test-Path $lockMarker) { (Get-Content $lockMarker -Raw).Trim() } else { '' }",
|
|
30723
|
+
"if ($priorLockHash -ne $sourceLockHash) { Remove-Item (Join-Path $directory 'bun.lock'), (Join-Path $directory 'bun.lockb') -Force -ErrorAction SilentlyContinue; Set-Content $lockMarker $sourceLockHash -NoNewline }",
|
|
30514
30724
|
"$bun = (Get-Command bun.exe -ErrorAction Stop).Source",
|
|
30515
30725
|
"& $bun install",
|
|
30516
30726
|
"if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }",
|
|
@@ -30542,7 +30752,7 @@ var commandEnvironment = (options) => ({
|
|
|
30542
30752
|
...options.metroHost ? { REACT_NATIVE_PACKAGER_HOSTNAME: options.metroHost } : {}
|
|
30543
30753
|
});
|
|
30544
30754
|
var absoluteExpoExecutable = async (project) => {
|
|
30545
|
-
const executable =
|
|
30755
|
+
const executable = join18(project, "node_modules", ".bin", "expo");
|
|
30546
30756
|
try {
|
|
30547
30757
|
await access11(executable);
|
|
30548
30758
|
return executable;
|
|
@@ -30705,7 +30915,7 @@ var installAbsoluteExpoAndroidRelease = async (options) => {
|
|
|
30705
30915
|
const releaseExit = await runUtilityCommand(run, releaseExecutable, releaseArguments, utilityOptions);
|
|
30706
30916
|
if (releaseExit !== 0)
|
|
30707
30917
|
throw new Error(`Expo Android release build exited with status ${releaseExit}.`);
|
|
30708
|
-
const adb = options.androidAdb ??
|
|
30918
|
+
const adb = options.androidAdb ?? join18(androidRoot, "platform-tools", host3 === "windows" || host3 === "wsl" ? "adb.exe" : "adb");
|
|
30709
30919
|
const serial = host3 === "wsl" ? options.androidDevice ?? capture([adb, "devices"]).stdout.split(/\r?\n/u).flatMap((line) => {
|
|
30710
30920
|
const match = /^(\S+)\s+device$/u.exec(line.trim());
|
|
30711
30921
|
return match?.[1] ? [match[1]] : [];
|
|
@@ -30939,7 +31149,7 @@ var startAbsoluteExpoDevSession = async (options) => {
|
|
|
30939
31149
|
}
|
|
30940
31150
|
if (platform2 === "android" && host3 !== "wsl") {
|
|
30941
31151
|
const androidRoot = options.androidRoot ?? process.env.ANDROID_HOME ?? process.env.ANDROID_SDK_ROOT ?? absoluteManagedAndroidSdkRoot(host3);
|
|
30942
|
-
const adb = options.androidAdb ??
|
|
31152
|
+
const adb = options.androidAdb ?? join18(androidRoot, "platform-tools", host3 === "windows" ? "adb.exe" : "adb");
|
|
30943
31153
|
connectLocalExpoAndroid(adb, options.config.appId, options.metroPort, capture, options.androidDevice);
|
|
30944
31154
|
log("Connected the Expo Android development client to Metro.");
|
|
30945
31155
|
}
|
|
@@ -31064,7 +31274,7 @@ var startAbsoluteExpoDevSession = async (options) => {
|
|
|
31064
31274
|
// src/mobile/expoNativeWatcher.ts
|
|
31065
31275
|
import { watch as watch2 } from "fs";
|
|
31066
31276
|
import { access as access12, readdir as readdir5, readFile as readFile16 } from "fs/promises";
|
|
31067
|
-
import { basename as basename5, join as
|
|
31277
|
+
import { basename as basename5, join as join19, relative as relative12 } from "path";
|
|
31068
31278
|
import { createHash as createHash13 } from "crypto";
|
|
31069
31279
|
var NATIVE_CHANGE_DEBOUNCE_MS2 = 500;
|
|
31070
31280
|
var ROOT_NATIVE_INPUTS2 = new Set([
|
|
@@ -31085,7 +31295,7 @@ var filesIn = async (directory, prefix) => {
|
|
|
31085
31295
|
return [];
|
|
31086
31296
|
const entries = await readdir5(directory, { withFileTypes: true });
|
|
31087
31297
|
const nested = await Promise.all(entries.map((entry) => {
|
|
31088
|
-
const path =
|
|
31298
|
+
const path = join19(directory, entry.name);
|
|
31089
31299
|
const name = `${prefix}/${entry.name}`;
|
|
31090
31300
|
if (entry.isDirectory())
|
|
31091
31301
|
return filesIn(path, name);
|
|
@@ -31096,10 +31306,10 @@ var filesIn = async (directory, prefix) => {
|
|
|
31096
31306
|
var fingerprintAbsoluteExpoNativeInputs = async (options) => {
|
|
31097
31307
|
const hash = createHash13("sha256");
|
|
31098
31308
|
const rootFiles = await Promise.all([...ROOT_NATIVE_INPUTS2].sort().map(async (name) => {
|
|
31099
|
-
const path =
|
|
31309
|
+
const path = join19(options.projectRoot, name);
|
|
31100
31310
|
return await exists5(path) ? [{ name: `root/${name}`, path }] : [];
|
|
31101
31311
|
}));
|
|
31102
|
-
const nativeFiles = await Promise.all(EXPO_NATIVE_DIRECTORIES.map((name) => filesIn(
|
|
31312
|
+
const nativeFiles = await Promise.all(EXPO_NATIVE_DIRECTORIES.map((name) => filesIn(join19(options.expoProjectDirectory, name), name)));
|
|
31103
31313
|
const files = [...rootFiles.flat(), ...nativeFiles.flat()].sort((left, right) => left.name.localeCompare(right.name));
|
|
31104
31314
|
const contents = await Promise.all(files.map(({ path }) => readFile16(path)));
|
|
31105
31315
|
files.forEach(({ name }, index) => {
|
|
@@ -31170,14 +31380,14 @@ var createAbsoluteExpoNativeWatcher = async (options) => {
|
|
|
31170
31380
|
}
|
|
31171
31381
|
};
|
|
31172
31382
|
const nativeDirectories = (await Promise.all(EXPO_NATIVE_DIRECTORIES.map(async (name) => {
|
|
31173
|
-
const directory =
|
|
31383
|
+
const directory = join19(options.expoProjectDirectory, name);
|
|
31174
31384
|
return await exists5(directory) ? [directory] : [];
|
|
31175
31385
|
}))).flat();
|
|
31176
31386
|
nativeDirectories.forEach((directory) => {
|
|
31177
31387
|
watchers.push(watch2(directory, { recursive: true }, (_event, filename) => {
|
|
31178
31388
|
if (!filename)
|
|
31179
31389
|
return;
|
|
31180
|
-
record(relative12(options.expoProjectDirectory,
|
|
31390
|
+
record(relative12(options.expoProjectDirectory, join19(directory, String(filename))), false);
|
|
31181
31391
|
}));
|
|
31182
31392
|
});
|
|
31183
31393
|
watchers.push(watch2(options.projectRoot, (_event, filename) => {
|
|
@@ -31193,7 +31403,7 @@ var createAbsoluteExpoNativeWatcher = async (options) => {
|
|
|
31193
31403
|
};
|
|
31194
31404
|
// src/mobile/expoUpdate.ts
|
|
31195
31405
|
import { access as access13, mkdir as mkdir13, readFile as readFile17, writeFile as writeFile14 } from "fs/promises";
|
|
31196
|
-
import { dirname as dirname12, extname as extname4, join as
|
|
31406
|
+
import { dirname as dirname12, extname as extname4, join as join20 } from "path";
|
|
31197
31407
|
var ABSOLUTE_EXPO_UPDATE_DESCRIPTOR = "_absolute/expo-update.json";
|
|
31198
31408
|
var ABSOLUTE_EXPO_UPDATE_FORMAT = 1;
|
|
31199
31409
|
var object4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -31259,7 +31469,7 @@ var parseAbsoluteExpoUpdateDescriptor = (value) => {
|
|
|
31259
31469
|
};
|
|
31260
31470
|
};
|
|
31261
31471
|
var finalizeAbsoluteExpoUpdateExport = async (options) => {
|
|
31262
|
-
const metadata = JSON.parse(await readFile17(
|
|
31472
|
+
const metadata = JSON.parse(await readFile17(join20(options.exportDirectory, "metadata.json"), "utf8"));
|
|
31263
31473
|
if (!object4(metadata) || !object4(metadata.fileMetadata))
|
|
31264
31474
|
throw new TypeError("Expo export metadata.json is invalid.");
|
|
31265
31475
|
const descriptor = parseAbsoluteExpoUpdateDescriptor({
|
|
@@ -31270,10 +31480,10 @@ var finalizeAbsoluteExpoUpdateExport = async (options) => {
|
|
|
31270
31480
|
runtimeVersion: options.runtimeVersion
|
|
31271
31481
|
});
|
|
31272
31482
|
const referenced = Object.values(descriptor.platforms).flatMap((entry) => entry ? [entry.launchAsset, ...entry.assets] : []);
|
|
31273
|
-
await Promise.all(referenced.map(({ path }) => access13(
|
|
31483
|
+
await Promise.all(referenced.map(({ path }) => access13(join20(options.exportDirectory, path)).catch(() => {
|
|
31274
31484
|
throw new TypeError(`Expo export metadata references missing asset ${path}.`);
|
|
31275
31485
|
})));
|
|
31276
|
-
const destination =
|
|
31486
|
+
const destination = join20(options.exportDirectory, ABSOLUTE_EXPO_UPDATE_DESCRIPTOR);
|
|
31277
31487
|
await mkdir13(dirname12(destination), { recursive: true });
|
|
31278
31488
|
await writeFile14(destination, `${JSON.stringify(descriptor, null, "\t")}
|
|
31279
31489
|
`);
|
|
@@ -31785,7 +31995,7 @@ init_mobilePreview();
|
|
|
31785
31995
|
|
|
31786
31996
|
// src/mobile/nativeDeepLinks.ts
|
|
31787
31997
|
import { readFile as readFile19, rename as rename12, writeFile as writeFile16 } from "fs/promises";
|
|
31788
|
-
import { join as
|
|
31998
|
+
import { join as join23 } from "path";
|
|
31789
31999
|
var START_MARKER = "<!-- absolutejs:deep-links:start -->";
|
|
31790
32000
|
var END_MARKER = "<!-- absolutejs:deep-links:end -->";
|
|
31791
32001
|
var IOS_ENTITLEMENTS = "App/AbsoluteJS.entitlements";
|
|
@@ -31842,7 +32052,7 @@ ${hosts}
|
|
|
31842
32052
|
`;
|
|
31843
32053
|
};
|
|
31844
32054
|
var configureAndroid = async (config) => {
|
|
31845
|
-
const path =
|
|
32055
|
+
const path = join23(config.nativeProjectDirectory, "android/app/src/main/AndroidManifest.xml");
|
|
31846
32056
|
const source = await readFile19(path, "utf8");
|
|
31847
32057
|
const mainActivity = source.indexOf('android:name=".MainActivity"');
|
|
31848
32058
|
if (mainActivity === NOT_FOUND) {
|
|
@@ -31868,7 +32078,7 @@ var iosSchemeRegion = (scheme) => ` ${START_MARKER}
|
|
|
31868
32078
|
${END_MARKER}
|
|
31869
32079
|
`;
|
|
31870
32080
|
var configureIosInfo = async (config) => {
|
|
31871
|
-
const path =
|
|
32081
|
+
const path = join23(config.nativeProjectDirectory, "ios/App/App/Info.plist");
|
|
31872
32082
|
const source = await readFile19(path, "utf8");
|
|
31873
32083
|
const region = config.deepLinkScheme ? iosSchemeRegion(config.deepLinkScheme) : ` ${START_MARKER}
|
|
31874
32084
|
${END_MARKER}
|
|
@@ -31892,7 +32102,7 @@ ${domains}
|
|
|
31892
32102
|
`;
|
|
31893
32103
|
};
|
|
31894
32104
|
var configureIosEntitlements = async (config) => {
|
|
31895
|
-
const path =
|
|
32105
|
+
const path = join23(config.nativeProjectDirectory, "ios/App/AbsoluteJS.entitlements");
|
|
31896
32106
|
let current = "";
|
|
31897
32107
|
try {
|
|
31898
32108
|
current = await readFile19(path, "utf8");
|
|
@@ -31910,7 +32120,7 @@ var configureIosEntitlements = async (config) => {
|
|
|
31910
32120
|
return true;
|
|
31911
32121
|
};
|
|
31912
32122
|
var configureIosProject = async (config) => {
|
|
31913
|
-
const path =
|
|
32123
|
+
const path = join23(config.nativeProjectDirectory, "ios/App/App.xcodeproj/project.pbxproj");
|
|
31914
32124
|
const source = await readFile19(path, "utf8");
|
|
31915
32125
|
const declarations = [
|
|
31916
32126
|
...source.matchAll(/CODE_SIGN_ENTITLEMENTS = ([^;]+);/g)
|
|
@@ -31951,7 +32161,7 @@ var applyAbsoluteNativeDeepLinks = async (config, platforms = config.platforms)
|
|
|
31951
32161
|
// src/mobile/nativeDeviceCapabilities.ts
|
|
31952
32162
|
init_deviceCapabilities();
|
|
31953
32163
|
import { readFile as readFile20, rename as rename13, writeFile as writeFile17 } from "fs/promises";
|
|
31954
|
-
import { join as
|
|
32164
|
+
import { join as join24 } from "path";
|
|
31955
32165
|
var START_MARKER2 = "<!-- absolutejs:device-capabilities:start -->";
|
|
31956
32166
|
var END_MARKER2 = "<!-- absolutejs:device-capabilities:end -->";
|
|
31957
32167
|
var NOT_FOUND2 = -1;
|
|
@@ -32101,7 +32311,7 @@ var writeIosPrivacyManifest = async (path, current, source) => {
|
|
|
32101
32311
|
var configureIosPrivacyProject = async (config, requirements) => {
|
|
32102
32312
|
if (requirements.iosPrivacyAccessedApis.length === 0)
|
|
32103
32313
|
return false;
|
|
32104
|
-
const projectPath2 =
|
|
32314
|
+
const projectPath2 = join24(config.nativeProjectDirectory, "ios/App/App.xcodeproj/project.pbxproj");
|
|
32105
32315
|
const project = await readFile20(projectPath2, "utf8");
|
|
32106
32316
|
return writeChangedFile2(projectPath2, addIosPrivacyProjectReference(project));
|
|
32107
32317
|
};
|
|
@@ -32154,7 +32364,7 @@ ${next.slice(index)}`;
|
|
|
32154
32364
|
return next;
|
|
32155
32365
|
};
|
|
32156
32366
|
var configureIos2 = async (config, plan) => {
|
|
32157
|
-
const path =
|
|
32367
|
+
const path = join24(config.nativeProjectDirectory, "ios/App/App/Info.plist");
|
|
32158
32368
|
const source = await readFile20(path, "utf8");
|
|
32159
32369
|
const requirements = absoluteDeviceNativeRequirements(plan);
|
|
32160
32370
|
const existingSystemBars = source.match(/<key>UIViewControllerBasedStatusBarAppearance<\/key>\s*<(true|false)\s*\/>/u);
|
|
@@ -32175,7 +32385,7 @@ ${content}
|
|
|
32175
32385
|
${END_MARKER2}
|
|
32176
32386
|
` : "";
|
|
32177
32387
|
const infoChanged = await writeChangedFile2(path, managed(source, region, source.lastIndexOf("</dict>")));
|
|
32178
|
-
const privacyPath =
|
|
32388
|
+
const privacyPath = join24(config.nativeProjectDirectory, "ios/App/App/PrivacyInfo.xcprivacy");
|
|
32179
32389
|
const privacyCurrent = await optionalSource(privacyPath);
|
|
32180
32390
|
const privacySource = privacyManifestSource(privacyCurrent, requirements);
|
|
32181
32391
|
const [privacyChanged, projectChanged, pushChanged] = await Promise.all([
|
|
@@ -32186,7 +32396,7 @@ ${content}
|
|
|
32186
32396
|
return infoChanged || privacyChanged || projectChanged || pushChanged;
|
|
32187
32397
|
};
|
|
32188
32398
|
var configureIosPushNotifications = async (config, enabled) => {
|
|
32189
|
-
const entitlementsPath =
|
|
32399
|
+
const entitlementsPath = join24(config.nativeProjectDirectory, "ios/App/AbsoluteJS.entitlements");
|
|
32190
32400
|
const entitlements = await optionalSource(entitlementsPath);
|
|
32191
32401
|
if (entitlements === null && !enabled)
|
|
32192
32402
|
return false;
|
|
@@ -32198,7 +32408,7 @@ var configureIosPushNotifications = async (config, enabled) => {
|
|
|
32198
32408
|
<!-- ${PUSH_END_MARKER} -->
|
|
32199
32409
|
` : "";
|
|
32200
32410
|
const nextEntitlements = replacePushRegion(entitlements, entitlementRegion, entitlements.lastIndexOf("</dict>"));
|
|
32201
|
-
const delegatePath =
|
|
32411
|
+
const delegatePath = join24(config.nativeProjectDirectory, "ios/App/App/AppDelegate.swift");
|
|
32202
32412
|
const delegate = await optionalSource(delegatePath);
|
|
32203
32413
|
if (delegate === null && !enabled)
|
|
32204
32414
|
return false;
|
|
@@ -32247,7 +32457,7 @@ var replacePushRegion = (source, region, insertion) => {
|
|
|
32247
32457
|
return `${source.slice(0, insertion)}${region}${source.slice(insertion)}`;
|
|
32248
32458
|
};
|
|
32249
32459
|
var configureAndroid2 = async (config, plan) => {
|
|
32250
|
-
const path =
|
|
32460
|
+
const path = join24(config.nativeProjectDirectory, "android/app/src/main/AndroidManifest.xml");
|
|
32251
32461
|
const source = await readFile20(path, "utf8");
|
|
32252
32462
|
const permissions = absoluteDeviceNativeRequirements(plan).androidPermissions;
|
|
32253
32463
|
const content = permissions.map((permission) => ` <uses-permission android:name="${escapeXml2(permission)}" />`).join(`
|
|
@@ -32283,7 +32493,7 @@ ${content}
|
|
|
32283
32493
|
throw new TypeError(`Android google-services.json does not contain package ${config.appId}.`);
|
|
32284
32494
|
const [manifestChanged, firebaseChanged] = await Promise.all([
|
|
32285
32495
|
writeChangedFile2(path, nextManifest),
|
|
32286
|
-
writeOptionalChangedFile(
|
|
32496
|
+
writeOptionalChangedFile(join24(config.nativeProjectDirectory, "android/app/google-services.json"), firebaseSource)
|
|
32287
32497
|
]);
|
|
32288
32498
|
return manifestChanged || firebaseChanged;
|
|
32289
32499
|
};
|
|
@@ -32309,7 +32519,7 @@ import {
|
|
|
32309
32519
|
rm as rm11,
|
|
32310
32520
|
writeFile as writeFile18
|
|
32311
32521
|
} from "fs/promises";
|
|
32312
|
-
import { dirname as dirname15, join as
|
|
32522
|
+
import { dirname as dirname15, join as join25 } from "path";
|
|
32313
32523
|
var START = "// absolutejs:mobile-updates:start";
|
|
32314
32524
|
var END = "// absolutejs:mobile-updates:end";
|
|
32315
32525
|
var PLUGIN_START = "// absolutejs:mobile-update-plugin:start";
|
|
@@ -32479,8 +32689,8 @@ public final class AbsoluteMobileUpdateWatchdogPlugin: CAPPlugin, CAPBridgedPlug
|
|
|
32479
32689
|
${PLUGIN_END}
|
|
32480
32690
|
`;
|
|
32481
32691
|
var configureIos3 = async (config, enabled) => {
|
|
32482
|
-
const path =
|
|
32483
|
-
const capacitorConfigPath =
|
|
32692
|
+
const path = join25(config.nativeProjectDirectory, "ios/App/App/AppDelegate.swift");
|
|
32693
|
+
const capacitorConfigPath = join25(config.nativeProjectDirectory, "ios/App/App/capacitor.config.json");
|
|
32484
32694
|
let source = await readFile21(path, "utf8");
|
|
32485
32695
|
const launch = source.indexOf("didFinishLaunchingWithOptions");
|
|
32486
32696
|
const brace = launch < 0 ? -1 : source.indexOf("{", launch);
|
|
@@ -32672,12 +32882,12 @@ var androidActivityInRoot = async (root) => {
|
|
|
32672
32882
|
throw error;
|
|
32673
32883
|
}
|
|
32674
32884
|
const candidate = entries.find((entry) => entry.endsWith("/MainActivity.java") || entry.endsWith("/MainActivity.kt") || entry === "MainActivity.java" || entry === "MainActivity.kt");
|
|
32675
|
-
return candidate ?
|
|
32885
|
+
return candidate ? join25(root, candidate) : undefined;
|
|
32676
32886
|
};
|
|
32677
32887
|
var androidActivity = async (config) => {
|
|
32678
32888
|
const roots = [
|
|
32679
|
-
|
|
32680
|
-
|
|
32889
|
+
join25(config.nativeProjectDirectory, "android/app/src/main/java"),
|
|
32890
|
+
join25(config.nativeProjectDirectory, "android/app/src/main/kotlin")
|
|
32681
32891
|
];
|
|
32682
32892
|
const candidates = await Promise.all(roots.map(androidActivityInRoot));
|
|
32683
32893
|
const candidate = candidates.find((value) => value !== undefined);
|
|
@@ -32781,7 +32991,7 @@ var configureAndroid3 = async (config, enabled) => {
|
|
|
32781
32991
|
if (!packageName)
|
|
32782
32992
|
throw new TypeError("Android MainActivity package declaration was not found.");
|
|
32783
32993
|
const packagePath = packageName.replaceAll(".", "/");
|
|
32784
|
-
const pluginPath =
|
|
32994
|
+
const pluginPath = join25(config.nativeProjectDirectory, "android/app/src/main/java", packagePath, ANDROID_PLUGIN);
|
|
32785
32995
|
const changed = await Promise.all([
|
|
32786
32996
|
writeChanged(activityPath, injectAndroidActivity(activity, enabled)),
|
|
32787
32997
|
enabled ? writeChanged(pluginPath, androidPluginSource(packageName, config.updates?.bootTimeoutMs ?? 20000)) : removeOwnedFile(pluginPath)
|
|
@@ -32808,7 +33018,7 @@ import {
|
|
|
32808
33018
|
rm as rm12,
|
|
32809
33019
|
writeFile as writeFile19
|
|
32810
33020
|
} from "fs/promises";
|
|
32811
|
-
import { dirname as dirname16, join as
|
|
33021
|
+
import { dirname as dirname16, join as join26 } from "path";
|
|
32812
33022
|
var START2 = "// absolutejs:native-observability:start";
|
|
32813
33023
|
var END2 = "// absolutejs:native-observability:end";
|
|
32814
33024
|
var PLUGIN_START2 = "// absolutejs:native-observability-plugin:start";
|
|
@@ -32976,8 +33186,8 @@ public final class AbsoluteMobileObservabilityPlugin: CAPPlugin, CAPBridgedPlugi
|
|
|
32976
33186
|
${PLUGIN_END2}
|
|
32977
33187
|
`;
|
|
32978
33188
|
var configureIos4 = async (config, enabled) => {
|
|
32979
|
-
const path =
|
|
32980
|
-
const capacitorConfigPath =
|
|
33189
|
+
const path = join26(config.nativeProjectDirectory, "ios/App/App/AppDelegate.swift");
|
|
33190
|
+
const capacitorConfigPath = join26(config.nativeProjectDirectory, "ios/App/App/capacitor.config.json");
|
|
32981
33191
|
let source = await readFile22(path, "utf8");
|
|
32982
33192
|
if (enabled && !source.includes("import MetricKit")) {
|
|
32983
33193
|
const capacitorImport = source.lastIndexOf("import Capacitor");
|
|
@@ -33237,12 +33447,12 @@ var androidActivityInRoot2 = async (root) => {
|
|
|
33237
33447
|
throw error;
|
|
33238
33448
|
}
|
|
33239
33449
|
const candidate = entries.find((entry) => entry.endsWith("/MainActivity.java") || entry.endsWith("/MainActivity.kt") || entry === "MainActivity.java" || entry === "MainActivity.kt");
|
|
33240
|
-
return candidate ?
|
|
33450
|
+
return candidate ? join26(root, candidate) : undefined;
|
|
33241
33451
|
};
|
|
33242
33452
|
var androidActivity2 = async (config) => {
|
|
33243
33453
|
const roots = [
|
|
33244
|
-
|
|
33245
|
-
|
|
33454
|
+
join26(config.nativeProjectDirectory, "android/app/src/main/java"),
|
|
33455
|
+
join26(config.nativeProjectDirectory, "android/app/src/main/kotlin")
|
|
33246
33456
|
];
|
|
33247
33457
|
const candidates = await Promise.all(roots.map(androidActivityInRoot2));
|
|
33248
33458
|
const candidate = candidates.find((value) => value !== undefined);
|
|
@@ -33314,7 +33524,7 @@ var configureAndroid4 = async (config, enabled) => {
|
|
|
33314
33524
|
const packageName = activity.match(/^\s*package\s+([A-Za-z0-9_.]+)\s*[;\n]/mu)?.[1];
|
|
33315
33525
|
if (!packageName)
|
|
33316
33526
|
throw new TypeError("Android MainActivity package declaration was not found.");
|
|
33317
|
-
const pluginPath =
|
|
33527
|
+
const pluginPath = join26(config.nativeProjectDirectory, "android/app/src/main/java", packageName.replaceAll(".", "/"), ANDROID_PLUGIN2);
|
|
33318
33528
|
const changed = await Promise.all([
|
|
33319
33529
|
writeChanged2(activityPath, injectAndroidActivity2(activity, enabled)),
|
|
33320
33530
|
enabled ? writeChanged2(pluginPath, androidPluginSource2(packageName)) : removeOwnedFile2(pluginPath)
|
|
@@ -34024,11 +34234,11 @@ var resolveAbsoluteHttpUrl = (target, origin) => {
|
|
|
34024
34234
|
var createAbsoluteHttpTransport = ({
|
|
34025
34235
|
fetch: fetchImpl = globalThis.fetch,
|
|
34026
34236
|
origin,
|
|
34027
|
-
runtime
|
|
34237
|
+
runtime: runtime2
|
|
34028
34238
|
}) => ({
|
|
34029
34239
|
fetch: fetchImpl,
|
|
34030
34240
|
origin: normalizeAbsoluteHttpOrigin(origin),
|
|
34031
|
-
runtime
|
|
34241
|
+
runtime: runtime2
|
|
34032
34242
|
});
|
|
34033
34243
|
var createWebHttpTransport = (options = {}) => {
|
|
34034
34244
|
const origin = options.origin ?? globalThis.location?.origin;
|
|
@@ -40174,14 +40384,14 @@ import {
|
|
|
40174
40384
|
stat as stat4,
|
|
40175
40385
|
writeFile as writeFile20
|
|
40176
40386
|
} from "fs/promises";
|
|
40177
|
-
import { dirname as dirname18, join as
|
|
40387
|
+
import { dirname as dirname18, join as join27, relative as relative16, resolve as resolve18 } from "path";
|
|
40178
40388
|
var UPDATE_MANIFEST_FILE = "update.json";
|
|
40179
40389
|
var UPDATE_FILES_DIRECTORY = "files";
|
|
40180
40390
|
var sha2562 = (value) => createHash14("sha256").update(value).digest("hex");
|
|
40181
40391
|
var listFiles = async (root, directory = root) => {
|
|
40182
40392
|
const entries = await readdir8(directory, { withFileTypes: true });
|
|
40183
40393
|
const paths = await Promise.all(entries.map(async (entry) => {
|
|
40184
|
-
const path =
|
|
40394
|
+
const path = join27(directory, entry.name);
|
|
40185
40395
|
if (entry.isDirectory())
|
|
40186
40396
|
return listFiles(root, path);
|
|
40187
40397
|
if (!entry.isFile())
|
|
@@ -40191,7 +40401,7 @@ var listFiles = async (root, directory = root) => {
|
|
|
40191
40401
|
return paths.flat().sort((left, right) => left.localeCompare(right));
|
|
40192
40402
|
};
|
|
40193
40403
|
var inspectFiles = async (root, paths) => Promise.all(paths.map(async (path) => {
|
|
40194
|
-
const source =
|
|
40404
|
+
const source = join27(root, path);
|
|
40195
40405
|
const [metadata, contents] = await Promise.all([
|
|
40196
40406
|
stat4(source),
|
|
40197
40407
|
readFile23(source)
|
|
@@ -40230,14 +40440,14 @@ var buildAbsoluteMobileUpdate = async (options) => {
|
|
|
40230
40440
|
}
|
|
40231
40441
|
});
|
|
40232
40442
|
await mkdir17(outputRoot, { recursive: true });
|
|
40233
|
-
const outputDirectory =
|
|
40234
|
-
const staging = await mkdtemp8(
|
|
40443
|
+
const outputDirectory = join27(outputRoot, manifest.releaseId);
|
|
40444
|
+
const staging = await mkdtemp8(join27(outputRoot, ".stage-"));
|
|
40235
40445
|
try {
|
|
40236
|
-
await cp3(bundleDirectory,
|
|
40446
|
+
await cp3(bundleDirectory, join27(staging, UPDATE_FILES_DIRECTORY), {
|
|
40237
40447
|
force: true,
|
|
40238
40448
|
recursive: true
|
|
40239
40449
|
});
|
|
40240
|
-
await writeFile20(
|
|
40450
|
+
await writeFile20(join27(staging, UPDATE_MANIFEST_FILE), `${JSON.stringify(manifest, null, "\t")}
|
|
40241
40451
|
`);
|
|
40242
40452
|
await rename16(staging, outputDirectory);
|
|
40243
40453
|
} catch (error) {
|
|
@@ -40248,7 +40458,7 @@ var buildAbsoluteMobileUpdate = async (options) => {
|
|
|
40248
40458
|
}
|
|
40249
40459
|
return {
|
|
40250
40460
|
manifest,
|
|
40251
|
-
manifestPath:
|
|
40461
|
+
manifestPath: join27(outputDirectory, UPDATE_MANIFEST_FILE),
|
|
40252
40462
|
outputDirectory
|
|
40253
40463
|
};
|
|
40254
40464
|
};
|
|
@@ -40260,7 +40470,7 @@ var copyAbsoluteMobileUpdateFile = async (updateDirectory, path, destination) =>
|
|
|
40260
40470
|
await mkdir17(dirname18(destination), { recursive: true });
|
|
40261
40471
|
await cp3(source, destination, { force: true });
|
|
40262
40472
|
};
|
|
40263
|
-
var readAbsoluteMobileUpdate = async (directory) => parseAbsoluteMobileUpdateManifest(JSON.parse(await readFile23(
|
|
40473
|
+
var readAbsoluteMobileUpdate = async (directory) => parseAbsoluteMobileUpdateManifest(JSON.parse(await readFile23(join27(resolve18(directory), UPDATE_MANIFEST_FILE), "utf8")));
|
|
40264
40474
|
var verifyAbsoluteMobileUpdateSignature = (manifestValue, publicKey) => {
|
|
40265
40475
|
const manifest = parseAbsoluteMobileUpdateManifest(manifestValue);
|
|
40266
40476
|
const valid = verify("sha256", absoluteMobileUpdateSigningPayload(unsignedAbsoluteMobileUpdate(manifest)), { dsaEncoding: "ieee-p1363", key: publicKey }, Buffer.from(manifest.signature.value, "base64"));
|
|
@@ -40721,5 +40931,5 @@ export {
|
|
|
40721
40931
|
writeAbsoluteMobileUpdateRegistry
|
|
40722
40932
|
};
|
|
40723
40933
|
|
|
40724
|
-
//# debugId=
|
|
40934
|
+
//# debugId=60D5DDBF8A7817D064756E2164756E21
|
|
40725
40935
|
//# sourceMappingURL=index.js.map
|