expo 58.0.16 → 58.0.19

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.
@@ -70,8 +70,62 @@ export EXPO_CONSTANTS_ALLOW_NON_PODS=1
70
70
  exec "$EXPO_CONSTANTS_DIR/scripts/get-app-config-ios.sh"
71
71
  `;
72
72
 
73
+ const EXPO_MODULES_JSI_LAUNCHER_SCRIPT = `set -euo pipefail
74
+
75
+ if [ -z "\${NODE_BINARY:-}" ]; then
76
+ set +eu
77
+ if [ -f "$SRCROOT/.xcode.env" ]; then . "$SRCROOT/.xcode.env"; fi
78
+ if [ -f "$SRCROOT/.xcode.env.local" ]; then . "$SRCROOT/.xcode.env.local"; fi
79
+ set -eu
80
+ fi
81
+ NODE_BINARY="\${NODE_BINARY:-$(command -v node || true)}"
82
+ if [ -z "$NODE_BINARY" ]; then
83
+ echo "error: ExpoModulesJSI could not be built because node was not found. The build uses node to find react-native and expo-modules-jsi. Set NODE_BINARY in $SRCROOT/.xcode.env, for example: echo \\"export NODE_BINARY=\\$(command -v node)\\" >> \\"$SRCROOT/.xcode.env\\"" >&2
84
+ exit 1
85
+ fi
86
+
87
+ PROJECT_ROOT="\${PROJECT_ROOT:-$(cd "$SRCROOT/.." && pwd)}"
88
+
89
+ # expo-modules-jsi is a dependency of expo-modules-core, not of the app, so it is resolved through
90
+ # that chain: under pnpm it is not reachable from the app root.
91
+ RESOLVED="$("$NODE_BINARY" -e '
92
+ const path = require("path");
93
+ const dir = (name, from) => path.dirname(require.resolve(\`\${name}/package.json\`, { paths: [from] }));
94
+ const root = process.argv[1];
95
+ const core = dir("expo-modules-core", dir("expo", root));
96
+ console.log(\`\${dir("react-native", root)}\\n\${dir("expo-modules-jsi", core)}\`);
97
+ ' "$PROJECT_ROOT" || true)"
98
+ RN_DIR="$(printf '%s\\n' "$RESOLVED" | sed -n 1p)"
99
+ JSI_DIR="$(printf '%s\\n' "$RESOLVED" | sed -n 2p)"
100
+ if [ -z "$RN_DIR" ] || [ -z "$JSI_DIR" ]; then
101
+ echo "error: ExpoModulesJSI could not be built because react-native, or expo-modules-jsi through expo and expo-modules-core, could not be resolved from $PROJECT_ROOT. The dependencies are not installed, or PROJECT_ROOT does not point at the app. Install the app's dependencies, then build again." >&2
102
+ exit 1
103
+ fi
104
+ if [ ! -f "$JSI_DIR/apple/scripts/build-swiftpm-app-phase.sh" ]; then
105
+ echo "error: ExpoModulesJSI could not be built because $JSI_DIR has no apple/scripts/build-swiftpm-app-phase.sh. The installed expo-modules-jsi is older than this version of expo. Update expo-modules-jsi by reinstalling the app's dependencies so they match this version of expo, then build again." >&2
106
+ exit 1
107
+ fi
108
+
109
+ export RN_DIR
110
+ exec /bin/bash "$JSI_DIR/apple/scripts/build-swiftpm-app-phase.sh"
111
+ `;
112
+
73
113
  /** Each phase, keyed by the npm package of the module that needs it. */
74
114
  const SCRIPT_PHASES = [
115
+ {
116
+ packageName: 'expo-modules-jsi',
117
+ phase: {
118
+ id: 'expo-modules-jsi.build',
119
+ name: 'Build ExpoModulesJSI',
120
+ script: EXPO_MODULES_JSI_LAUNCHER_SCRIPT,
121
+ // Source packages compile against the headers XCFramework alone; the app's own
122
+ // sources and its link step need the real framework.
123
+ position: 'beforeCompile',
124
+ // Xcode cannot see the framework's inputs. build-xcframework.sh skips the build
125
+ // when its source hash is unchanged; the copy and codesign run on every build.
126
+ alwaysOutOfDate: true,
127
+ },
128
+ },
75
129
  {
76
130
  packageName: 'expo-constants',
77
131
  phase: {
@@ -0,0 +1,23 @@
1
+ import { execFileSync } from 'node:child_process';
2
+ import path from 'node:path';
3
+
4
+ const packageRoot = path.resolve(__dirname, '../..');
5
+ const tsconfigBasePath = path.join(packageRoot, 'tsconfig.base.json');
6
+
7
+ // Jest replaces require, so check Node's own resolution
8
+ const resolveInNode = (specifier: string) =>
9
+ execFileSync(process.execPath, ['-p', `require.resolve(${JSON.stringify(specifier)})`], {
10
+ cwd: packageRoot,
11
+ encoding: 'utf8',
12
+ stdio: ['ignore', 'pipe', 'pipe'],
13
+ }).trim();
14
+
15
+ describe('expo package exports', () => {
16
+ it("resolves 'expo/tsconfig.base' to the package's 'tsconfig.base.json'", () => {
17
+ expect(resolveInNode('expo/tsconfig.base')).toBe(tsconfigBasePath);
18
+ });
19
+
20
+ it("resolves 'expo/tsconfig.base.json' to the package's 'tsconfig.base.json'", () => {
21
+ expect(resolveInNode('expo/tsconfig.base.json')).toBe(tsconfigBasePath);
22
+ });
23
+ });
package/template.tgz CHANGED
Binary file