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.
- package/android/build.gradle +2 -2
- package/bundledNativeModules.json +36 -36
- package/package.json +19 -18
- package/scripts/spm/README.md +65 -8
- package/scripts/spm/__tests__/app-target.test.js +3 -2
- package/scripts/spm/__tests__/cli.test.js +17 -2
- package/scripts/spm/__tests__/commands.test.js +95 -0
- package/scripts/spm/__tests__/diagnostics.test.js +212 -9
- package/scripts/spm/__tests__/direct.test.js +387 -0
- package/scripts/spm/__tests__/flavored-frameworks.test.js +312 -0
- package/scripts/spm/__tests__/helpers.js +9 -0
- package/scripts/spm/__tests__/manifests.test.js +142 -50
- package/scripts/spm/__tests__/plugin.test.js +1425 -35
- package/scripts/spm/__tests__/precompiled-sources.test.js +139 -0
- package/scripts/spm/__tests__/script-phases.test.js +326 -0
- package/scripts/spm/app-target.js +4 -3
- package/scripts/spm/classify.js +8 -6
- package/scripts/spm/cli.js +11 -4
- package/scripts/spm/commands.js +49 -0
- package/scripts/spm/diagnostics.js +118 -12
- package/scripts/spm/direct.js +215 -0
- package/scripts/spm/flavored-frameworks.js +190 -30
- package/scripts/spm/manifests.js +64 -10
- package/scripts/spm/plugin.js +501 -80
- package/scripts/spm/script-phases.js +54 -0
- package/src/__tests__/tsconfig-base-export.test.node.ts +23 -0
- package/template.tgz +0 -0
|
@@ -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
|