expo-invoke 2.6.15 → 2.7.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/android/src/main/java/expo/modules/invoke/ExpoInvokeModule.kt +35 -0
- package/android/src/main/java/expo/modules/invoke/InvokeSliceProvider.kt +9 -0
- package/build/plugin/codegen/generateSwiftIntents.js +22 -0
- package/build/plugin/codegen/generateSwiftIntents.js.map +1 -1
- package/build/plugin/codegen/generateSwiftLiveActivities.d.ts +17 -0
- package/build/plugin/codegen/generateSwiftLiveActivities.js +165 -0
- package/build/plugin/codegen/generateSwiftLiveActivities.js.map +1 -0
- package/build/plugin/codegen/generateSwiftWidget.d.ts +5 -0
- package/build/plugin/codegen/generateSwiftWidget.js.map +1 -1
- package/build/plugin/ios/widgets/withAppGroupEntitlements.d.ts +6 -0
- package/build/plugin/ios/widgets/withAppGroupEntitlements.js +27 -0
- package/build/plugin/ios/widgets/withAppGroupEntitlements.js.map +1 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.d.ts +7 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.js +12 -0
- package/build/plugin/ios/widgets/withAppInfoPlist.js.map +1 -0
- package/build/plugin/ios/widgets/withEasConfig.d.ts +8 -0
- package/build/plugin/ios/widgets/withEasConfig.js +52 -0
- package/build/plugin/ios/widgets/withEasConfig.js.map +1 -0
- package/build/plugin/ios/widgets/withIosWarning.d.ts +7 -0
- package/build/plugin/ios/widgets/withIosWarning.js +10 -0
- package/build/plugin/ios/widgets/withIosWarning.js.map +1 -0
- package/build/plugin/ios/widgets/withIosWidgets.d.ts +11 -0
- package/build/plugin/ios/widgets/withIosWidgets.js +83 -0
- package/build/plugin/ios/widgets/withIosWidgets.js.map +1 -0
- package/build/plugin/ios/widgets/withPodsLinking.d.ts +6 -0
- package/build/plugin/ios/widgets/withPodsLinking.js +102 -0
- package/build/plugin/ios/widgets/withPodsLinking.js.map +1 -0
- package/build/plugin/ios/widgets/withPushNotifications.d.ts +6 -0
- package/build/plugin/ios/widgets/withPushNotifications.js +12 -0
- package/build/plugin/ios/widgets/withPushNotifications.js.map +1 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.d.ts +10 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.js +379 -0
- package/build/plugin/ios/widgets/withWidgetSourceFiles.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.d.ts +12 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js +41 -0
- package/build/plugin/ios/widgets/xcode/addBuildPhases.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.d.ts +5 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.js +20 -0
- package/build/plugin/ios/widgets/xcode/addPbxGroup.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.d.ts +7 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.js +41 -0
- package/build/plugin/ios/widgets/xcode/addProductFile.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.d.ts +4 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.js +17 -0
- package/build/plugin/ios/widgets/xcode/addTargetDependency.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.d.ts +14 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js +29 -0
- package/build/plugin/ios/widgets/xcode/addToPbxNativeTargetSection.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.d.ts +4 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js +20 -0
- package/build/plugin/ios/widgets/xcode/addToPbxProjectSection.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.d.ts +11 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js +37 -0
- package/build/plugin/ios/widgets/xcode/addXCConfigurationList.js.map +1 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.d.ts +10 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js +86 -0
- package/build/plugin/ios/widgets/xcode/withTargetXcodeProject.js.map +1 -0
- package/build/plugin/ios/withIOSInvoke.d.ts +6 -15
- package/build/plugin/ios/withIOSInvoke.js +54 -25
- package/build/plugin/ios/withIOSInvoke.js.map +1 -1
- package/build/plugin/ios/withWidgetExtension.d.ts +5 -0
- package/build/plugin/ios/withWidgetExtension.js +5 -0
- package/build/plugin/ios/withWidgetExtension.js.map +1 -1
- package/build/plugin/src/withInvoke.d.ts +34 -23
- package/build/plugin/src/withInvoke.js +16 -27
- package/build/plugin/src/withInvoke.js.map +1 -1
- package/build/plugin/types/WidgetConfig.type.d.ts +54 -0
- package/build/plugin/types/WidgetConfig.type.js +3 -0
- package/build/plugin/types/WidgetConfig.type.js.map +1 -0
- package/build/plugin/types/WidgetFamily.type.d.ts +10 -0
- package/build/plugin/types/WidgetFamily.type.js +13 -0
- package/build/plugin/types/WidgetFamily.type.js.map +1 -0
- package/build/src/hooks/useLiveActivity.d.ts +20 -10
- package/build/src/hooks/useLiveActivity.d.ts.map +1 -1
- package/build/src/hooks/useLiveActivity.js +20 -10
- package/build/src/hooks/useLiveActivity.js.map +1 -1
- package/build/src/index.d.ts +2 -0
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +5 -0
- package/build/src/index.js.map +1 -1
- package/build/src/module.d.ts +4 -0
- package/build/src/module.d.ts.map +1 -1
- package/build/src/module.js +8 -0
- package/build/src/module.js.map +1 -1
- package/build/src/web/index.d.ts +10 -1
- package/build/src/web/index.d.ts.map +1 -1
- package/build/src/web/index.js +4 -0
- package/build/src/web/index.js.map +1 -1
- package/build/src/widgets/ExpoWidgets.d.ts +12 -0
- package/build/src/widgets/ExpoWidgets.d.ts.map +1 -0
- package/build/src/widgets/ExpoWidgets.ios.d.ts +12 -0
- package/build/src/widgets/ExpoWidgets.ios.d.ts.map +1 -0
- package/build/src/widgets/ExpoWidgets.ios.js +3 -0
- package/build/src/widgets/ExpoWidgets.ios.js.map +1 -0
- package/build/src/widgets/ExpoWidgets.js +42 -0
- package/build/src/widgets/ExpoWidgets.js.map +1 -0
- package/build/src/widgets/Widgets.d.ts +119 -0
- package/build/src/widgets/Widgets.d.ts.map +1 -0
- package/build/src/widgets/Widgets.js +158 -0
- package/build/src/widgets/Widgets.js.map +1 -0
- package/build/src/widgets/Widgets.types.d.ts +263 -0
- package/build/src/widgets/Widgets.types.d.ts.map +1 -0
- package/build/src/widgets/Widgets.types.js +2 -0
- package/build/src/widgets/Widgets.types.js.map +1 -0
- package/build/src/widgets/index.d.ts +3 -0
- package/build/src/widgets/index.d.ts.map +1 -0
- package/build/src/widgets/index.js +2 -0
- package/build/src/widgets/index.js.map +1 -0
- package/bundle/__tests__/decorator.test.ts +89 -0
- package/bundle/decorator.ts +61 -0
- package/bundle/expo-modules-core-stub.ts +1 -0
- package/bundle/expo-stub.ts +15 -0
- package/bundle/index.ts +69 -0
- package/bundle/jsx-runtime-stub.ts +71 -0
- package/bundle/react-native-stub.ts +3 -0
- package/bundle/react-stub.ts +13 -0
- package/expo-module.config.json +1 -1
- package/ios/LiveActivity/LiveActivityManager.swift +15 -14
- package/ios/Module/ExpoInvokeModule.swift +124 -0
- package/ios/Widget/WidgetManager.swift +25 -8
- package/ios/Widgets/LiveActivity.swift +81 -0
- package/ios/Widgets/LiveActivityFactory.swift +49 -0
- package/ios/Widgets/Widget/AppIntent.swift +130 -0
- package/ios/Widgets/Widget/Buttons.swift +62 -0
- package/ios/Widgets/Widget/DynamicView.swift +161 -0
- package/ios/Widgets/Widget/EntryView.swift +36 -0
- package/ios/Widgets/Widget/Fragment.swift +13 -0
- package/ios/Widgets/Widget/LiveActivityBanner.swift +19 -0
- package/ios/Widgets/Widget/RedBoxView.swift +83 -0
- package/ios/Widgets/Widget/TimelineEntry.swift +8 -0
- package/ios/Widgets/Widget/TimelineProvider.swift +45 -0
- package/ios/Widgets/Widget/Type.swift +6 -0
- package/ios/Widgets/Widget/Utils.swift +116 -0
- package/ios/Widgets/Widget/WidgetLiveActivity.swift +104 -0
- package/ios/Widgets/Widget/WidgetsJSRuntime.swift +148 -0
- package/ios/Widgets/WidgetObject.swift +31 -0
- package/ios/Widgets/WidgetsContext.swift +7 -0
- package/ios/Widgets/WidgetsEvents.swift +16 -0
- package/ios/Widgets/WidgetsExceptions.swift +25 -0
- package/ios/Widgets/WidgetsModule.swift +149 -0
- package/ios/Widgets/WidgetsRecords.swift +22 -0
- package/ios/Widgets/WidgetsStorage.swift +58 -0
- package/metro.widget.config.js +76 -0
- package/package.json +11 -1
- package/scripts/autolinking.rb +34 -0
- package/scripts/build-bundle.mjs +69 -0
- package/scripts/with-node.sh +44 -0
- package/scripts/xcode-build-bundle.sh +23 -0
- package/spm.config.json +40 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const withPodsLinking = (config, { targetName }) => (0, config_plugins_1.withDangerousMod)(config, [
|
|
40
|
+
'ios',
|
|
41
|
+
async (config) => {
|
|
42
|
+
const podsFilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
|
|
43
|
+
let podfileContent = fs.readFileSync(podsFilePath, 'utf8');
|
|
44
|
+
if (podfileContent.includes(`target "${targetName}" do`)) {
|
|
45
|
+
return config;
|
|
46
|
+
}
|
|
47
|
+
podfileContent += podfileExpoWidgetsLinking(targetName);
|
|
48
|
+
// expo_widgets_post_install hook
|
|
49
|
+
if (!podfileContent.includes('post_install do |installer|')) {
|
|
50
|
+
podfileContent += `
|
|
51
|
+
post_install do |installer|
|
|
52
|
+
expo_widgets_post_install(installer)
|
|
53
|
+
end
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
podfileContent = podfileContent.replace(/post_install do \|installer\|([\s\S]*?)end\s*$/m, (match, p1) => {
|
|
58
|
+
return `post_install do |installer|
|
|
59
|
+
expo_widgets_post_install(installer)
|
|
60
|
+
${p1}end
|
|
61
|
+
`;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
fs.writeFileSync(podsFilePath, podfileContent, 'utf8');
|
|
65
|
+
return config;
|
|
66
|
+
},
|
|
67
|
+
]);
|
|
68
|
+
exports.default = withPodsLinking;
|
|
69
|
+
const podfileExpoWidgetsLinking = (targetName) => `
|
|
70
|
+
require File.join(File.dirname(\`node --print "require.resolve('expo-invoke/package.json')"\`), "scripts/autolinking")
|
|
71
|
+
target "${targetName}" do
|
|
72
|
+
use_expo_modules_widgets!
|
|
73
|
+
|
|
74
|
+
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
|
|
75
|
+
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
|
|
76
|
+
else
|
|
77
|
+
config_command = [
|
|
78
|
+
'node',
|
|
79
|
+
'--no-warnings',
|
|
80
|
+
'--eval',
|
|
81
|
+
"require(require.resolve('expo-modules-autolinking', { paths: [require.resolve('expo/package.json')] }))(process.argv.slice(1))",
|
|
82
|
+
'react-native-config',
|
|
83
|
+
'--json',
|
|
84
|
+
'--platform',
|
|
85
|
+
'ios'
|
|
86
|
+
]
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
config = use_expo_native_module!(config_command)
|
|
90
|
+
|
|
91
|
+
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
|
|
92
|
+
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
|
|
93
|
+
|
|
94
|
+
use_react_native!(
|
|
95
|
+
:path => config[:reactNativePath],
|
|
96
|
+
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
|
|
97
|
+
:app_path => "#{Pod::Config.instance.installation_root}/..",
|
|
98
|
+
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
`;
|
|
102
|
+
//# sourceMappingURL=withPodsLinking.js.map
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UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
+
const withPushNotifications = (config, props) => (0, config_plugins_1.withInfoPlist)((0, config_plugins_1.withEntitlementsPlist)(config, (mod) => {
|
|
5
|
+
mod.modResults['aps-environment'] = 'development';
|
|
6
|
+
return mod;
|
|
7
|
+
}), (mod) => {
|
|
8
|
+
mod.modResults['ExpoWidgets_EnablePushNotifications'] = props.enablePushNotifications;
|
|
9
|
+
return mod;
|
|
10
|
+
});
|
|
11
|
+
exports.default = withPushNotifications;
|
|
12
|
+
//# sourceMappingURL=withPushNotifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withPushNotifications.js","sourceRoot":"","sources":["../../../../plugin/ios/widgets/withPushNotifications.ts"],"names":[],"mappings":";;AAAA,yDAA0F;AAM1F,MAAM,qBAAqB,GAAwC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CACnF,IAAA,8BAAa,EACX,IAAA,sCAAqB,EAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE;IACpC,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,GAAG,aAAa,CAAC;IAClD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC,EACF,CAAC,GAAG,EAAE,EAAE;IACN,GAAG,CAAC,UAAU,CAAC,qCAAqC,CAAC,GAAG,KAAK,CAAC,uBAAuB,CAAC;IACtF,OAAO,GAAG,CAAC;AACb,CAAC,CACF,CAAC;AAEJ,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import { WidgetConfig } from '../../types/WidgetConfig.type';
|
|
3
|
+
type WidgetSourceFilesProps = {
|
|
4
|
+
targetName: string;
|
|
5
|
+
groupIdentifier: string;
|
|
6
|
+
widgets: WidgetConfig[];
|
|
7
|
+
onFilesGenerated: (files: string[]) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const withWidgetSourceFiles: ConfigPlugin<WidgetSourceFilesProps>;
|
|
10
|
+
export default withWidgetSourceFiles;
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
const plist_1 = __importDefault(require("@expo/plist"));
|
|
40
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const WidgetFamily_type_1 = require("../../types/WidgetFamily.type");
|
|
44
|
+
const VALID_WIDGET_FAMILIES = new Set(Object.values(WidgetFamily_type_1.WidgetFamily));
|
|
45
|
+
function assertSwiftIdentifier(value, label) {
|
|
46
|
+
if (typeof value !== 'string' || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(value)) {
|
|
47
|
+
throw new Error(`Invalid ${label} ${JSON.stringify(value)}: must be a Swift identifier.`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function assertWidgetFamily(value) {
|
|
51
|
+
if (typeof value !== 'string' || !VALID_WIDGET_FAMILIES.has(value)) {
|
|
52
|
+
throw new Error(`Invalid supportedFamilies entry ${JSON.stringify(value)}: must be one of ${[...VALID_WIDGET_FAMILIES].join(', ')}.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function validateWidget(widget) {
|
|
56
|
+
var _a, _b, _c, _d, _e;
|
|
57
|
+
assertSwiftIdentifier(widget.name, 'widget name');
|
|
58
|
+
const supportedFamilies = (_c = (_b = (_a = widget.ios) === null || _a === void 0 ? void 0 : _a.supportedFamilies) !== null && _b !== void 0 ? _b : widget.supportedFamilies) !== null && _c !== void 0 ? _c : [];
|
|
59
|
+
for (const family of supportedFamilies) {
|
|
60
|
+
assertWidgetFamily(family);
|
|
61
|
+
}
|
|
62
|
+
const configuration = (_e = (_d = widget.ios) === null || _d === void 0 ? void 0 : _d.configuration) !== null && _e !== void 0 ? _e : widget.configuration;
|
|
63
|
+
if (configuration) {
|
|
64
|
+
for (const [paramName, param] of Object.entries(configuration.parameters)) {
|
|
65
|
+
assertSwiftIdentifier(paramName, 'parameter name');
|
|
66
|
+
if (param.type === 'number' && typeof param.default !== 'number') {
|
|
67
|
+
throw new Error(`Invalid default for ${JSON.stringify(paramName)}: must be a number.`);
|
|
68
|
+
}
|
|
69
|
+
else if (param.type === 'boolean' && typeof param.default !== 'boolean') {
|
|
70
|
+
throw new Error(`Invalid default for ${JSON.stringify(paramName)}: must be a boolean.`);
|
|
71
|
+
}
|
|
72
|
+
else if (param.type === 'enum') {
|
|
73
|
+
assertSwiftIdentifier(param.default, `default for ${JSON.stringify(paramName)}`);
|
|
74
|
+
for (const value of param.values) {
|
|
75
|
+
assertSwiftIdentifier(value.value, `enum case for ${JSON.stringify(paramName)}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const withWidgetSourceFiles = (config, { widgets, targetName, onFilesGenerated, groupIdentifier }) => {
|
|
82
|
+
for (const widget of widgets) {
|
|
83
|
+
validateWidget(widget);
|
|
84
|
+
}
|
|
85
|
+
return (0, config_plugins_1.withDangerousMod)(config, [
|
|
86
|
+
'ios',
|
|
87
|
+
async (config) => {
|
|
88
|
+
var _a, _b, _c, _d, _e;
|
|
89
|
+
const projectRoot = config.modRequest.platformProjectRoot;
|
|
90
|
+
const targetDirectory = path.join(projectRoot, targetName);
|
|
91
|
+
const existingInfoPlistPath = path.join(targetDirectory, 'Info.plist');
|
|
92
|
+
const existingInfoPlist = fs.existsSync(existingInfoPlistPath)
|
|
93
|
+
? fs.readFileSync(existingInfoPlistPath, 'utf8')
|
|
94
|
+
: null;
|
|
95
|
+
if (fs.existsSync(targetDirectory)) {
|
|
96
|
+
fs.rmSync(targetDirectory, { recursive: true, force: true });
|
|
97
|
+
}
|
|
98
|
+
fs.mkdirSync(targetDirectory, { recursive: true });
|
|
99
|
+
const entitlementsPath = path.join(targetDirectory, `${targetName}.entitlements`);
|
|
100
|
+
const entitlementsContent = {
|
|
101
|
+
'com.apple.security.application-groups': [groupIdentifier],
|
|
102
|
+
};
|
|
103
|
+
fs.writeFileSync(entitlementsPath, plist_1.default.build(entitlementsContent));
|
|
104
|
+
const infoPlistPath = createInfoPlist(groupIdentifier, targetDirectory, (_c = (_b = (_a = config.ios) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : config.version) !== null && _c !== void 0 ? _c : '1.0', (_e = (_d = config.ios) === null || _d === void 0 ? void 0 : _d.buildNumber) !== null && _e !== void 0 ? _e : '1', existingInfoPlist);
|
|
105
|
+
const indexSwiftPath = createIndexSwift(widgets, targetDirectory);
|
|
106
|
+
const widgetSwiftPaths = widgets.map((widget) => createWidgetSwift(widget, targetDirectory));
|
|
107
|
+
onFilesGenerated([entitlementsPath, infoPlistPath, indexSwiftPath, ...widgetSwiftPaths]);
|
|
108
|
+
return config;
|
|
109
|
+
},
|
|
110
|
+
]);
|
|
111
|
+
};
|
|
112
|
+
const createIndexSwift = (widgets, targetPath) => {
|
|
113
|
+
const indexFilePath = path.join(targetPath, `index.swift`);
|
|
114
|
+
const numberOfWidgets = widgets.length;
|
|
115
|
+
const numberOfBundles = Math.ceil(numberOfWidgets / 4);
|
|
116
|
+
let output = `import WidgetKit
|
|
117
|
+
import SwiftUI
|
|
118
|
+
internal import ExpoWidgets
|
|
119
|
+
`;
|
|
120
|
+
if (numberOfWidgets > 0) {
|
|
121
|
+
for (let i = 0; i < numberOfBundles; i++) {
|
|
122
|
+
const start = i * 4;
|
|
123
|
+
const end = Math.min(start + 4, numberOfWidgets);
|
|
124
|
+
const widgetChunk = widgets.slice(start, end);
|
|
125
|
+
const isLastChunk = i === numberOfBundles - 1;
|
|
126
|
+
output += addIndexSwiftChunk(widgetChunk, i, isLastChunk);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
output += addIndexSwiftChunk([], 0, true);
|
|
131
|
+
}
|
|
132
|
+
fs.writeFileSync(indexFilePath, output);
|
|
133
|
+
return indexFilePath;
|
|
134
|
+
};
|
|
135
|
+
const createWidgetSwift = (widget, targetPath) => {
|
|
136
|
+
const widgetFilePath = path.join(targetPath, `${widget.name}.swift`);
|
|
137
|
+
fs.writeFileSync(widgetFilePath, widgetSwift(widget));
|
|
138
|
+
return widgetFilePath;
|
|
139
|
+
};
|
|
140
|
+
const createInfoPlist = (groupIdentifier, targetPath, marketingVersion, bundleVersion, existingInfoPlist) => {
|
|
141
|
+
var _a;
|
|
142
|
+
const infoPlistPath = `${targetPath}/Info.plist`;
|
|
143
|
+
if (existingInfoPlist) {
|
|
144
|
+
const parsedInfoPlist = plist_1.default.parse(existingInfoPlist);
|
|
145
|
+
if (((_a = parsedInfoPlist.NSExtension) === null || _a === void 0 ? void 0 : _a.NSExtensionPointIdentifier) === 'com.apple.widgetkit-extension' &&
|
|
146
|
+
parsedInfoPlist.ExpoWidgetsAppGroupIdentifier === groupIdentifier &&
|
|
147
|
+
parsedInfoPlist.CFBundleShortVersionString === marketingVersion &&
|
|
148
|
+
parsedInfoPlist.CFBundleVersion === bundleVersion) {
|
|
149
|
+
fs.writeFileSync(infoPlistPath, existingInfoPlist);
|
|
150
|
+
return infoPlistPath;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
fs.writeFileSync(infoPlistPath, infoPlist(groupIdentifier, marketingVersion, bundleVersion));
|
|
154
|
+
return infoPlistPath;
|
|
155
|
+
};
|
|
156
|
+
const addIndexSwiftChunk = (widgets, index, isLastChunk) => `
|
|
157
|
+
${index === 0 ? '@main' : ''}
|
|
158
|
+
struct ExportWidgets${index}: WidgetBundle {
|
|
159
|
+
var body: some Widget {
|
|
160
|
+
${widgets
|
|
161
|
+
.map((widget) => {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
if ((_b = (_a = widget.ios) === null || _a === void 0 ? void 0 : _a.configuration) !== null && _b !== void 0 ? _b : widget.configuration) {
|
|
164
|
+
return `if #available(iOS 17.0, *) {
|
|
165
|
+
${widget.name}()
|
|
166
|
+
}`;
|
|
167
|
+
}
|
|
168
|
+
return `${widget.name}()`;
|
|
169
|
+
})
|
|
170
|
+
.join('\n ')}
|
|
171
|
+
${!isLastChunk ? `ExportWidgets${index + 1}().body` : `WidgetLiveActivity()`}
|
|
172
|
+
}
|
|
173
|
+
}`;
|
|
174
|
+
const widgetSwift = (widget) => {
|
|
175
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
176
|
+
const configuration = (_b = (_a = widget.ios) === null || _a === void 0 ? void 0 : _a.configuration) !== null && _b !== void 0 ? _b : widget.configuration;
|
|
177
|
+
const supportedFamilies = (_e = (_d = (_c = widget.ios) === null || _c === void 0 ? void 0 : _c.supportedFamilies) !== null && _d !== void 0 ? _d : widget.supportedFamilies) !== null && _e !== void 0 ? _e : [];
|
|
178
|
+
const contentMarginsDisabled = (_g = (_f = widget.ios) === null || _f === void 0 ? void 0 : _f.contentMarginsDisabled) !== null && _g !== void 0 ? _g : widget.contentMarginsDisabled;
|
|
179
|
+
if (!configuration)
|
|
180
|
+
return `import WidgetKit
|
|
181
|
+
import SwiftUI
|
|
182
|
+
internal import ExpoWidgets
|
|
183
|
+
|
|
184
|
+
struct ${widget.name}: Widget {
|
|
185
|
+
let name: String = "${widget.name}"
|
|
186
|
+
|
|
187
|
+
var body: some WidgetConfiguration {
|
|
188
|
+
StaticConfiguration(kind: name, provider: WidgetsTimelineProvider(name: name)) { entry in
|
|
189
|
+
WidgetsEntryView(entry: entry)
|
|
190
|
+
}
|
|
191
|
+
.configurationDisplayName(${JSON.stringify(widget.displayName)})
|
|
192
|
+
.description(${JSON.stringify(widget.description)})
|
|
193
|
+
.supportedFamilies([.${supportedFamilies.join(', .')}])${contentMarginsDisabled ? '\n .contentMarginsDisabled()' : ''}
|
|
194
|
+
}
|
|
195
|
+
}`;
|
|
196
|
+
return `import WidgetKit
|
|
197
|
+
import SwiftUI
|
|
198
|
+
import AppIntents
|
|
199
|
+
internal import ExpoWidgets
|
|
200
|
+
|
|
201
|
+
// AppIntent
|
|
202
|
+
struct ${widget.name}ConfigurationAppIntent: WidgetConfigurationIntent {
|
|
203
|
+
static var title: LocalizedStringResource = ${JSON.stringify(`${(_h = configuration === null || configuration === void 0 ? void 0 : configuration.title) !== null && _h !== void 0 ? _h : widget.displayName} Configuration`)}
|
|
204
|
+
${(configuration === null || configuration === void 0 ? void 0 : configuration.description) ? ` static var description: LocalizedStringResource = ${JSON.stringify(configuration.description)}\n` : ''}
|
|
205
|
+
${Object.entries((_j = configuration === null || configuration === void 0 ? void 0 : configuration.parameters) !== null && _j !== void 0 ? _j : {})
|
|
206
|
+
.map(([name, param]) => {
|
|
207
|
+
var _a, _b;
|
|
208
|
+
let paramType;
|
|
209
|
+
switch (param.type) {
|
|
210
|
+
case 'string':
|
|
211
|
+
paramType = 'String';
|
|
212
|
+
break;
|
|
213
|
+
case 'number':
|
|
214
|
+
paramType = 'Double';
|
|
215
|
+
break;
|
|
216
|
+
case 'boolean':
|
|
217
|
+
paramType = 'Bool';
|
|
218
|
+
break;
|
|
219
|
+
case 'enum':
|
|
220
|
+
paramType = `${widget.name}${((_a = name[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + name.slice(1)}Enum`;
|
|
221
|
+
break;
|
|
222
|
+
default:
|
|
223
|
+
paramType = 'String';
|
|
224
|
+
}
|
|
225
|
+
return ` @Parameter(title: ${JSON.stringify(param.title)}, default: ${param.type === 'string' ? JSON.stringify(param.default) : param.type === 'number' ? param.default : param.type === 'boolean' ? param.default : `${widget.name}${((_b = name[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) + name.slice(1)}Enum.${param.default}`})\n var ${name}: ${paramType}`;
|
|
226
|
+
})
|
|
227
|
+
.join('\n')}
|
|
228
|
+
|
|
229
|
+
func perform() async throws -> some IntentResult {
|
|
230
|
+
return .result()
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
${Object.entries((_k = configuration === null || configuration === void 0 ? void 0 : configuration.parameters) !== null && _k !== void 0 ? _k : {})
|
|
234
|
+
.map(([name, param]) => {
|
|
235
|
+
var _a;
|
|
236
|
+
if (param.type !== 'enum')
|
|
237
|
+
return '';
|
|
238
|
+
const paramTypeName = `${widget.name}${((_a = name[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) + name.slice(1)}Enum`;
|
|
239
|
+
return `
|
|
240
|
+
enum ${paramTypeName}: String, CaseIterable, AppEnum {
|
|
241
|
+
${param.values
|
|
242
|
+
.map((value) => {
|
|
243
|
+
return `case ${value.value}`;
|
|
244
|
+
})
|
|
245
|
+
.join('\n ')}
|
|
246
|
+
|
|
247
|
+
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: ${JSON.stringify(param.title)})
|
|
248
|
+
|
|
249
|
+
static var caseDisplayRepresentations: [${paramTypeName}: DisplayRepresentation] = [
|
|
250
|
+
${param.values
|
|
251
|
+
.map((value) => {
|
|
252
|
+
return `.${value.value}: DisplayRepresentation(title: ${JSON.stringify(value.name)})`;
|
|
253
|
+
})
|
|
254
|
+
.join(',\n ')}
|
|
255
|
+
]
|
|
256
|
+
}`;
|
|
257
|
+
})
|
|
258
|
+
.join('\n')}
|
|
259
|
+
|
|
260
|
+
struct ${widget.name}TimelineEntry: TimelineEntry {
|
|
261
|
+
let date: Date
|
|
262
|
+
public let name: String
|
|
263
|
+
public let props: [String: Any]?
|
|
264
|
+
public let entryIndex: Int?
|
|
265
|
+
let configuration: ${widget.name}ConfigurationAppIntent
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
struct ${widget.name}TimelineProvider: AppIntentTimelineProvider {
|
|
269
|
+
func placeholder(in context: Context) -> ${widget.name}TimelineEntry {
|
|
270
|
+
${widget.name}TimelineEntry(date: Date(), name: "${widget.name}", props: nil, entryIndex: nil, configuration: ${widget.name}ConfigurationAppIntent())
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
func snapshot(for configuration: ${widget.name}ConfigurationAppIntent, in context: Context) async -> ${widget.name}TimelineEntry {
|
|
274
|
+
let entries = parseTimeline(configuration: configuration)
|
|
275
|
+
return entries.first ?? ${widget.name}TimelineEntry(date: Date(), name: "${widget.name}", props: nil, entryIndex: nil, configuration: configuration)
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
func timeline(for configuration: ${widget.name}ConfigurationAppIntent, in context: Context) async -> Timeline<${widget.name}TimelineEntry> {
|
|
279
|
+
let entries = self.parseTimeline(configuration: configuration)
|
|
280
|
+
let timeline = Timeline<${widget.name}TimelineEntry>(entries: entries, policy: .atEnd)
|
|
281
|
+
return timeline
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
func parseTimeline(configuration: ${widget.name}ConfigurationAppIntent) -> [${widget.name}TimelineEntry] {
|
|
285
|
+
guard let timeline = WidgetsStorage.getArray(forKey: "__expo_widgets_${widget.name}_timeline") else {
|
|
286
|
+
return [${widget.name}TimelineEntry(date: Date(), name: "${widget.name}", props: nil, entryIndex: nil, configuration: configuration)]
|
|
287
|
+
}
|
|
288
|
+
let entries: [${widget.name}TimelineEntry?] = timeline.enumerated().map { index, entry in
|
|
289
|
+
guard let entry = entry as? [String: Any], let timestamp = entry["timestamp"] as? Int, let props = entry["props"] as? [String: Any] else {
|
|
290
|
+
return nil
|
|
291
|
+
}
|
|
292
|
+
return ${widget.name}TimelineEntry(
|
|
293
|
+
date: Date(timeIntervalSince1970: Double(timestamp) / 1000),
|
|
294
|
+
name: "${widget.name}",
|
|
295
|
+
props: props,
|
|
296
|
+
entryIndex: index,
|
|
297
|
+
configuration: configuration
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return entries.compactMap(\\.self)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
struct ${widget.name}EntryView: View {
|
|
306
|
+
@Environment(\\.self) var environment
|
|
307
|
+
var entry: ${widget.name}TimelineProvider.Entry
|
|
308
|
+
|
|
309
|
+
init(entry: ${widget.name}TimelineProvider.Entry) {
|
|
310
|
+
self.entry = entry
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private var widgetEnvironment: [String: Any] {
|
|
314
|
+
var env: [String: Any] = getWidgetEnvironment(environment: environment)
|
|
315
|
+
env["timestamp"] = Int(entry.date.timeIntervalSince1970 * 1000)
|
|
316
|
+
env["configuration"] = [
|
|
317
|
+
${Object.entries((_l = configuration === null || configuration === void 0 ? void 0 : configuration.parameters) !== null && _l !== void 0 ? _l : {})
|
|
318
|
+
.map(([name, param]) => {
|
|
319
|
+
return ` "${name}": entry.configuration.${name}${param.type === 'enum' ? '.rawValue' : ''}`;
|
|
320
|
+
})
|
|
321
|
+
.join(',\n')}
|
|
322
|
+
]
|
|
323
|
+
return env
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
private var widgetEnvironmentString: String? {
|
|
327
|
+
guard let data = try? JSONSerialization.data(withJSONObject: widgetEnvironment),
|
|
328
|
+
let jsonString = String(data: data, encoding: .utf8) else {
|
|
329
|
+
return nil
|
|
330
|
+
}
|
|
331
|
+
return jsonString
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
public var body: some View {
|
|
335
|
+
if let layout = WidgetsStorage.getString(forKey: "__expo_widgets_\\(entry.name)_layout"),
|
|
336
|
+
!layout.isEmpty {
|
|
337
|
+
let node = evaluateLayout(layout: layout, props: entry.props, environment: widgetEnvironment)
|
|
338
|
+
WidgetsDynamicView(name: entry.name, kind: .widget, node: node, entryIndex: entry.entryIndex, environmentString: widgetEnvironmentString)
|
|
339
|
+
} else {
|
|
340
|
+
WidgetsDynamicView(name: entry.name, kind: .widget, node: createRedBox(message: "No layout found for \\(WidgetsStorage.appGroupIdentifier ?? "")::\\(entry.name)"), entryIndex: entry.entryIndex, environmentString: widgetEnvironmentString)
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@available(iOS 17.0, *)
|
|
347
|
+
struct ${widget.name}: Widget {
|
|
348
|
+
let name: String = "${widget.name}"
|
|
349
|
+
|
|
350
|
+
var body: some WidgetConfiguration {
|
|
351
|
+
return AppIntentConfiguration(kind: name, intent: ${widget.name}ConfigurationAppIntent.self, provider: ${widget.name}TimelineProvider()) { entry in
|
|
352
|
+
${widget.name}EntryView(entry: entry)
|
|
353
|
+
}
|
|
354
|
+
.configurationDisplayName(${JSON.stringify(widget.displayName)})
|
|
355
|
+
.description(${JSON.stringify(widget.description)})
|
|
356
|
+
.supportedFamilies([.${supportedFamilies.join(', .')}])${contentMarginsDisabled ? '\n .contentMarginsDisabled()' : ''}
|
|
357
|
+
}
|
|
358
|
+
}`;
|
|
359
|
+
};
|
|
360
|
+
const infoPlist = (groupIdentifier, marketingVersion, bundleVersion) => `<?xml version="1.0" encoding="UTF-8"?>
|
|
361
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
362
|
+
<plist version="1.0">
|
|
363
|
+
<dict>
|
|
364
|
+
<key>NSExtension</key>
|
|
365
|
+
<dict>
|
|
366
|
+
<key>NSExtensionPointIdentifier</key>
|
|
367
|
+
<string>com.apple.widgetkit-extension</string>
|
|
368
|
+
</dict>
|
|
369
|
+
<key>ExpoWidgetsAppGroupIdentifier</key>
|
|
370
|
+
<string>${groupIdentifier}</string>
|
|
371
|
+
<key>CFBundleShortVersionString</key>
|
|
372
|
+
<string>${marketingVersion}</string>
|
|
373
|
+
<key>CFBundleVersion</key>
|
|
374
|
+
<string>${bundleVersion}</string>
|
|
375
|
+
</dict>
|
|
376
|
+
</plist>
|
|
377
|
+
`;
|
|
378
|
+
exports.default = withWidgetSourceFiles;
|
|
379
|
+
//# sourceMappingURL=withWidgetSourceFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withWid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AGqB,MAAM,CAAC,IAAI,0CAA0C,MAAM,CAAC,IAAI;QAChH,MAAM,CAAC,IAAI;;gCAEa,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;mBAC/C,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC;2BAC1B,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,sBAAsB,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,EAAE;;EAE1H,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAChB,eAAuB,EACvB,gBAAwB,EACxB,aAAqB,EACrB,EAAE,CAAC;;;;;;;;;;YAUO,eAAe;;WAEhB,gBAAgB;;WAEhB,aAAa;;;CAGvB,CAAC;AAEF,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { XcodeProject } from '@expo/config-plugins';
|
|
2
|
+
export declare function addBuildPhases(xcodeProject: XcodeProject, { targetUuid, groupName, productFile, widgetFiles, }: {
|
|
3
|
+
targetUuid: string;
|
|
4
|
+
groupName: string;
|
|
5
|
+
productFile: {
|
|
6
|
+
uuid: string;
|
|
7
|
+
target: string;
|
|
8
|
+
basename: string;
|
|
9
|
+
group: string;
|
|
10
|
+
};
|
|
11
|
+
widgetFiles: string[];
|
|
12
|
+
}): void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addBuildPhases = addBuildPhases;
|
|
4
|
+
function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, widgetFiles, }) {
|
|
5
|
+
const buildPath = `""`;
|
|
6
|
+
const folderType = 'app_extension';
|
|
7
|
+
const mainTargetUuid = xcodeProject.getFirstTarget().uuid;
|
|
8
|
+
// Sources build phase
|
|
9
|
+
if (!getBuildPhaseObject(xcodeProject, 'PBXSourcesBuildPhase', targetUuid)) {
|
|
10
|
+
xcodeProject.addBuildPhase([...widgetFiles], 'PBXSourcesBuildPhase', 'Sources', targetUuid, folderType, buildPath);
|
|
11
|
+
}
|
|
12
|
+
// Copy files build phase
|
|
13
|
+
if (!getBuildPhaseObject(xcodeProject, 'PBXCopyFilesBuildPhase', mainTargetUuid, groupName)) {
|
|
14
|
+
xcodeProject.addBuildPhase([], 'PBXCopyFilesBuildPhase', groupName, mainTargetUuid, folderType, buildPath);
|
|
15
|
+
}
|
|
16
|
+
const copyFilesBuildPhase = getBuildPhaseObject(xcodeProject, 'PBXCopyFilesBuildPhase', mainTargetUuid, groupName);
|
|
17
|
+
if (copyFilesBuildPhase &&
|
|
18
|
+
!copyFilesBuildPhase.files.some((file) => file.value === productFile.uuid)) {
|
|
19
|
+
copyFilesBuildPhase.files.push({
|
|
20
|
+
value: productFile.uuid,
|
|
21
|
+
comment: `${productFile.basename} in ${productFile.group}`,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (!xcodeProject.pbxBuildFileSection()[productFile.uuid]) {
|
|
25
|
+
xcodeProject.addToPbxBuildFileSection(productFile);
|
|
26
|
+
}
|
|
27
|
+
// Frameworks build phase
|
|
28
|
+
if (!getBuildPhaseObject(xcodeProject, 'PBXFrameworksBuildPhase', targetUuid)) {
|
|
29
|
+
xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', 'Frameworks', targetUuid, folderType, buildPath);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function getBuildPhaseObject(xcodeProject, buildPhaseType, targetUuid, comment) {
|
|
33
|
+
const buildPhaseSection = xcodeProject.hash.project.objects[buildPhaseType];
|
|
34
|
+
const target = xcodeProject.pbxNativeTargetSection()[targetUuid];
|
|
35
|
+
if (!buildPhaseSection || !(target === null || target === void 0 ? void 0 : target.buildPhases)) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const buildPhase = target.buildPhases.find((buildPhase) => (!comment || buildPhase.comment === comment) && buildPhaseSection[buildPhase.value]);
|
|
39
|
+
return buildPhase ? buildPhaseSection[buildPhase.value] : null;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=addBuildPhases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addBuildPhases.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addBuildPhases.ts"],"names":[],"mappings":";;AAEA,wCA6EC;AA7ED,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,IA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AC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addPbxGroup = addPbxGroup;
|
|
4
|
+
function addPbxGroup(xcodeProject, { targetName, widgetFiles, }) {
|
|
5
|
+
if (xcodeProject.pbxGroupByName(targetName)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
// Add PBX group
|
|
9
|
+
const { uuid: pbxGroupUuid } = xcodeProject.addPbxGroup(Array.from(new Set([...widgetFiles, `${targetName}.entitlements`])), targetName, targetName);
|
|
10
|
+
// Add PBXGroup to top level group
|
|
11
|
+
const groups = xcodeProject.hash.project.objects['PBXGroup'];
|
|
12
|
+
if (pbxGroupUuid) {
|
|
13
|
+
Object.keys(groups).forEach(function (key) {
|
|
14
|
+
if (groups[key].name === undefined && groups[key].path === undefined) {
|
|
15
|
+
xcodeProject.addToPbxGroup(pbxGroupUuid, key);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=addPbxGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addPbxGroup.js","sourceRoot":"","sources":["../../../../../plugin/ios/widgets/xcode/addPbxGroup.ts"],"names":[],"mappings":";;AAEA,kCA8BC;AA9BD,SAAgB,WAAW,CACzB,YAA0B,EAC1B,EACE,UAAU,EACV,WAAW,GAIZ;IAED,IAAI,YAAY,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5C,OAAO;IACT,CAAC;IAED,gBAAgB;IAChB,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,WAAW,CACrD,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,WAAW,EAAE,GAAG,UAAU,eAAe,CAAC,CAAC,CAAC,EACnE,UAAU,EACV,UAAU,CACX,CAAC;IAEF,kCAAkC;IAClC,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7D,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,GAAG;YACvC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBACrE,YAAY,CAAC,aAAa,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;YAChD,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|