expo-live-activity 0.2.1-alpha1 → 0.2.2-alpha1

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.
Files changed (72) hide show
  1. package/.prettierignore +5 -0
  2. package/.prettierrc +6 -0
  3. package/README.md +152 -56
  4. package/app.plugin.js +1 -1
  5. package/build/ExpoLiveActivityModule.d.ts.map +1 -1
  6. package/build/ExpoLiveActivityModule.js.map +1 -1
  7. package/build/index.d.ts +18 -2
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js +21 -33
  10. package/build/index.js.map +1 -1
  11. package/eslint.config.js +42 -0
  12. package/ios/ExpoLiveActivityModule.swift +154 -91
  13. package/ios/Helpers.swift +1 -2
  14. package/ios-files/Assets.xcassets/AccentColor.colorset/Contents.json +5 -5
  15. package/ios-files/Assets.xcassets/AppIcon.appiconset/Contents.json +19 -19
  16. package/ios-files/Assets.xcassets/Contents.json +3 -3
  17. package/ios-files/Assets.xcassets/WidgetBackground.colorset/Contents.json +5 -5
  18. package/ios-files/View+applyWidgetURL.swift +15 -1
  19. package/package.json +18 -6
  20. package/plugin/build/index.d.ts +1 -1
  21. package/plugin/build/index.js +8 -3
  22. package/plugin/build/lib/getWidgetExtensionEntitlements.d.ts +6 -2
  23. package/plugin/build/lib/getWidgetExtensionEntitlements.js +1 -1
  24. package/plugin/build/lib/getWidgetFiles.js +18 -17
  25. package/plugin/build/types.d.ts +1 -1
  26. package/plugin/build/withConfig.d.ts +1 -1
  27. package/plugin/build/withPlist.d.ts +5 -0
  28. package/plugin/build/withPlist.js +25 -0
  29. package/plugin/build/withPodfile.d.ts +1 -1
  30. package/plugin/build/withPodfile.js +5 -5
  31. package/plugin/build/withPushNotifications.d.ts +1 -1
  32. package/plugin/build/withPushNotifications.js +2 -2
  33. package/plugin/build/withWidgetExtensionEntitlements.d.ts +1 -1
  34. package/plugin/build/withWidgetExtensionEntitlements.js +1 -1
  35. package/plugin/build/withXcode.d.ts +1 -1
  36. package/plugin/build/withXcode.js +8 -8
  37. package/plugin/build/xcode/addBuildPhases.d.ts +2 -2
  38. package/plugin/build/xcode/addBuildPhases.js +8 -10
  39. package/plugin/build/xcode/addPbxGroup.d.ts +2 -2
  40. package/plugin/build/xcode/addPbxGroup.js +2 -2
  41. package/plugin/build/xcode/addProductFile.d.ts +1 -1
  42. package/plugin/build/xcode/addProductFile.js +3 -3
  43. package/plugin/build/xcode/addTargetDependency.d.ts +1 -1
  44. package/plugin/build/xcode/addTargetDependency.js +5 -7
  45. package/plugin/build/xcode/addToPbxNativeTargetSection.d.ts +1 -1
  46. package/plugin/build/xcode/addToPbxNativeTargetSection.js +5 -5
  47. package/plugin/build/xcode/addToPbxProjectSection.d.ts +1 -1
  48. package/plugin/build/xcode/addToPbxProjectSection.js +1 -2
  49. package/plugin/build/xcode/addXCConfigurationList.d.ts +1 -1
  50. package/plugin/build/xcode/addXCConfigurationList.js +6 -6
  51. package/plugin/src/index.ts +19 -18
  52. package/plugin/src/lib/getWidgetExtensionEntitlements.ts +10 -13
  53. package/plugin/src/lib/getWidgetFiles.ts +70 -74
  54. package/plugin/src/types.ts +3 -5
  55. package/plugin/src/withConfig.ts +15 -15
  56. package/plugin/src/withPlist.ts +27 -0
  57. package/plugin/src/withPodfile.ts +17 -24
  58. package/plugin/src/withPushNotifications.ts +7 -11
  59. package/plugin/src/withWidgetExtensionEntitlements.ts +14 -14
  60. package/plugin/src/withXcode.ts +32 -41
  61. package/plugin/src/xcode/addBuildPhases.ts +26 -41
  62. package/plugin/src/xcode/addPbxGroup.ts +9 -16
  63. package/plugin/src/xcode/addProductFile.ts +7 -7
  64. package/plugin/src/xcode/addTargetDependency.ts +7 -12
  65. package/plugin/src/xcode/addToPbxNativeTargetSection.ts +13 -15
  66. package/plugin/src/xcode/addToPbxProjectSection.ts +7 -17
  67. package/plugin/src/xcode/addXCConfigurationList.ts +16 -16
  68. package/plugin/tsconfig.tsbuildinfo +1 -1
  69. package/scripts/update-version.sh +15 -0
  70. package/src/ExpoLiveActivityModule.ts +2 -2
  71. package/src/index.ts +69 -55
  72. package/.eslintrc.js +0 -5
@@ -0,0 +1,5 @@
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
+ declare const withPlist: ConfigPlugin<{
3
+ targetName: string;
4
+ }>;
5
+ export default withPlist;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const config_plugins_1 = require("@expo/config-plugins");
7
+ const plist_1 = __importDefault(require("@expo/plist"));
8
+ const fs_1 = require("fs");
9
+ const path_1 = require("path");
10
+ const withPlist = (expoConfig, { targetName }) => (0, config_plugins_1.withInfoPlist)(expoConfig, (plistConfig) => {
11
+ const scheme = typeof expoConfig.scheme === 'string' ? expoConfig.scheme : expoConfig.ios?.bundleIdentifier;
12
+ if (scheme) {
13
+ const targetPath = (0, path_1.join)(plistConfig.modRequest.platformProjectRoot, targetName);
14
+ const filePath = (0, path_1.join)(targetPath, 'Info.plist');
15
+ const content = plist_1.default.parse((0, fs_1.readFileSync)(filePath, 'utf8'));
16
+ content.CFBundleURLTypes = [
17
+ {
18
+ CFBundleURLSchemes: [scheme],
19
+ },
20
+ ];
21
+ (0, fs_1.writeFileSync)(filePath, plist_1.default.build(content));
22
+ }
23
+ return plistConfig;
24
+ });
25
+ exports.default = withPlist;
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
2
  export declare const withPodfile: ConfigPlugin<{
3
3
  targetName: string;
4
4
  }>;
@@ -34,15 +34,15 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.withPodfile = void 0;
37
- const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
38
37
  const config_plugins_1 = require("@expo/config-plugins");
38
+ const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
39
39
  const fs = __importStar(require("fs"));
40
40
  const path = __importStar(require("path"));
41
41
  const withPodfile = (config, { targetName }) => {
42
42
  return (0, config_plugins_1.withDangerousMod)(config, [
43
- "ios",
43
+ 'ios',
44
44
  (config) => {
45
- const podFilePath = path.join(config.modRequest.platformProjectRoot, "Podfile");
45
+ const podFilePath = path.join(config.modRequest.platformProjectRoot, 'Podfile');
46
46
  let podFileContent = fs.readFileSync(podFilePath).toString();
47
47
  /* podFileContent = mergeContents({
48
48
  tag: "withWidgetExtensionPodfile1999999999",
@@ -57,7 +57,7 @@ const withPodfile = (config, { targetName }) => {
57
57
  `use_expo_modules!(searchPaths: ["./node_modules", "../../node_modules", "../../../WidgetExtension"])`
58
58
  ); */
59
59
  podFileContent = (0, generateCode_1.mergeContents)({
60
- tag: "react-native-widget-extension-1",
60
+ tag: 'react-native-widget-extension-1',
61
61
  src: podFileContent,
62
62
  newSrc: `installer.pods_project.targets.each do |target|
63
63
  target.build_configurations.each do |config|
@@ -67,7 +67,7 @@ const withPodfile = (config, { targetName }) => {
67
67
  end`,
68
68
  anchor: /installer.target_installation_results.pod_target_installation_results/,
69
69
  offset: 0,
70
- comment: "#",
70
+ comment: '#',
71
71
  }).contents;
72
72
  /* podFileContent = mergeContents({
73
73
  tag: "react-native-widget-extension-2",
@@ -1,2 +1,2 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
2
  export declare const withPushNotifications: ConfigPlugin;
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.withPushNotifications = void 0;
4
4
  const config_plugins_1 = require("@expo/config-plugins");
5
5
  const withPushNotifications = (config) => (0, config_plugins_1.withInfoPlist)((0, config_plugins_1.withEntitlementsPlist)(config, (mod) => {
6
- mod.modResults["aps-environment"] = "development";
6
+ mod.modResults['aps-environment'] = 'development';
7
7
  return mod;
8
8
  }), (mod) => {
9
- mod.modResults["ExpoLiveActivity_EnablePushNotifications"] = true;
9
+ mod.modResults['ExpoLiveActivity_EnablePushNotifications'] = true;
10
10
  return mod;
11
11
  });
12
12
  exports.withPushNotifications = withPushNotifications;
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
2
  export declare const withWidgetExtensionEntitlements: ConfigPlugin<{
3
3
  targetName: string;
4
4
  targetPath: string;
@@ -37,8 +37,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.withWidgetExtensionEntitlements = void 0;
40
- const plist_1 = __importDefault(require("@expo/plist"));
41
40
  const config_plugins_1 = require("@expo/config-plugins");
41
+ const plist_1 = __importDefault(require("@expo/plist"));
42
42
  const fs = __importStar(require("fs"));
43
43
  const path = __importStar(require("path"));
44
44
  // import { getWidgetExtensionEntitlements } from "./lib/getWidgetExtensionEntitlements";
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from "@expo/config-plugins";
1
+ import { ConfigPlugin } from '@expo/config-plugins';
2
2
  export declare const withXcode: ConfigPlugin<{
3
3
  targetName: string;
4
4
  bundleIdentifier: string;
@@ -36,26 +36,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.withXcode = void 0;
37
37
  const config_plugins_1 = require("@expo/config-plugins");
38
38
  const path = __importStar(require("path"));
39
- const addXCConfigurationList_1 = require("./xcode/addXCConfigurationList");
39
+ const getWidgetFiles_1 = require("./lib/getWidgetFiles");
40
+ const addBuildPhases_1 = require("./xcode/addBuildPhases");
41
+ const addPbxGroup_1 = require("./xcode/addPbxGroup");
40
42
  const addProductFile_1 = require("./xcode/addProductFile");
43
+ const addTargetDependency_1 = require("./xcode/addTargetDependency");
41
44
  const addToPbxNativeTargetSection_1 = require("./xcode/addToPbxNativeTargetSection");
42
45
  const addToPbxProjectSection_1 = require("./xcode/addToPbxProjectSection");
43
- const addTargetDependency_1 = require("./xcode/addTargetDependency");
44
- const addPbxGroup_1 = require("./xcode/addPbxGroup");
45
- const addBuildPhases_1 = require("./xcode/addBuildPhases");
46
- const getWidgetFiles_1 = require("./lib/getWidgetFiles");
47
- const withXcode = (config, { targetName, bundleIdentifier, deploymentTarget, }) => {
46
+ const addXCConfigurationList_1 = require("./xcode/addXCConfigurationList");
47
+ const withXcode = (config, { targetName, bundleIdentifier, deploymentTarget }) => {
48
48
  return (0, config_plugins_1.withXcodeProject)(config, (config) => {
49
49
  const xcodeProject = config.modResults;
50
50
  const targetUuid = xcodeProject.generateUuid();
51
- const groupName = "Embed Foundation Extensions";
51
+ const groupName = 'Embed Foundation Extensions';
52
52
  const { platformProjectRoot } = config.modRequest;
53
53
  const marketingVersion = config.version;
54
54
  const targetPath = path.join(platformProjectRoot, targetName);
55
55
  const widgetFiles = (0, getWidgetFiles_1.getWidgetFiles)(targetPath);
56
56
  const xCConfigurationList = (0, addXCConfigurationList_1.addXCConfigurationList)(xcodeProject, {
57
57
  targetName,
58
- currentProjectVersion: config.ios.buildNumber || "1",
58
+ currentProjectVersion: config.ios.buildNumber || '1',
59
59
  bundleIdentifier,
60
60
  deploymentTarget,
61
61
  marketingVersion,
@@ -1,5 +1,5 @@
1
- import { XcodeProject } from "@expo/config-plugins";
2
- import { WidgetFiles } from "../lib/getWidgetFiles";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
+ import { WidgetFiles } from '../lib/getWidgetFiles';
3
3
  export declare function addBuildPhases(xcodeProject: XcodeProject, { targetUuid, groupName, productFile, widgetFiles, }: {
4
4
  targetUuid: string;
5
5
  groupName: string;
@@ -37,21 +37,19 @@ exports.addBuildPhases = addBuildPhases;
37
37
  const util = __importStar(require("util"));
38
38
  function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, widgetFiles, }) {
39
39
  const buildPath = `""`;
40
- const folderType = "app_extension";
41
- const { swiftFiles, intentFiles, assetDirectories, entitlementFiles, plistFiles, } = widgetFiles;
40
+ const folderType = 'app_extension';
41
+ const { swiftFiles, intentFiles, assetDirectories } = widgetFiles;
42
42
  // Sources build phase
43
- xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles], "PBXSourcesBuildPhase", groupName, targetUuid, folderType, buildPath);
43
+ xcodeProject.addBuildPhase([...swiftFiles, ...intentFiles], 'PBXSourcesBuildPhase', groupName, targetUuid, folderType, buildPath);
44
44
  // Copy files build phase
45
- xcodeProject.addBuildPhase([], "PBXCopyFilesBuildPhase", groupName, xcodeProject.getFirstTarget().uuid, folderType, buildPath);
46
- xcodeProject
47
- .buildPhaseObject("PBXCopyFilesBuildPhase", groupName, productFile.target)
48
- .files.push({
45
+ xcodeProject.addBuildPhase([], 'PBXCopyFilesBuildPhase', groupName, xcodeProject.getFirstTarget().uuid, folderType, buildPath);
46
+ xcodeProject.buildPhaseObject('PBXCopyFilesBuildPhase', groupName, productFile.target).files.push({
49
47
  value: productFile.uuid,
50
- comment: util.format("%s in %s", productFile.basename, productFile.group), // longComment(file);
48
+ comment: util.format('%s in %s', productFile.basename, productFile.group), // longComment(file);
51
49
  });
52
50
  xcodeProject.addToPbxBuildFileSection(productFile);
53
51
  // Frameworks build phase
54
- xcodeProject.addBuildPhase([], "PBXFrameworksBuildPhase", groupName, targetUuid, folderType, buildPath);
52
+ xcodeProject.addBuildPhase([], 'PBXFrameworksBuildPhase', groupName, targetUuid, folderType, buildPath);
55
53
  // Resources build phase
56
- xcodeProject.addBuildPhase([...assetDirectories], "PBXResourcesBuildPhase", groupName, targetUuid, folderType, buildPath);
54
+ xcodeProject.addBuildPhase([...assetDirectories], 'PBXResourcesBuildPhase', groupName, targetUuid, folderType, buildPath);
57
55
  }
@@ -1,5 +1,5 @@
1
- import { XcodeProject } from "@expo/config-plugins";
2
- import { WidgetFiles } from "../lib/getWidgetFiles";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
+ import { WidgetFiles } from '../lib/getWidgetFiles';
3
3
  export declare function addPbxGroup(xcodeProject: XcodeProject, { targetName, widgetFiles, }: {
4
4
  targetName: string;
5
5
  widgetFiles: WidgetFiles;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addPbxGroup = addPbxGroup;
4
4
  function addPbxGroup(xcodeProject, { targetName, widgetFiles, }) {
5
- const { swiftFiles, intentFiles, otherFiles, assetDirectories, entitlementFiles, plistFiles, } = widgetFiles;
5
+ const { swiftFiles, intentFiles, otherFiles, assetDirectories, entitlementFiles, plistFiles } = widgetFiles;
6
6
  // Add PBX group
7
7
  const { uuid: pbxGroupUuid } = xcodeProject.addPbxGroup([
8
8
  ...swiftFiles,
@@ -14,7 +14,7 @@ function addPbxGroup(xcodeProject, { targetName, widgetFiles, }) {
14
14
  `${targetName}.entitlements`,
15
15
  ], targetName, targetName);
16
16
  // Add PBXGroup to top level group
17
- const groups = xcodeProject.hash.project.objects["PBXGroup"];
17
+ const groups = xcodeProject.hash.project.objects['PBXGroup'];
18
18
  if (pbxGroupUuid) {
19
19
  Object.keys(groups).forEach(function (key) {
20
20
  if (groups[key].name === undefined && groups[key].path === undefined) {
@@ -1,4 +1,4 @@
1
- import { XcodeProject } from "@expo/config-plugins";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
2
  export declare function addProductFile(xcodeProject: XcodeProject, { targetName, groupName }: {
3
3
  targetName: string;
4
4
  groupName: string;
@@ -7,14 +7,14 @@ function addProductFile(xcodeProject, { targetName, groupName }) {
7
7
  // fileRef: xcodeProject.generateUuid(),
8
8
  // uuid: xcodeProject.generateUuid(),
9
9
  group: groupName,
10
- explicitFileType: "wrapper.app-extension",
10
+ explicitFileType: 'wrapper.app-extension',
11
11
  /* fileEncoding: 4, */
12
12
  settings: {
13
- ATTRIBUTES: ["RemoveHeadersOnCopy"],
13
+ ATTRIBUTES: ['RemoveHeadersOnCopy'],
14
14
  },
15
15
  includeInIndex: 0,
16
16
  path: `${targetName}.appex`,
17
- sourceTree: "BUILT_PRODUCTS_DIR",
17
+ sourceTree: 'BUILT_PRODUCTS_DIR',
18
18
  };
19
19
  const productFile = xcodeProject.addProductFile(targetName, options);
20
20
  return productFile;
@@ -1,4 +1,4 @@
1
- import { XcodeProject } from "@expo/config-plugins";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
2
  export declare function addTargetDependency(xcodeProject: XcodeProject, target: {
3
3
  uuid: string;
4
4
  }): void;
@@ -2,13 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addTargetDependency = addTargetDependency;
4
4
  function addTargetDependency(xcodeProject, target) {
5
- if (!xcodeProject.hash.project.objects["PBXTargetDependency"]) {
6
- xcodeProject.hash.project.objects["PBXTargetDependency"] = {};
5
+ if (!xcodeProject.hash.project.objects['PBXTargetDependency']) {
6
+ xcodeProject.hash.project.objects['PBXTargetDependency'] = {};
7
7
  }
8
- if (!xcodeProject.hash.project.objects["PBXContainerItemProxy"]) {
9
- xcodeProject.hash.project.objects["PBXContainerItemProxy"] = {};
8
+ if (!xcodeProject.hash.project.objects['PBXContainerItemProxy']) {
9
+ xcodeProject.hash.project.objects['PBXContainerItemProxy'] = {};
10
10
  }
11
- xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [
12
- target.uuid,
13
- ]);
11
+ xcodeProject.addTargetDependency(xcodeProject.getFirstTarget().uuid, [target.uuid]);
14
12
  }
@@ -1,4 +1,4 @@
1
- import { XcodeProject } from "@expo/config-plugins";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
2
  export declare function addToPbxNativeTargetSection(xcodeProject: XcodeProject, { targetName, targetUuid, productFile, xCConfigurationList, }: {
3
3
  targetName: string;
4
4
  targetUuid: string;
@@ -5,7 +5,7 @@ function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, pro
5
5
  const target = {
6
6
  uuid: targetUuid,
7
7
  pbxNativeTarget: {
8
- isa: "PBXNativeTarget",
8
+ isa: 'PBXNativeTarget',
9
9
  name: targetName,
10
10
  productName: targetName,
11
11
  productReference: productFile.fileRef,
@@ -17,10 +17,10 @@ function addToPbxNativeTargetSection(xcodeProject, { targetName, targetUuid, pro
17
17
  },
18
18
  };
19
19
  xcodeProject.addToPbxNativeTargetSection(target);
20
- const frameworksGroup = xcodeProject.findPBXGroupKey({ name: "Frameworks" });
21
- const file1 = xcodeProject.addFile("WidgetKit.framework", frameworksGroup);
22
- const file2 = xcodeProject.addFile("SwiftUI.framework", frameworksGroup);
23
- const frameworksBuildPhaseObj = xcodeProject.pbxFrameworksBuildPhaseObj(target.uuid);
20
+ // const frameworksGroup = xcodeProject.findPBXGroupKey({ name: 'Frameworks' })
21
+ // const file1 = xcodeProject.addFile('WidgetKit.framework', frameworksGroup)
22
+ // const file2 = xcodeProject.addFile('SwiftUI.framework', frameworksGroup)
23
+ // const frameworksBuildPhaseObj = xcodeProject.pbxFrameworksBuildPhaseObj(target.uuid)
24
24
  /* console.log(
25
25
  { file1, file2, frameworksBuildPhaseObj },
26
26
  frameworksBuildPhaseObj.files
@@ -1,4 +1,4 @@
1
- import { XcodeProject } from "@expo/config-plugins";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
2
  export declare function addToPbxProjectSection(xcodeProject: XcodeProject, target: {
3
3
  uuid: string;
4
4
  }): void;
@@ -4,8 +4,7 @@ exports.addToPbxProjectSection = addToPbxProjectSection;
4
4
  function addToPbxProjectSection(xcodeProject, target) {
5
5
  xcodeProject.addToPbxProjectSection(target);
6
6
  // Add target attributes to project section
7
- if (!xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid]
8
- .attributes.TargetAttributes) {
7
+ if (!xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes) {
9
8
  xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes = {};
10
9
  }
11
10
  xcodeProject.pbxProjectSection()[xcodeProject.getFirstProject().uuid].attributes.TargetAttributes[target.uuid] = {
@@ -1,4 +1,4 @@
1
- import { XcodeProject } from "@expo/config-plugins";
1
+ import { XcodeProject } from '@expo/config-plugins';
2
2
  export declare function addXCConfigurationList(xcodeProject: XcodeProject, { targetName, currentProjectVersion, bundleIdentifier, deploymentTarget, marketingVersion, }: {
3
3
  targetName: string;
4
4
  currentProjectVersion: string;
@@ -26,7 +26,7 @@ function addXCConfigurationList(xcodeProject, { targetName, currentProjectVersio
26
26
  SWIFT_EMIT_LOC_STRINGS = YES;
27
27
  SWIFT_OPTIMIZATION_LEVEL = "-Onone"; */
28
28
  PRODUCT_NAME: `"$(TARGET_NAME)"`,
29
- SWIFT_VERSION: "5.0",
29
+ SWIFT_VERSION: '5.0',
30
30
  TARGETED_DEVICE_FAMILY: `"1,2"`,
31
31
  INFOPLIST_FILE: `${targetName}/Info.plist`,
32
32
  CURRENT_PROJECT_VERSION: `"${currentProjectVersion}"`,
@@ -42,20 +42,20 @@ function addXCConfigurationList(xcodeProject, { targetName, currentProjectVersio
42
42
  };
43
43
  const buildConfigurationsList = [
44
44
  {
45
- name: "Debug",
46
- isa: "XCBuildConfiguration",
45
+ name: 'Debug',
46
+ isa: 'XCBuildConfiguration',
47
47
  buildSettings: {
48
48
  ...commonBuildSettings,
49
49
  },
50
50
  },
51
51
  {
52
- name: "Release",
53
- isa: "XCBuildConfiguration",
52
+ name: 'Release',
53
+ isa: 'XCBuildConfiguration',
54
54
  buildSettings: {
55
55
  ...commonBuildSettings,
56
56
  },
57
57
  },
58
58
  ];
59
- const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList, "Release", `Build configuration list for PBXNativeTarget "${targetName}"`);
59
+ const xCConfigurationList = xcodeProject.addXCConfigurationList(buildConfigurationsList, 'Release', `Build configuration list for PBXNativeTarget "${targetName}"`);
60
60
  return xCConfigurationList;
61
61
  }
@@ -1,17 +1,17 @@
1
- import { IOSConfig, withPlugins } from "expo/config-plugins";
2
- import type { LiveActivityConfigPlugin } from "./types";
3
- import { withConfig } from "./withConfig";
4
- import { withPodfile } from "./withPodfile";
5
- import { withXcode } from "./withXcode";
6
- import { withWidgetExtensionEntitlements } from "./withWidgetExtensionEntitlements";
7
- import { withPushNotifications } from "./withPushNotifications";
1
+ import { IOSConfig, withPlugins } from 'expo/config-plugins'
2
+
3
+ import type { LiveActivityConfigPlugin } from './types'
4
+ import { withConfig } from './withConfig'
5
+ import withPlist from './withPlist'
6
+ import { withPodfile } from './withPodfile'
7
+ import { withPushNotifications } from './withPushNotifications'
8
+ import { withWidgetExtensionEntitlements } from './withWidgetExtensionEntitlements'
9
+ import { withXcode } from './withXcode'
8
10
 
9
11
  const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) => {
10
- const deploymentTarget = "16.2";
11
- const targetName = `${IOSConfig.XcodeUtils.sanitizedName(
12
- config.name,
13
- )}LiveActivity`;
14
- const bundleIdentifier = `${config.ios?.bundleIdentifier}.${targetName}`;
12
+ const deploymentTarget = '16.2'
13
+ const targetName = `${IOSConfig.XcodeUtils.sanitizedName(config.name)}LiveActivity`
14
+ const bundleIdentifier = `${config.ios?.bundleIdentifier}.${targetName}`
15
15
 
16
16
  config.ios = {
17
17
  ...config.ios,
@@ -20,9 +20,10 @@ const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) =
20
20
  NSSupportsLiveActivities: true,
21
21
  NSSupportsLiveActivitiesFrequentUpdates: false,
22
22
  },
23
- };
23
+ }
24
24
 
25
25
  config = withPlugins(config, [
26
+ [withPlist, { targetName }],
26
27
  [
27
28
  withXcode,
28
29
  {
@@ -34,13 +35,13 @@ const withWidgetsAndLiveActivities: LiveActivityConfigPlugin = (config, props) =
34
35
  [withWidgetExtensionEntitlements, { targetName }],
35
36
  [withPodfile, { targetName }],
36
37
  [withConfig, { targetName, bundleIdentifier }],
37
- ]);
38
+ ])
38
39
 
39
40
  if (props?.enablePushNotifications) {
40
- config = withPushNotifications(config);
41
+ config = withPushNotifications(config)
41
42
  }
42
43
 
43
- return config;
44
- };
44
+ return config
45
+ }
45
46
 
46
- export default withWidgetsAndLiveActivities;
47
+ export default withWidgetsAndLiveActivities
@@ -1,18 +1,15 @@
1
- import { ExportedConfig, InfoPlist } from "@expo/config-plugins";
1
+ import { ExportedConfig, InfoPlist } from '@expo/config-plugins'
2
2
 
3
- export function getWidgetExtensionEntitlements(
4
- iosConfig: ExportedConfig["ios"],
5
- {
6
- // groupIdentifier,
7
- }: {
8
- // groupIdentifier?: string;
9
- }
10
- ) {
11
- const entitlements: InfoPlist = {};
3
+ interface Options {
4
+ groupIdentifier?: string
5
+ }
6
+
7
+ export function getWidgetExtensionEntitlements(_iosConfig: ExportedConfig['ios'], _options: Options | undefined = {}) {
8
+ const entitlements: InfoPlist = {}
12
9
 
13
- addApplicationGroupsEntitlement(entitlements);
10
+ addApplicationGroupsEntitlement(entitlements)
14
11
 
15
- return entitlements;
12
+ return entitlements
16
13
  }
17
14
 
18
15
  export function addApplicationGroupsEntitlement(entitlements: InfoPlist, groupIdentifier?: string) {
@@ -22,5 +19,5 @@ export function addApplicationGroupsEntitlement(entitlements: InfoPlist, groupId
22
19
  // entitlements["com.apple.security.application-groups"] = [groupIdentifier, ...existingApplicationGroups];
23
20
  // }
24
21
 
25
- return entitlements;
22
+ return entitlements
26
23
  }