@react-native-tvos/config-tv 0.0.11 → 0.0.13

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/README.md CHANGED
@@ -66,10 +66,10 @@ _Plugin parameters_:
66
66
  - `DEBUG=expo:*` (shows debug messages from all plugins)
67
67
  - `DEBUG=expo:react-native-tvos:config-tv` (shows debug messages from this plugin only)
68
68
  - `tvosDeploymentTarget`: (optional string, default '13.4') Used to set the tvOS deployment target version in the Xcode project.
69
- - `removeFlipperOnAndroid`: (optional boolean, default true) Used to remove the Flipper dependency from `MainApplication.kt` (or `MainApplication.java`) and `android/app/build.gradle`. This is necessary for React Native TV 0.73 and higher, since Flipper integration is removed from these versions. If this causes issues, set the value to false, run `npx expo prebuild --clean` again, and then remove Flipper from your Android source manually. This change will be made regardless of the setting of the `EXPO_TV` environment variable or the value of the `isTV` plugin parameter, as it is needed for both Android mobile and Android TV.
69
+ - `removeFlipperOnAndroid`: (optional boolean, default false) Used to remove the Flipper dependency from `MainApplication.kt` (or `MainApplication.java`) and `android/app/build.gradle`. This may be necessary for React Native TV 0.73 and higher, since Flipper integration is removed from these versions. If this causes issues, set the value to false, run `npx expo prebuild --clean` again, and then remove Flipper from your Android source manually. If enabled, this change will be made regardless of the setting of the `EXPO_TV` environment variable or the value of the `isTV` plugin parameter.
70
70
  - `androidTVRequired`: (optional boolean, default false) If set, the Android manifest will be configured for Android TV only (no Android mobile support). Specifically, the "uses-feature" tag for "android.software.leanback" will be set to "required=true".
71
71
  - `androidTVBanner`: (optional string) If set, this should be a path to an existing PNG file appropriate for an Android TV banner image. See https://developer.android.com/design/ui/tv/guides/system/tv-app-icon-guidelines#banner . The Android manifest will be modified to reference this image, and the image will be copied into Android resource drawable directories.
72
- - `androidTVIcon`: (optional string) If set, this should be a path to an existing PNG file appropriate for an Android TV icon image. See https://developer.android.com/design/ui/tv/guides/system/tv-app-icon-guidelines#launcher-icon . The Android manifest will be modified to reference this image, and the image will be copied into Android resource drawable and mipmap directories.
72
+ - `androidTVIcon`: (optional string) If set, this should be a path to an existing PNG file appropriate for an Android TV icon image. See https://developer.android.com/design/ui/tv/guides/system/tv-app-icon-guidelines#launcher-icon . The Android manifest will be modified to reference this image, and the image will be copied into Android resource drawable and mipmap directories.
73
73
  - `appleTVImages`: (optional object) If set, this is an object with the paths to images needed to construct the Apple TV icon and top shelf brand assets. The images will be used to construct a brand asset catalog in the Xcode project Image catalog, and the project updated to use the brand assets as the source for the app icons. If this property is set, all image paths must be defined and the files must exist, or an error will be thrown. The images need to be the exact sizes shown here, in order to avoid errors during Xcode compilation and on submission to the App Store or TestFlight.
74
74
  - `icon`: (string) Path to a 1280x760 image
75
75
  - `iconSmall`: (string) Path to a 400x240 image
package/build/types.d.ts CHANGED
@@ -50,9 +50,9 @@ export type ConfigData = {
50
50
  */
51
51
  tvosDeploymentTarget?: string;
52
52
  /**
53
- * If set, Android code that references Flipper will be removed. (Defaults to true.)
54
- * This change will be made regardless of the setting of the `EXPO_TV` environment variable or
55
- * the value of the `isTV` plugin parameter, as it is needed for both Android mobile and Android TV.
53
+ * If set, Android code that references Flipper will be removed. (Defaults to false.)
54
+ * If enabled, this change will be made regardless of the setting of the `EXPO_TV` environment variable or
55
+ * the value of the `isTV` plugin parameter.
56
56
  */
57
57
  removeFlipperOnAndroid?: boolean;
58
58
  /**
@@ -1,10 +1,10 @@
1
- export type ContentsJsonImageIdiom = 'tv';
1
+ export type ContentsJsonImageIdiom = "tv";
2
2
  export type ContentsJsonImageAppearance = {
3
- appearance: 'luminosity';
4
- value: 'dark';
3
+ appearance: "luminosity";
4
+ value: "dark";
5
5
  };
6
- export type ContentsJsonImageScale = '1x' | '2x' | '3x';
7
- export type ContentsJsonImageRole = 'primary-app-icon' | 'top-shelf-image' | 'top-shelf-image-wide';
6
+ export type ContentsJsonImageScale = "1x" | "2x" | "3x";
7
+ export type ContentsJsonImageRole = "primary-app-icon" | "top-shelf-image" | "top-shelf-image-wide";
8
8
  export interface ContentsJsonImage {
9
9
  appearances?: ContentsJsonImageAppearance[];
10
10
  idiom: ContentsJsonImageIdiom;
@@ -14,14 +14,14 @@ const path_1 = __importDefault(require("path"));
14
14
  */
15
15
  async function writeContentsJsonAsync(directory, options) {
16
16
  await fs_1.promises.mkdir(directory, { recursive: true });
17
- await fs_1.promises.writeFile(path_1.default.join(directory, 'Contents.json'), JSON.stringify({
17
+ await fs_1.promises.writeFile(path_1.default.join(directory, "Contents.json"), JSON.stringify({
18
18
  assets: options.assets,
19
19
  images: options.images,
20
20
  layers: options.layers,
21
21
  info: {
22
22
  version: 1,
23
23
  // common practice is for the tool that generated the icons to be the "author"
24
- author: 'expo',
24
+ author: "expo",
25
25
  },
26
26
  }, null, 2));
27
27
  }
@@ -34,7 +34,7 @@ async function createImageSetAsync(destinationPath, imageSet) {
34
34
  await writeContentsJsonAsync(imageSetPath, {
35
35
  images: imageSet.sourceImages.map((image) => ({
36
36
  filename: path_1.default.basename(image.path),
37
- idiom: 'tv',
37
+ idiom: "tv",
38
38
  scale: image.scale,
39
39
  })),
40
40
  });
@@ -50,7 +50,7 @@ async function createImageStackLayerAsync(destinationPath, layer) {
50
50
  const imageStackLayerPath = path_1.default.join(destinationPath, `${layer.name}.imagestacklayer`);
51
51
  await writeContentsJsonAsync(imageStackLayerPath, {});
52
52
  await createImageSetAsync(imageStackLayerPath, {
53
- name: 'Content',
53
+ name: "Content",
54
54
  sourceImages: layer.sourceImages,
55
55
  });
56
56
  }
@@ -85,7 +85,7 @@ async function createBrandAssetsAsync(destinationPath, brandAssets) {
85
85
  filename: `${brandAsset.imageStack.name}.imagestack`,
86
86
  role: brandAsset.role,
87
87
  size: brandAsset.size,
88
- idiom: 'tv',
88
+ idiom: "tv",
89
89
  };
90
90
  }
91
91
  else if (brandAsset.imageSet) {
@@ -93,7 +93,7 @@ async function createBrandAssetsAsync(destinationPath, brandAssets) {
93
93
  filename: `${brandAsset.imageSet.name}.imageset`,
94
94
  role: brandAsset.role,
95
95
  size: brandAsset.size,
96
- idiom: 'tv',
96
+ idiom: "tv",
97
97
  };
98
98
  }
99
99
  else {
@@ -1,4 +1,4 @@
1
- import { ConfigData } from '../types';
1
+ import { ConfigData } from "../types";
2
2
  export declare const packageNameAndVersion: string;
3
3
  export declare function isTVEnabled(params: ConfigData): boolean;
4
4
  export declare function tvosDeploymentTarget(params: ConfigData): string;
@@ -5,12 +5,12 @@ const getenv_1 = require("getenv");
5
5
  class Env {
6
6
  /** Enable prebuild for TV */
7
7
  get EXPO_TV() {
8
- return (0, getenv_1.boolish)('EXPO_TV', false);
8
+ return (0, getenv_1.boolish)("EXPO_TV", false);
9
9
  }
10
10
  }
11
11
  const env = new Env();
12
- const pkg = require('../../package.json');
13
- const defaultTvosDeploymentVersion = '13.4';
12
+ const pkg = require("../../package.json");
13
+ const defaultTvosDeploymentVersion = "13.4";
14
14
  exports.packageNameAndVersion = `${pkg.name}@${pkg.version}`;
15
15
  function isTVEnabled(params) {
16
16
  return env.EXPO_TV || (params?.isTV ?? false);
@@ -21,7 +21,7 @@ function tvosDeploymentTarget(params) {
21
21
  }
22
22
  exports.tvosDeploymentTarget = tvosDeploymentTarget;
23
23
  function shouldRemoveFlipperOnAndroid(params) {
24
- return params?.removeFlipperOnAndroid ?? true;
24
+ return params?.removeFlipperOnAndroid ?? false;
25
25
  }
26
26
  exports.shouldRemoveFlipperOnAndroid = shouldRemoveFlipperOnAndroid;
27
27
  function isAndroidTVRequired(params) {
@@ -37,29 +37,29 @@ function androidTVIcon(params) {
37
37
  }
38
38
  exports.androidTVIcon = androidTVIcon;
39
39
  exports.appleTVImageTypes = [
40
- 'icon',
41
- 'iconSmall',
42
- 'iconSmall2x',
43
- 'topShelf',
44
- 'topShelf2x',
45
- 'topShelfWide',
46
- 'topShelfWide2x',
40
+ "icon",
41
+ "iconSmall",
42
+ "iconSmall2x",
43
+ "topShelf",
44
+ "topShelf2x",
45
+ "topShelfWide",
46
+ "topShelfWide2x",
47
47
  ];
48
48
  function appleTVImagePathForType(params, imageType) {
49
49
  switch (imageType) {
50
- case 'icon':
50
+ case "icon":
51
51
  return params?.appleTVImages?.icon;
52
- case 'iconSmall':
52
+ case "iconSmall":
53
53
  return params?.appleTVImages?.iconSmall;
54
- case 'iconSmall2x':
54
+ case "iconSmall2x":
55
55
  return params?.appleTVImages?.iconSmall2x;
56
- case 'topShelf':
56
+ case "topShelf":
57
57
  return params?.appleTVImages?.topShelf;
58
- case 'topShelf2x':
58
+ case "topShelf2x":
59
59
  return params?.appleTVImages?.topShelf2x;
60
- case 'topShelfWide':
60
+ case "topShelfWide":
61
61
  return params?.appleTVImages?.topShelfWide;
62
- case 'topShelfWide2x':
62
+ case "topShelfWide2x":
63
63
  return params?.appleTVImages?.topShelfWide2x;
64
64
  default:
65
65
  return undefined;
@@ -1,3 +1,3 @@
1
- export * from './appleBrandAssets';
2
- export * from './config';
3
- export * from './log';
1
+ export * from "./appleBrandAssets";
2
+ export * from "./config";
3
+ export * from "./log";
@@ -1,6 +1,6 @@
1
- import { ConfigData } from '../types';
1
+ import { ConfigData } from "../types";
2
2
  export declare function verboseLog(message: string, options?: {
3
3
  params?: ConfigData;
4
- platform?: 'android' | 'ios';
4
+ platform?: "android" | "ios";
5
5
  property?: string;
6
6
  }): void;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verboseLog = void 0;
4
- const debug = require('debug')('expo:react-native-tvos:config-tv');
4
+ const debug = require("debug")("expo:react-native-tvos:config-tv");
5
5
  function verboseLog(message, options) {
6
6
  const tokens = [message];
7
7
  options?.property && tokens.unshift(options?.property);
8
8
  options?.platform && tokens.unshift(options?.platform);
9
- debug(tokens.join(': '));
9
+ debug(tokens.join(": "));
10
10
  }
11
11
  exports.verboseLog = verboseLog;
package/build/withTV.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  declare const _default: ConfigPlugin<ConfigData>;
4
4
  export default _default;
package/build/withTV.js CHANGED
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const config_plugins_1 = require("expo/config-plugins");
4
+ const utils_1 = require("./utils");
5
+ const withTVAndroidBannerImage_1 = require("./withTVAndroidBannerImage");
6
+ const withTVAndroidIconImage_1 = require("./withTVAndroidIconImage");
4
7
  const withTVAndroidManifest_1 = require("./withTVAndroidManifest");
8
+ const withTVAndroidRemoveFlipper_1 = require("./withTVAndroidRemoveFlipper");
5
9
  const withTVAppleIconImages_1 = require("./withTVAppleIconImages");
6
10
  const withTVInfoPlist_1 = require("./withTVInfoPlist");
7
11
  const withTVPodfile_1 = require("./withTVPodfile");
8
12
  const withTVSplashScreen_1 = require("./withTVSplashScreen");
9
13
  const withTVXcodeProject_1 = require("./withTVXcodeProject");
10
- const withTVAndroidRemoveFlipper_1 = require("./withTVAndroidRemoveFlipper");
11
- const withTVAndroidBannerImage_1 = require("./withTVAndroidBannerImage");
12
- const withTVAndroidIconImage_1 = require("./withTVAndroidIconImage");
13
- const utils_1 = require("./utils");
14
14
  const withTVNoEffect = (config, params = {}) => {
15
15
  (0, utils_1.verboseLog)(`${utils_1.packageNameAndVersion}: isTV == false, TV-specific modifications will not be made.`, {});
16
16
  return config;
@@ -34,5 +34,5 @@ const withTVPlugin = (config, params = {}) => {
34
34
  config = (0, withTVAndroidManifest_1.withTVAndroidManifest)(config, params);
35
35
  return config;
36
36
  };
37
- const pkg = require('../package.json');
37
+ const pkg = require("../package.json");
38
38
  exports.default = (0, config_plugins_1.createRunOncePlugin)(withTVPlugin, pkg.name, pkg.version);
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /** Copies TV banner image to the Android resources drawable folders. If image does not exist, throw an exception. */
4
4
  export declare const withTVAndroidBannerImage: ConfigPlugin<ConfigData>;
@@ -9,18 +9,18 @@ const fs_1 = require("fs");
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const utils_1 = require("./utils");
11
11
  const drawableDirectoryNames = [
12
- 'drawable',
13
- 'drawable-hdpi',
14
- 'drawable-mdpi',
15
- 'drawable-xhdpi',
16
- 'drawable-xxhdpi',
17
- 'drawable-xxxhdpi',
12
+ "drawable",
13
+ "drawable-hdpi",
14
+ "drawable-mdpi",
15
+ "drawable-xhdpi",
16
+ "drawable-xxhdpi",
17
+ "drawable-xxxhdpi",
18
18
  ];
19
19
  /** Copies TV banner image to the Android resources drawable folders. If image does not exist, throw an exception. */
20
20
  const withTVAndroidBannerImage = (c, params = {}) => {
21
21
  const androidTVBannerPath = (0, utils_1.androidTVBanner)(params);
22
22
  return (0, config_plugins_1.withDangerousMod)(c, [
23
- 'android',
23
+ "android",
24
24
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
25
25
  async (config) => {
26
26
  if (!androidTVBannerPath) {
@@ -28,15 +28,15 @@ const withTVAndroidBannerImage = (c, params = {}) => {
28
28
  }
29
29
  (0, utils_1.verboseLog)(`adding TV banner image ${androidTVBannerPath} to Android resources`, {
30
30
  params,
31
- platform: 'android',
32
- property: 'manifest',
31
+ platform: "android",
32
+ property: "manifest",
33
33
  });
34
34
  for (const drawableDirectoryName of drawableDirectoryNames) {
35
- const drawableDirectoryPath = path_1.default.join(config.modRequest.platformProjectRoot, 'app', 'src', 'main', 'res', drawableDirectoryName);
35
+ const drawableDirectoryPath = path_1.default.join(config.modRequest.platformProjectRoot, "app", "src", "main", "res", drawableDirectoryName);
36
36
  if (!(0, fs_1.existsSync)(drawableDirectoryPath)) {
37
37
  await fs_1.promises.mkdir(drawableDirectoryPath);
38
38
  }
39
- await fs_1.promises.copyFile(androidTVBannerPath, path_1.default.join(drawableDirectoryPath, 'tv_banner.png'));
39
+ await fs_1.promises.copyFile(androidTVBannerPath, path_1.default.join(drawableDirectoryPath, "tv_banner.png"));
40
40
  }
41
41
  return config;
42
42
  },
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /** Copies TV Icon image to the Android resources drawable folders. If image does not exist, throw an exception. */
4
4
  export declare const withTVAndroidIconImage: ConfigPlugin<ConfigData>;
@@ -9,19 +9,19 @@ const fs_1 = require("fs");
9
9
  const path_1 = __importDefault(require("path"));
10
10
  const utils_1 = require("./utils");
11
11
  const drawableDirectoryNames = [
12
- 'drawable',
13
- 'mipmap',
14
- 'mipmap-hdpi',
15
- 'mipmap-mdpi',
16
- 'mipmap-xhdpi',
17
- 'mipmap-xxhdpi',
18
- 'mipmap-xxxhdpi',
12
+ "drawable",
13
+ "mipmap",
14
+ "mipmap-hdpi",
15
+ "mipmap-mdpi",
16
+ "mipmap-xhdpi",
17
+ "mipmap-xxhdpi",
18
+ "mipmap-xxxhdpi",
19
19
  ];
20
20
  /** Copies TV Icon image to the Android resources drawable folders. If image does not exist, throw an exception. */
21
21
  const withTVAndroidIconImage = (c, params = {}) => {
22
22
  const androidTVIconPath = (0, utils_1.androidTVIcon)(params);
23
23
  return (0, config_plugins_1.withDangerousMod)(c, [
24
- 'android',
24
+ "android",
25
25
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
26
26
  async (config) => {
27
27
  if (!androidTVIconPath) {
@@ -29,20 +29,20 @@ const withTVAndroidIconImage = (c, params = {}) => {
29
29
  }
30
30
  (0, utils_1.verboseLog)(`adding TV Icon image ${androidTVIconPath} to Android resources`, {
31
31
  params,
32
- platform: 'android',
33
- property: 'manifest',
32
+ platform: "android",
33
+ property: "manifest",
34
34
  });
35
35
  for (const drawableDirectoryName of drawableDirectoryNames) {
36
- const drawableDirectoryPath = path_1.default.join(config.modRequest.platformProjectRoot, 'app', 'src', 'main', 'res', drawableDirectoryName);
36
+ const drawableDirectoryPath = path_1.default.join(config.modRequest.platformProjectRoot, "app", "src", "main", "res", drawableDirectoryName);
37
37
  if (!(0, fs_1.existsSync)(drawableDirectoryPath)) {
38
38
  await fs_1.promises.mkdir(drawableDirectoryPath);
39
39
  }
40
40
  if (drawableDirectoryName === "drawable") {
41
- await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, 'tv_icon.png'));
41
+ await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, "tv_icon.png"));
42
42
  }
43
43
  else {
44
- await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, 'ic_launcher.png'));
45
- await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, 'ic_launcher_round.png'));
44
+ await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, "ic_launcher.png"));
45
+ await fs_1.promises.copyFile(androidTVIconPath, path_1.default.join(drawableDirectoryPath, "ic_launcher_round.png"));
46
46
  }
47
47
  }
48
48
  return config;
@@ -1,9 +1,9 @@
1
- import { ExpoConfig } from 'expo/config';
2
- import { AndroidConfig, ConfigPlugin } from 'expo/config-plugins';
3
- import { ConfigData } from './types';
1
+ import { ExpoConfig } from "expo/config";
2
+ import { AndroidConfig, ConfigPlugin } from "expo/config-plugins";
3
+ import { ConfigData } from "./types";
4
4
  export declare const withTVAndroidManifest: ConfigPlugin<ConfigData>;
5
- export declare function setLeanBackLauncherIntent(_config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
6
- export declare function removePortraitOrientation(_config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
7
- export declare function setTVBanner(_config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData, androidTVBannerPath: string | undefined): AndroidConfig.Manifest.AndroidManifest;
8
- export declare function setTVIcon(_config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData, androidTVIconPath: string | undefined): AndroidConfig.Manifest.AndroidManifest;
9
- export declare function addTouchscreenHardwareFeatureToManifest(_config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
5
+ export declare function setLeanBackLauncherIntent(_config: Pick<ExpoConfig, "android">, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
6
+ export declare function removePortraitOrientation(_config: Pick<ExpoConfig, "android">, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
7
+ export declare function setTVBanner(_config: Pick<ExpoConfig, "android">, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData, androidTVBannerPath: string | undefined): AndroidConfig.Manifest.AndroidManifest;
8
+ export declare function setTVIcon(_config: Pick<ExpoConfig, "android">, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData, androidTVIconPath: string | undefined): AndroidConfig.Manifest.AndroidManifest;
9
+ export declare function addTouchscreenHardwareFeatureToManifest(_config: Pick<ExpoConfig, "android">, androidManifest: AndroidConfig.Manifest.AndroidManifest, params: ConfigData): AndroidConfig.Manifest.AndroidManifest;
@@ -21,22 +21,22 @@ const withTVAndroidManifest = (config, params = {}) => {
21
21
  });
22
22
  };
23
23
  exports.withTVAndroidManifest = withTVAndroidManifest;
24
- const LEANBACK_LAUNCHER_CATEGORY = 'android.intent.category.LEANBACK_LAUNCHER';
24
+ const LEANBACK_LAUNCHER_CATEGORY = "android.intent.category.LEANBACK_LAUNCHER";
25
25
  function getMainLaunchIntent(androidManifest) {
26
26
  const mainActivity = getMainActivity(androidManifest);
27
- const intentFilters = mainActivity?.['intent-filter'];
27
+ const intentFilters = mainActivity?.["intent-filter"];
28
28
  const mainLaunchIntents = (intentFilters ?? []).filter((i) => {
29
29
  const action = i.action ?? [];
30
30
  if (action.length === 0) {
31
31
  return false;
32
32
  }
33
- return action[0]?.$['android:name'] === 'android.intent.action.MAIN';
33
+ return action[0]?.$["android:name"] === "android.intent.action.MAIN";
34
34
  });
35
35
  return mainLaunchIntents.length ? mainLaunchIntents[0] : undefined;
36
36
  }
37
37
  function leanbackLauncherCategoryExistsInMainLaunchIntent(mainLaunchIntent) {
38
38
  const mainLaunchCategories = mainLaunchIntent.category ?? [];
39
- const mainLaunchIntentCategoriesWithLeanbackLauncher = mainLaunchCategories.filter((c) => c.$['android:name'] === LEANBACK_LAUNCHER_CATEGORY);
39
+ const mainLaunchIntentCategoriesWithLeanbackLauncher = mainLaunchCategories.filter((c) => c.$["android:name"] === LEANBACK_LAUNCHER_CATEGORY);
40
40
  return mainLaunchIntentCategoriesWithLeanbackLauncher.length > 0;
41
41
  }
42
42
  function setLeanBackLauncherIntent(_config, androidManifest, params) {
@@ -46,15 +46,15 @@ function setLeanBackLauncherIntent(_config, androidManifest, params) {
46
46
  }
47
47
  if (!leanbackLauncherCategoryExistsInMainLaunchIntent(mainLaunchIntent)) {
48
48
  // Leanback needs to be added
49
- (0, utils_1.verboseLog)('adding TV leanback launcher category to main intent in AndroidManifest.xml', {
49
+ (0, utils_1.verboseLog)("adding TV leanback launcher category to main intent in AndroidManifest.xml", {
50
50
  params,
51
- platform: 'android',
52
- property: 'manifest',
51
+ platform: "android",
52
+ property: "manifest",
53
53
  });
54
54
  const mainLaunchCategories = mainLaunchIntent.category ?? [];
55
55
  mainLaunchCategories.push({
56
56
  $: {
57
- 'android:name': LEANBACK_LAUNCHER_CATEGORY,
57
+ "android:name": LEANBACK_LAUNCHER_CATEGORY,
58
58
  },
59
59
  });
60
60
  mainLaunchIntent.category = mainLaunchCategories;
@@ -66,13 +66,13 @@ function removePortraitOrientation(_config, androidManifest, params) {
66
66
  const mainActivity = getMainActivity(androidManifest);
67
67
  if (mainActivity?.$) {
68
68
  const metadata = mainActivity?.$ ?? {};
69
- if (metadata['android:screenOrientation']) {
70
- (0, utils_1.verboseLog)('removing screen orientation from AndroidManifest.xml', {
69
+ if (metadata["android:screenOrientation"]) {
70
+ (0, utils_1.verboseLog)("removing screen orientation from AndroidManifest.xml", {
71
71
  params,
72
- platform: 'android',
73
- property: 'manifest',
72
+ platform: "android",
73
+ property: "manifest",
74
74
  });
75
- delete metadata['android:screenOrientation'];
75
+ delete metadata["android:screenOrientation"];
76
76
  }
77
77
  }
78
78
  return androidManifest;
@@ -85,12 +85,12 @@ function setTVBanner(_config, androidManifest, params, androidTVBannerPath) {
85
85
  const mainApplication = getMainApplication(androidManifest);
86
86
  if (mainApplication?.$) {
87
87
  const metadata = mainApplication?.$ ?? {};
88
- (0, utils_1.verboseLog)('adding TV banner to AndroidManifest.xml', {
88
+ (0, utils_1.verboseLog)("adding TV banner to AndroidManifest.xml", {
89
89
  params,
90
- platform: 'android',
91
- property: 'manifest',
90
+ platform: "android",
91
+ property: "manifest",
92
92
  });
93
- metadata['android:banner'] = '@drawable/tv_banner';
93
+ metadata["android:banner"] = "@drawable/tv_banner";
94
94
  }
95
95
  return androidManifest;
96
96
  }
@@ -102,46 +102,46 @@ function setTVIcon(_config, androidManifest, params, androidTVIconPath) {
102
102
  const mainApplication = getMainApplication(androidManifest);
103
103
  if (mainApplication?.$) {
104
104
  const metadata = mainApplication?.$ ?? {};
105
- (0, utils_1.verboseLog)('adding TV icon to AndroidManifest.xml', {
105
+ (0, utils_1.verboseLog)("adding TV icon to AndroidManifest.xml", {
106
106
  params,
107
- platform: 'android',
108
- property: 'manifest',
107
+ platform: "android",
108
+ property: "manifest",
109
109
  });
110
- metadata['android:icon'] = '@drawable/tv_icon';
110
+ metadata["android:icon"] = "@drawable/tv_icon";
111
111
  }
112
112
  return androidManifest;
113
113
  }
114
114
  exports.setTVIcon = setTVIcon;
115
115
  function addTouchscreenHardwareFeatureToManifest(_config, androidManifest, params) {
116
116
  // Add `<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>` to the AndroidManifest.xml
117
- if (!Array.isArray(androidManifest.manifest['uses-feature'])) {
118
- androidManifest.manifest['uses-feature'] = [];
117
+ if (!Array.isArray(androidManifest.manifest["uses-feature"])) {
118
+ androidManifest.manifest["uses-feature"] = [];
119
119
  }
120
- if (!androidManifest.manifest['uses-feature'].find((item) => item.$['android:name'] === 'android.hardware.touchscreen') &&
121
- !androidManifest.manifest['uses-feature'].find((item) => item.$['android:name'] === 'android.hardware.faketouch') &&
122
- !androidManifest.manifest['uses-feature'].find((item) => item.$['android:name'] === 'android.software.leanback')) {
123
- (0, utils_1.verboseLog)('adding TV touchscreen hardware feature tag to AndroidManifest.xml', {
120
+ if (!androidManifest.manifest["uses-feature"].find((item) => item.$["android:name"] === "android.hardware.touchscreen") &&
121
+ !androidManifest.manifest["uses-feature"].find((item) => item.$["android:name"] === "android.hardware.faketouch") &&
122
+ !androidManifest.manifest["uses-feature"].find((item) => item.$["android:name"] === "android.software.leanback")) {
123
+ (0, utils_1.verboseLog)("adding TV touchscreen hardware feature tag to AndroidManifest.xml", {
124
124
  params,
125
- platform: 'android',
126
- property: 'manifest',
125
+ platform: "android",
126
+ property: "manifest",
127
127
  });
128
- androidManifest.manifest['uses-feature']?.push({
128
+ androidManifest.manifest["uses-feature"]?.push({
129
129
  $: {
130
- 'android:name': 'android.hardware.touchscreen',
131
- 'android:required': 'false',
130
+ "android:name": "android.hardware.touchscreen",
131
+ "android:required": "false",
132
132
  },
133
133
  });
134
- androidManifest.manifest['uses-feature']?.push({
134
+ androidManifest.manifest["uses-feature"]?.push({
135
135
  $: {
136
- 'android:name': 'android.hardware.faketouch',
137
- 'android:required': 'false',
136
+ "android:name": "android.hardware.faketouch",
137
+ "android:required": "false",
138
138
  },
139
139
  });
140
140
  // add android.software.leanback to false
141
- androidManifest.manifest['uses-feature']?.push({
141
+ androidManifest.manifest["uses-feature"]?.push({
142
142
  $: {
143
- 'android:name': 'android.software.leanback',
144
- 'android:required': (0, utils_1.isAndroidTVRequired)(params) ? 'true' : 'false',
143
+ "android:name": "android.software.leanback",
144
+ "android:required": (0, utils_1.isAndroidTVRequired)(params) ? "true" : "false",
145
145
  },
146
146
  });
147
147
  }
@@ -1,4 +1,4 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /** Dangerously makes or reverts TV changes in the project Podfile. */
4
4
  export declare const withTVAndroidRemoveFlipper: ConfigPlugin<ConfigData>;
@@ -6,37 +6,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.withTVAndroidRemoveFlipper = void 0;
7
7
  const config_plugins_1 = require("expo/config-plugins");
8
8
  const fs_1 = require("fs");
9
- const glob_1 = __importDefault(require("glob"));
9
+ const glob_1 = require("glob");
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const utils_1 = require("./utils");
12
12
  /** Dangerously makes or reverts TV changes in the project Podfile. */
13
13
  const withTVAndroidRemoveFlipper = (c, params = {}) => {
14
14
  const androidRemoveFlipper = (0, utils_1.shouldRemoveFlipperOnAndroid)(params);
15
15
  return (0, config_plugins_1.withDangerousMod)(c, [
16
- 'android',
16
+ "android",
17
17
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
18
18
  async (config) => {
19
19
  if (androidRemoveFlipper) {
20
20
  // Modify main application
21
21
  const mainApplicationFile = mainApplicationFilePath(config.modRequest.platformProjectRoot);
22
- (0, utils_1.verboseLog)('removing Flipper from MainApplication file', {
22
+ (0, utils_1.verboseLog)("removing Flipper from MainApplication file", {
23
23
  params,
24
- platform: 'android',
25
- property: 'manifest',
24
+ platform: "android",
25
+ property: "manifest",
26
26
  });
27
- const mainApplicationContents = await fs_1.promises.readFile(mainApplicationFile, 'utf8');
28
- const mainApplicationModifiedContents = commentOutLinesWithString(mainApplicationContents, 'Flipper');
29
- await fs_1.promises.writeFile(mainApplicationFile, mainApplicationModifiedContents, 'utf-8');
27
+ const mainApplicationContents = await fs_1.promises.readFile(mainApplicationFile, "utf8");
28
+ const mainApplicationModifiedContents = commentOutLinesWithString(mainApplicationContents, "Flipper");
29
+ await fs_1.promises.writeFile(mainApplicationFile, mainApplicationModifiedContents, "utf-8");
30
30
  // Modify app/build.gradle
31
31
  const buildGradleFile = appBuildGradleFilePath(config.modRequest.platformProjectRoot);
32
- (0, utils_1.verboseLog)('removing Flipper from android/app/build.gradle', {
32
+ (0, utils_1.verboseLog)("removing Flipper from android/app/build.gradle", {
33
33
  params,
34
- platform: 'android',
35
- property: 'manifest',
34
+ platform: "android",
35
+ property: "manifest",
36
36
  });
37
- const buildGradleContents = await fs_1.promises.readFile(buildGradleFile, 'utf-8');
38
- const buildGradleModifiedContents = commentOutLinesWithString(buildGradleContents, 'flipper');
39
- await fs_1.promises.writeFile(buildGradleFile, buildGradleModifiedContents, 'utf-8');
37
+ const buildGradleContents = await fs_1.promises.readFile(buildGradleFile, "utf-8");
38
+ const buildGradleModifiedContents = commentOutLinesWithString(buildGradleContents, "flipper");
39
+ await fs_1.promises.writeFile(buildGradleFile, buildGradleModifiedContents, "utf-8");
40
40
  }
41
41
  return config;
42
42
  },
@@ -44,23 +44,23 @@ const withTVAndroidRemoveFlipper = (c, params = {}) => {
44
44
  };
45
45
  exports.withTVAndroidRemoveFlipper = withTVAndroidRemoveFlipper;
46
46
  const mainApplicationFilePath = (androidRoot) => {
47
- const paths = glob_1.default.sync(`${androidRoot}/**/MainApplication.*`);
47
+ const paths = (0, glob_1.globSync)(`${androidRoot}/**/MainApplication.*`);
48
48
  if (paths.length > 0) {
49
49
  return paths[0];
50
50
  }
51
51
  else {
52
- throw new Error('AndroidApplication path not found');
52
+ throw new Error("AndroidApplication path not found");
53
53
  }
54
54
  };
55
- const appBuildGradleFilePath = (androidRoot) => path_1.default.resolve(androidRoot, 'app', 'build.gradle');
55
+ const appBuildGradleFilePath = (androidRoot) => path_1.default.resolve(androidRoot, "app", "build.gradle");
56
56
  const commentOutLinesWithString = (contents, searchString) => {
57
57
  return contents
58
- .split('\n')
58
+ .split("\n")
59
59
  .map((line) => {
60
60
  if (line.indexOf(searchString) !== -1) {
61
- return line.replace(/^/, '// ');
61
+ return line.replace(/^/, "// ");
62
62
  }
63
63
  return line;
64
64
  })
65
- .join('\n');
65
+ .join("\n");
66
66
  };
@@ -1,5 +1,5 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /**
4
4
  * Constructs Apple TV brand assets from images passed into the `appleTVImages` plugin property
5
5
  * If any images do not exist, an exception is thrown.
@@ -15,7 +15,7 @@ const { getProjectName } = config_plugins_1.IOSConfig.XcodeUtils;
15
15
  */
16
16
  const withTVAppleIconImages = (c, params = {}) => {
17
17
  return (0, config_plugins_1.withDangerousMod)(c, [
18
- 'ios',
18
+ "ios",
19
19
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
20
20
  async (config) => {
21
21
  if (!params.appleTVImages) {
@@ -23,8 +23,8 @@ const withTVAppleIconImages = (c, params = {}) => {
23
23
  }
24
24
  (0, utils_1.verboseLog)(`adding Apple TV brand assets to Apple TV native code`, {
25
25
  params,
26
- platform: 'ios',
27
- property: 'xcodeproject',
26
+ platform: "ios",
27
+ property: "xcodeproject",
28
28
  });
29
29
  utils_1.appleTVImageTypes.forEach((imageType) => {
30
30
  const imagePath = (0, utils_1.appleTVImagePathForType)(params, imageType);
@@ -40,17 +40,17 @@ const withTVAppleIconImages = (c, params = {}) => {
40
40
  const iconSmallSourceImages = [
41
41
  {
42
42
  path: params.appleTVImages.iconSmall,
43
- scale: '1x',
43
+ scale: "1x",
44
44
  },
45
45
  {
46
46
  path: params.appleTVImages.iconSmall2x,
47
- scale: '2x',
47
+ scale: "2x",
48
48
  },
49
49
  ];
50
50
  const iconLargeSourceImages = [
51
51
  {
52
52
  path: params.appleTVImages.icon,
53
- scale: '1x',
53
+ scale: "1x",
54
54
  },
55
55
  ];
56
56
  /*
@@ -63,39 +63,39 @@ const withTVAppleIconImages = (c, params = {}) => {
63
63
  const topShelfSourceImages = [
64
64
  {
65
65
  path: params.appleTVImages.topShelf,
66
- scale: '1x',
66
+ scale: "1x",
67
67
  },
68
68
  {
69
69
  path: params.appleTVImages.topShelf2x,
70
- scale: '2x',
70
+ scale: "2x",
71
71
  },
72
72
  ];
73
73
  const topShelfWideSourceImages = [
74
74
  {
75
75
  path: params.appleTVImages.topShelfWide,
76
- scale: '1x',
76
+ scale: "1x",
77
77
  },
78
78
  {
79
79
  path: params.appleTVImages.topShelfWide2x,
80
- scale: '2x',
80
+ scale: "2x",
81
81
  },
82
82
  ];
83
83
  const sourceBrandAssets = {
84
- name: 'TVAppIcon',
84
+ name: "TVAppIcon",
85
85
  assets: [
86
86
  {
87
- role: 'top-shelf-image',
88
- size: '1920x720',
87
+ role: "top-shelf-image",
88
+ size: "1920x720",
89
89
  imageSet: {
90
- name: 'Top Shelf Image',
90
+ name: "Top Shelf Image",
91
91
  sourceImages: topShelfSourceImages,
92
92
  },
93
93
  },
94
94
  {
95
- role: 'top-shelf-image-wide',
96
- size: '2320x720',
95
+ role: "top-shelf-image-wide",
96
+ size: "2320x720",
97
97
  imageSet: {
98
- name: 'Top Shelf Image Wide',
98
+ name: "Top Shelf Image Wide",
99
99
  sourceImages: topShelfWideSourceImages,
100
100
  },
101
101
  },
@@ -123,42 +123,42 @@ const withTVAppleIconImages = (c, params = {}) => {
123
123
  },
124
124
  */
125
125
  {
126
- role: 'primary-app-icon',
127
- size: '400x240',
126
+ role: "primary-app-icon",
127
+ size: "400x240",
128
128
  imageStack: {
129
- name: 'App Icon - Small',
129
+ name: "App Icon - Small",
130
130
  sourceLayers: [
131
131
  {
132
- name: 'Front',
132
+ name: "Front",
133
133
  sourceImages: iconSmallSourceImages,
134
134
  },
135
135
  {
136
- name: 'Middle',
136
+ name: "Middle",
137
137
  sourceImages: iconSmallSourceImages,
138
138
  },
139
139
  {
140
- name: 'Back',
140
+ name: "Back",
141
141
  sourceImages: iconSmallSourceImages,
142
142
  },
143
143
  ],
144
144
  },
145
145
  },
146
146
  {
147
- role: 'primary-app-icon',
148
- size: '1280x768',
147
+ role: "primary-app-icon",
148
+ size: "1280x768",
149
149
  imageStack: {
150
- name: 'App Icon - Large',
150
+ name: "App Icon - Large",
151
151
  sourceLayers: [
152
152
  {
153
- name: 'Front',
153
+ name: "Front",
154
154
  sourceImages: iconLargeSourceImages,
155
155
  },
156
156
  {
157
- name: 'Middle',
157
+ name: "Middle",
158
158
  sourceImages: iconLargeSourceImages,
159
159
  },
160
160
  {
161
- name: 'Back',
161
+ name: "Back",
162
162
  sourceImages: iconLargeSourceImages,
163
163
  },
164
164
  ],
@@ -174,6 +174,6 @@ const withTVAppleIconImages = (c, params = {}) => {
174
174
  exports.withTVAppleIconImages = withTVAppleIconImages;
175
175
  function getIosNamedProjectPath(projectRoot) {
176
176
  const projectName = getProjectName(projectRoot);
177
- return path_1.default.join(projectRoot, 'ios', projectName);
177
+ return path_1.default.join(projectRoot, "ios", projectName);
178
178
  }
179
- const IMAGES_PATH = 'Images.xcassets';
179
+ const IMAGES_PATH = "Images.xcassets";
@@ -1,3 +1,3 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  export declare const withTVInfoPlist: ConfigPlugin<ConfigData>;
@@ -4,13 +4,13 @@ exports.withTVInfoPlist = void 0;
4
4
  const config_plugins_1 = require("expo/config-plugins");
5
5
  const utils_1 = require("./utils");
6
6
  const withTVInfoPlist = (c, params = {}) => {
7
- (0, utils_1.verboseLog)('Modifying UIRequiredDeviceCapabilities for TV', {
7
+ (0, utils_1.verboseLog)("Modifying UIRequiredDeviceCapabilities for TV", {
8
8
  params,
9
- platform: 'ios',
10
- property: 'Info.plist',
9
+ platform: "ios",
10
+ property: "Info.plist",
11
11
  });
12
12
  return (0, config_plugins_1.withInfoPlist)(c, (config) => {
13
- config.modResults.UIRequiredDeviceCapabilities = ['arm64'];
13
+ config.modResults.UIRequiredDeviceCapabilities = ["arm64"];
14
14
  return config;
15
15
  });
16
16
  };
@@ -1,5 +1,5 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /** Dangerously makes or reverts TV changes in the project Podfile. */
4
4
  export declare const withTVPodfile: ConfigPlugin<ConfigData>;
5
5
  export declare function addTVPodfileModifications(src: string): string;
@@ -12,26 +12,26 @@ const utils_1 = require("./utils");
12
12
  /** Dangerously makes or reverts TV changes in the project Podfile. */
13
13
  const withTVPodfile = (c, params = {}) => {
14
14
  return (0, config_plugins_1.withDangerousMod)(c, [
15
- 'ios',
15
+ "ios",
16
16
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
17
17
  async (config) => {
18
- const file = path_1.default.join(config.modRequest.platformProjectRoot, 'Podfile');
19
- const contents = await fs_1.promises.readFile(file, 'utf8');
18
+ const file = path_1.default.join(config.modRequest.platformProjectRoot, "Podfile");
19
+ const contents = await fs_1.promises.readFile(file, "utf8");
20
20
  const modifiedContents = addTVPodfileModifications(contents);
21
- (0, utils_1.verboseLog)('modifying Podfile for tvOS', {
21
+ (0, utils_1.verboseLog)("modifying Podfile for tvOS", {
22
22
  params,
23
- platform: 'ios',
24
- property: 'podfile',
23
+ platform: "ios",
24
+ property: "podfile",
25
25
  });
26
- await fs_1.promises.writeFile(file, modifiedContents, 'utf-8');
26
+ await fs_1.promises.writeFile(file, modifiedContents, "utf-8");
27
27
  return config;
28
28
  },
29
29
  ]);
30
30
  };
31
31
  exports.withTVPodfile = withTVPodfile;
32
- const MOD_TAG = 'react-native-tvos-import';
32
+ const MOD_TAG = "react-native-tvos-import";
33
33
  function addTVPodfileModifications(src) {
34
- if (src.indexOf('platform :tvos') !== -1) {
34
+ if (src.indexOf("platform :tvos") !== -1) {
35
35
  return src;
36
36
  }
37
37
  const newSrc = (0, generateCode_1.mergeContents)({
@@ -40,8 +40,8 @@ function addTVPodfileModifications(src) {
40
40
  newSrc: "source 'https://github.com/react-native-tvos/react-native-tvos-podspecs.git'\nsource 'https://cdn.cocoapods.org/'\n",
41
41
  anchor: /^/,
42
42
  offset: 0,
43
- comment: '#',
43
+ comment: "#",
44
44
  }).contents;
45
- return newSrc.replace('platform :ios', 'platform :tvos');
45
+ return newSrc.replace("platform :ios", "platform :tvos");
46
46
  }
47
47
  exports.addTVPodfileModifications = addTVPodfileModifications;
@@ -1,5 +1,5 @@
1
- import { ConfigPlugin } from 'expo/config-plugins';
2
- import { ConfigData } from './types';
1
+ import { ConfigPlugin } from "expo/config-plugins";
2
+ import { ConfigData } from "./types";
3
3
  /** Dangerously makes changes needed for TV in SplashScreen.storyboard. */
4
4
  export declare const withTVSplashScreen: ConfigPlugin<ConfigData>;
5
5
  export declare function addTVSplashScreenModifications(src: string): string;
@@ -11,34 +11,34 @@ const utils_1 = require("./utils");
11
11
  /** Dangerously makes changes needed for TV in SplashScreen.storyboard. */
12
12
  const withTVSplashScreen = (config, params = {}) => {
13
13
  return (0, config_plugins_1.withDangerousMod)(config, [
14
- 'ios',
14
+ "ios",
15
15
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
16
16
  async (config) => {
17
17
  if (!config.modRequest.projectName) {
18
18
  throw new Error(`The ${utils_1.packageNameAndVersion} plugin requires a configured project name.`);
19
19
  }
20
- const file = path_1.default.join(config.modRequest.platformProjectRoot, config.modRequest.projectName, 'SplashScreen.storyboard');
21
- const contents = await fs_1.promises.readFile(file, 'utf8');
20
+ const file = path_1.default.join(config.modRequest.platformProjectRoot, config.modRequest.projectName, "SplashScreen.storyboard");
21
+ const contents = await fs_1.promises.readFile(file, "utf8");
22
22
  const modifiedContents = addTVSplashScreenModifications(contents);
23
- (0, utils_1.verboseLog)('modifying SplashScreen.storyboard for tvOS', {
23
+ (0, utils_1.verboseLog)("modifying SplashScreen.storyboard for tvOS", {
24
24
  params,
25
- platform: 'ios',
26
- property: 'splashscreen',
25
+ platform: "ios",
26
+ property: "splashscreen",
27
27
  });
28
- await fs_1.promises.writeFile(file, modifiedContents, 'utf-8');
28
+ await fs_1.promises.writeFile(file, modifiedContents, "utf-8");
29
29
  return config;
30
30
  },
31
31
  ]);
32
32
  };
33
33
  exports.withTVSplashScreen = withTVSplashScreen;
34
34
  const splashScreenStringsForPhone = [
35
- 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB',
35
+ "com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB",
36
36
  'targetRuntime="iOS.CocoaTouch"',
37
37
  'id="retina5_5"',
38
38
  '<deployment identifier="iOS"/>',
39
39
  ];
40
40
  const splashScreenStringsForTV = [
41
- 'com.apple.InterfaceBuilder.AppleTV.Storyboard',
41
+ "com.apple.InterfaceBuilder.AppleTV.Storyboard",
42
42
  'targetRuntime="AppleTV"',
43
43
  'id="appleTV"',
44
44
  '<deployment identifier="tvOS"/>',
@@ -46,7 +46,7 @@ const splashScreenStringsForTV = [
46
46
  function modifySource(src, originalStrings, replacementStrings) {
47
47
  let modifiedSource = src;
48
48
  originalStrings.forEach((s, i) => {
49
- const original = new RegExp(`${s}`, 'g');
49
+ const original = new RegExp(`${s}`, "g");
50
50
  const replacement = replacementStrings[i];
51
51
  modifiedSource = modifiedSource.replace(original, replacement);
52
52
  });
@@ -1,8 +1,8 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- import { ConfigPlugin, XcodeProject } from 'expo/config-plugins';
3
- import { ConfigData } from './types';
1
+ import { ExpoConfig } from "@expo/config-types";
2
+ import { ConfigPlugin, XcodeProject } from "expo/config-plugins";
3
+ import { ConfigData } from "./types";
4
4
  export declare const withTVXcodeProject: ConfigPlugin<ConfigData>;
5
- export declare function setXcodeProjectBuildSettings(config: Pick<ExpoConfig, 'ios'>, { project, params, deploymentTarget, }: {
5
+ export declare function setXcodeProjectBuildSettings(config: Pick<ExpoConfig, "ios">, { project, params, deploymentTarget, }: {
6
6
  project: XcodeProject;
7
7
  params: ConfigData;
8
8
  deploymentTarget: string;
@@ -22,23 +22,23 @@ function setXcodeProjectBuildSettings(config, { project, params, deploymentTarge
22
22
  // Guessing that this is the best way to emulate Xcode.
23
23
  // Using `project.addToBuildSettings` modifies too many targets.
24
24
  if (buildSettings !== undefined) {
25
- buildSettings.SDKROOT = 'appletvos';
25
+ buildSettings.SDKROOT = "appletvos";
26
26
  }
27
- if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {
27
+ if (typeof buildSettings?.PRODUCT_NAME !== "undefined") {
28
28
  (0, utils_1.verboseLog)(`modifying target ${buildSettings?.PRODUCT_NAME} for tvOS`, {
29
29
  params,
30
- platform: 'ios',
31
- property: 'xcodeproject',
30
+ platform: "ios",
31
+ property: "xcodeproject",
32
32
  });
33
- buildSettings.TARGETED_DEVICE_FAMILY = '3';
33
+ buildSettings.TARGETED_DEVICE_FAMILY = "3";
34
34
  buildSettings.TVOS_DEPLOYMENT_TARGET = deploymentTarget;
35
- if (typeof buildSettings?.IOS_DEPLOYMENT_TARGET !== 'undefined') {
35
+ if (typeof buildSettings?.IOS_DEPLOYMENT_TARGET !== "undefined") {
36
36
  delete buildSettings?.IOS_DEPLOYMENT_TARGET;
37
37
  }
38
38
  if (params.appleTVImages) {
39
39
  // set the app icon source
40
- if (buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME === 'AppIcon') {
41
- buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME = 'TVAppIcon';
40
+ if (buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME === "AppIcon") {
41
+ buildSettings.ASSETCATALOG_COMPILER_APPICON_NAME = "TVAppIcon";
42
42
  }
43
43
  }
44
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-tvos/config-tv",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Config plugin to reconfigure native directories for Apple TV and Android TV development if needed",
5
5
  "main": "build/withTV.js",
6
6
  "types": "build/withTV.d.ts",
@@ -39,6 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@types/getenv": "^1.0.1",
41
41
  "expo-module-scripts": "^3.0.3",
42
+ "glob": "^11.0.0",
42
43
  "jest": "^29.7.0",
43
44
  "memfs": "^4.7.6"
44
45
  },