expo-invoke 2.8.2 → 2.8.4
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/plugin/ios/widgets/withWidgetSourceFiles.js +3 -3
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js +43 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js.map +1 -1
- package/build/plugin/src/withInvoke.js +1 -1
- package/expo-invoke.podspec +24 -0
- package/expo-module.config.json +2 -1
- package/package.json +2 -1
- package/scripts/autolinking.rb +1 -1
- package/spm.config.json +3 -3
|
@@ -115,7 +115,7 @@ const createIndexSwift = (widgets, targetPath) => {
|
|
|
115
115
|
const numberOfBundles = Math.ceil(numberOfWidgets / 4);
|
|
116
116
|
let output = `import WidgetKit
|
|
117
117
|
import SwiftUI
|
|
118
|
-
internal import
|
|
118
|
+
internal import ExpoInvoke
|
|
119
119
|
`;
|
|
120
120
|
if (numberOfWidgets > 0) {
|
|
121
121
|
for (let i = 0; i < numberOfBundles; i++) {
|
|
@@ -179,7 +179,7 @@ const widgetSwift = (widget) => {
|
|
|
179
179
|
if (!configuration)
|
|
180
180
|
return `import WidgetKit
|
|
181
181
|
import SwiftUI
|
|
182
|
-
internal import
|
|
182
|
+
internal import ExpoInvoke
|
|
183
183
|
|
|
184
184
|
struct ${widget.name}: Widget {
|
|
185
185
|
let name: String = "${widget.name}"
|
|
@@ -196,7 +196,7 @@ struct ${widget.name}: Widget {
|
|
|
196
196
|
return `import WidgetKit
|
|
197
197
|
import SwiftUI
|
|
198
198
|
import AppIntents
|
|
199
|
-
internal import
|
|
199
|
+
internal import ExpoInvoke
|
|
200
200
|
|
|
201
201
|
// AppIntent
|
|
202
202
|
struct ${widget.name}ConfigurationAppIntent: WidgetConfigurationIntent {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addBuildPhases = addBuildPhases;
|
|
4
4
|
function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, widgetFiles, }) {
|
|
5
|
+
var _a;
|
|
5
6
|
const buildPath = `""`;
|
|
6
7
|
const folderType = 'app_extension';
|
|
7
8
|
const mainTargetUuid = xcodeProject.getFirstTarget().uuid;
|
|
@@ -28,6 +29,48 @@ function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, widg
|
|
|
28
29
|
if (!getBuildPhaseObject(xcodeProject, 'PBXFrameworksBuildPhase', targetUuid)) {
|
|
29
30
|
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', targetUuid, folderType, buildPath);
|
|
30
31
|
}
|
|
32
|
+
// Shell script build phase — builds ExpoWidgets.bundle into the widget extension's output
|
|
33
|
+
if (!getBuildPhaseObject(xcodeProject, 'PBXShellScriptBuildPhase', targetUuid, 'Build ExpoWidgets Bundle')) {
|
|
34
|
+
const scriptPhaseUuid = xcodeProject.generateUuid();
|
|
35
|
+
const shellScript = [
|
|
36
|
+
'#!/bin/sh',
|
|
37
|
+
'set -eo pipefail',
|
|
38
|
+
'NODE_BINARY=${NODE_BINARY:-node}',
|
|
39
|
+
'EXPO_INVOKE_DIR=$(${NODE_BINARY} --print "path.dirname(require.resolve(\'expo-invoke/package.json\'))" 2>/dev/null || echo "")',
|
|
40
|
+
'if [ -z "$EXPO_INVOKE_DIR" ]; then',
|
|
41
|
+
' echo "warning: [expo-invoke] Could not resolve expo-invoke package — widget bundle not built"',
|
|
42
|
+
' exit 0',
|
|
43
|
+
'fi',
|
|
44
|
+
// ExpoWidgets.bundle must be a directory bundle (outer), containing ExpoWidgets.bundle (inner JS file).
|
|
45
|
+
// WidgetsJSRuntime.swift uses Bundle(url:) which requires a directory.
|
|
46
|
+
'BUNDLE_DIR="${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH}/ExpoWidgets.bundle"',
|
|
47
|
+
'TEMP_JS="${TARGET_TEMP_DIR}/expo-invoke-widget-bundle.js"',
|
|
48
|
+
'mkdir -p "$(dirname "${TEMP_JS}")"',
|
|
49
|
+
'"${EXPO_INVOKE_DIR}/scripts/with-node.sh" "${EXPO_INVOKE_DIR}/scripts/build-bundle.mjs" "${SRCROOT}/.." ios "${TEMP_JS}"',
|
|
50
|
+
'rm -rf "${BUNDLE_DIR}"',
|
|
51
|
+
'mkdir -p "${BUNDLE_DIR}"',
|
|
52
|
+
'cp "${TEMP_JS}" "${BUNDLE_DIR}/ExpoWidgets.bundle"',
|
|
53
|
+
].join('\n');
|
|
54
|
+
const shellScriptPhase = {
|
|
55
|
+
isa: 'PBXShellScriptBuildPhase',
|
|
56
|
+
buildActionMask: '2147483647',
|
|
57
|
+
files: '(\n\t\t)',
|
|
58
|
+
inputPaths: '(\n\t\t)',
|
|
59
|
+
name: '"Build ExpoWidgets Bundle"',
|
|
60
|
+
outputPaths: '(\n\t\t)',
|
|
61
|
+
runOnlyForDeploymentPostprocessing: '0',
|
|
62
|
+
shellPath: '/bin/sh',
|
|
63
|
+
shellScript: JSON.stringify(shellScript),
|
|
64
|
+
showEnvVarsInLog: '0',
|
|
65
|
+
};
|
|
66
|
+
xcodeProject.hash.project.objects['PBXShellScriptBuildPhase'] =
|
|
67
|
+
(_a = xcodeProject.hash.project.objects['PBXShellScriptBuildPhase']) !== null && _a !== void 0 ? _a : {};
|
|
68
|
+
xcodeProject.hash.project.objects['PBXShellScriptBuildPhase'][scriptPhaseUuid] = shellScriptPhase;
|
|
69
|
+
const target = xcodeProject.pbxNativeTargetSection()[targetUuid];
|
|
70
|
+
if (target === null || target === void 0 ? void 0 : target.buildPhases) {
|
|
71
|
+
target.buildPhases.push({ value: scriptPhaseUuid, comment: 'Build ExpoWidgets Bundle' });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
31
74
|
}
|
|
32
75
|
function getBuildPhaseObject(xcodeProject, buildPhaseType, targetUuid, comment) {
|
|
33
76
|
const buildPhaseSection = xcodeProject.hash.project.objects[buildPhaseType];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBuildPhases.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addBuildPhases.ts"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"addBuildPhases.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addBuildPhases.ts"],"names":[],"mappings":";;AAEA,wCA2HC;AA3HD,SAAgB,cAAc,CAC5B,YAA0B,EAC1B,EACE,UAAU,EACV,SAAS,EACT,WAAW,EACX,WAAW,GAWZ;;IAED,MAAM,SAAS,GAAG,IAAI,CAAC;IACvB,MAAM,UAAU,GAAG,eAAe,CAAC;IACnC,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC;IAE1D,sBAAsB;IACtB,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,sBAAsB,EAAE,UAAU,CAAC,EAAE,CAAC;QAC3E,YAAY,CAAC,aAAa,CACxB,CAAC,GAAG,WAAW,CAAC,EAChB,sBAAsB,EACtB,SAAS,EACT,UAAU,EACV,UAAU,EACV,SAAS,CACV,CAAC;IACJ,CAAC;IAED,yBAAyB;IACzB,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,CAAC;QAC5F,YAAY,CAAC,aAAa,CACxB,EAAE,EACF,wBAAwB,EACxB,SAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,CACV,CAAC;IACJ,CAAC;IAED,MAAM,mBAAmB,GAAG,mBAAmB,CAC7C,YAAY,EACZ,wBAAwB,EACxB,cAAc,EACd,SAAS,CACV,CAAC;IACF,IACE,mBAAmB;QACnB,CAAC,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAuB,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,CAAC,EAC7F,CAAC;QACD,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC;YAC7B,KAAK,EAAE,WAAW,CA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AiB,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjE,CAAC"}
|
|
@@ -62,5 +62,5 @@ const withInvoke = (config, options) => {
|
|
|
62
62
|
});
|
|
63
63
|
return config;
|
|
64
64
|
};
|
|
65
|
-
exports.default = (0, config_plugins_1.createRunOncePlugin)(withInvoke, 'expo-invoke', '2.8.
|
|
65
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withInvoke, 'expo-invoke', '2.8.4');
|
|
66
66
|
//# sourceMappingURL=withInvoke.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ExpoInvoke'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.authors = package['author']
|
|
11
|
+
s.homepage = package['homepage']
|
|
12
|
+
s.platforms = { :ios => '16.0' }
|
|
13
|
+
s.source = { :git => '' }
|
|
14
|
+
s.static_framework = true
|
|
15
|
+
|
|
16
|
+
s.source_files = 'ios/**/*.{h,m,mm,swift}'
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency 'React-Core'
|
|
20
|
+
|
|
21
|
+
# ExpoUI is an optional peer — only link it if the app has it installed.
|
|
22
|
+
# expo_widgets_post_install sets APPLICATION_EXTENSION_API_ONLY=No for this pod.
|
|
23
|
+
s.weak_frameworks = 'WidgetKit', 'ActivityKit'
|
|
24
|
+
end
|
package/expo-module.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-invoke",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.4",
|
|
4
4
|
"description": "The complete native-surface-to-JS bridge for Expo. One intent config → Siri, Google Assistant, home screen widgets, Dynamic Island, app icon menus, notification actions, NFC, QR, deep links and more — all through a single useInvoke() hook.",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"module": "build/src/index.js",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"metro.widget.config.js",
|
|
31
31
|
"spm.config.json",
|
|
32
32
|
"expo-module.config.json",
|
|
33
|
+
"expo-invoke.podspec",
|
|
33
34
|
"README.md",
|
|
34
35
|
"MIGRATION.md",
|
|
35
36
|
"SECURITY.md"
|
package/scripts/autolinking.rb
CHANGED
|
@@ -25,7 +25,7 @@ end
|
|
|
25
25
|
|
|
26
26
|
def expo_widgets_post_install(installer)
|
|
27
27
|
installer.pods_project.targets.each do |target|
|
|
28
|
-
if target.name == 'ExpoModulesCore' || target.name == 'ExpoUI' || target.name.start_with?('React-')
|
|
28
|
+
if target.name == 'ExpoModulesCore' || target.name == 'ExpoUI' || target.name == 'ExpoInvoke' || target.name.start_with?('React-')
|
|
29
29
|
target.build_configurations.each do |config|
|
|
30
30
|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'No'
|
|
31
31
|
end
|
package/spm.config.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"$schema": "../../tools/src/prebuilds/schemas/spm.config.schema.json",
|
|
3
3
|
"products": [
|
|
4
4
|
{
|
|
5
|
-
"name": "
|
|
6
|
-
"podName": "
|
|
5
|
+
"name": "ExpoInvoke",
|
|
6
|
+
"podName": "ExpoInvoke",
|
|
7
7
|
"platforms": [
|
|
8
8
|
"iOS(.v16)"
|
|
9
9
|
],
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"targets": [
|
|
19
19
|
{
|
|
20
20
|
"type": "swift",
|
|
21
|
-
"name": "
|
|
21
|
+
"name": "ExpoInvoke",
|
|
22
22
|
"path": "ios",
|
|
23
23
|
"pattern": "**/*.swift",
|
|
24
24
|
"dependencies": [
|