@react-native-tvos/config-tv 0.0.13 → 0.1.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/README.md CHANGED
@@ -36,7 +36,7 @@ or
36
36
  {
37
37
  "isTV": true,
38
38
  "showVerboseWarnings": false,
39
- "tvosDeploymentTarget": "13.4",
39
+ "tvosDeploymentTarget": "15.1",
40
40
  "removeFlipperOnAndroid": true,
41
41
  "androidTVBanner": "assets/images/tv_banner.png",
42
42
  "androidTVIcon": "assets/images/tv_icon.png",
@@ -65,7 +65,7 @@ _Plugin parameters_:
65
65
  - `EXPO_DEBUG=1` (shows debug messages from all plugins)
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
- - `tvosDeploymentTarget`: (optional string, default '13.4') Used to set the tvOS deployment target version in the Xcode project.
68
+ - `tvosDeploymentTarget`: (optional string, default '15.1') Used to set the tvOS deployment target version in the Xcode project.
69
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.
package/build/types.d.ts CHANGED
@@ -46,7 +46,7 @@ export type ConfigData = {
46
46
  */
47
47
  showVerboseWarnings?: boolean;
48
48
  /**
49
- * If set, this will be used as the tvOS deployment target version instead of the default (13.4).
49
+ * If set, this will be used as the tvOS deployment target version instead of the default (15.1).
50
50
  */
51
51
  tvosDeploymentTarget?: string;
52
52
  /**
@@ -3,7 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createBrandAssetsAsync = exports.createImageStackAsync = exports.createImageStackLayerAsync = exports.createImageSetAsync = exports.writeContentsJsonAsync = void 0;
6
+ exports.writeContentsJsonAsync = writeContentsJsonAsync;
7
+ exports.createImageSetAsync = createImageSetAsync;
8
+ exports.createImageStackLayerAsync = createImageStackLayerAsync;
9
+ exports.createImageStackAsync = createImageStackAsync;
10
+ exports.createBrandAssetsAsync = createBrandAssetsAsync;
7
11
  const fs_1 = require("fs");
8
12
  const path_1 = __importDefault(require("path"));
9
13
  /**
@@ -25,7 +29,6 @@ async function writeContentsJsonAsync(directory, options) {
25
29
  },
26
30
  }, null, 2));
27
31
  }
28
- exports.writeContentsJsonAsync = writeContentsJsonAsync;
29
32
  /**
30
33
  * Creates an image set directory with its Contents.json and any images
31
34
  */
@@ -42,7 +45,6 @@ async function createImageSetAsync(destinationPath, imageSet) {
42
45
  await fs_1.promises.copyFile(image.path, path_1.default.join(imageSetPath, path_1.default.basename(image.path)));
43
46
  }
44
47
  }
45
- exports.createImageSetAsync = createImageSetAsync;
46
48
  /**
47
49
  * Creates an image stack layer directory with its Contents.json and any images
48
50
  */
@@ -54,7 +56,6 @@ async function createImageStackLayerAsync(destinationPath, layer) {
54
56
  sourceImages: layer.sourceImages,
55
57
  });
56
58
  }
57
- exports.createImageStackLayerAsync = createImageStackLayerAsync;
58
59
  /**
59
60
  * Creates an image stack directory with its Contents.json and any layers
60
61
  */
@@ -72,7 +73,6 @@ async function createImageStackAsync(destinationPath, stack) {
72
73
  });
73
74
  }
74
75
  }
75
- exports.createImageStackAsync = createImageStackAsync;
76
76
  /**
77
77
  * Creates a brand assets directory with its Contents.json and any assets
78
78
  */
@@ -110,4 +110,3 @@ async function createBrandAssetsAsync(destinationPath, brandAssets) {
110
110
  }
111
111
  }
112
112
  }
113
- exports.createBrandAssetsAsync = createBrandAssetsAsync;
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appleTVImagePathForType = exports.appleTVImageTypes = exports.androidTVIcon = exports.androidTVBanner = exports.isAndroidTVRequired = exports.shouldRemoveFlipperOnAndroid = exports.tvosDeploymentTarget = exports.isTVEnabled = exports.packageNameAndVersion = void 0;
3
+ exports.appleTVImageTypes = exports.packageNameAndVersion = void 0;
4
+ exports.isTVEnabled = isTVEnabled;
5
+ exports.tvosDeploymentTarget = tvosDeploymentTarget;
6
+ exports.shouldRemoveFlipperOnAndroid = shouldRemoveFlipperOnAndroid;
7
+ exports.isAndroidTVRequired = isAndroidTVRequired;
8
+ exports.androidTVBanner = androidTVBanner;
9
+ exports.androidTVIcon = androidTVIcon;
10
+ exports.appleTVImagePathForType = appleTVImagePathForType;
4
11
  const getenv_1 = require("getenv");
5
12
  class Env {
6
13
  /** Enable prebuild for TV */
@@ -10,32 +17,26 @@ class Env {
10
17
  }
11
18
  const env = new Env();
12
19
  const pkg = require("../../package.json");
13
- const defaultTvosDeploymentVersion = "13.4";
20
+ const defaultTvosDeploymentVersion = "15.1";
14
21
  exports.packageNameAndVersion = `${pkg.name}@${pkg.version}`;
15
22
  function isTVEnabled(params) {
16
23
  return env.EXPO_TV || (params?.isTV ?? false);
17
24
  }
18
- exports.isTVEnabled = isTVEnabled;
19
25
  function tvosDeploymentTarget(params) {
20
26
  return params?.tvosDeploymentTarget ?? defaultTvosDeploymentVersion;
21
27
  }
22
- exports.tvosDeploymentTarget = tvosDeploymentTarget;
23
28
  function shouldRemoveFlipperOnAndroid(params) {
24
29
  return params?.removeFlipperOnAndroid ?? false;
25
30
  }
26
- exports.shouldRemoveFlipperOnAndroid = shouldRemoveFlipperOnAndroid;
27
31
  function isAndroidTVRequired(params) {
28
32
  return params?.androidTVRequired ?? false;
29
33
  }
30
- exports.isAndroidTVRequired = isAndroidTVRequired;
31
34
  function androidTVBanner(params) {
32
35
  return params?.androidTVBanner;
33
36
  }
34
- exports.androidTVBanner = androidTVBanner;
35
37
  function androidTVIcon(params) {
36
38
  return params?.androidTVIcon;
37
39
  }
38
- exports.androidTVIcon = androidTVIcon;
39
40
  exports.appleTVImageTypes = [
40
41
  "icon",
41
42
  "iconSmall",
@@ -65,4 +66,3 @@ function appleTVImagePathForType(params, imageType) {
65
66
  return undefined;
66
67
  }
67
68
  }
68
- exports.appleTVImagePathForType = appleTVImagePathForType;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verboseLog = void 0;
3
+ exports.verboseLog = verboseLog;
4
4
  const debug = require("debug")("expo:react-native-tvos:config-tv");
5
5
  function verboseLog(message, options) {
6
6
  const tokens = [message];
@@ -8,4 +8,3 @@ function verboseLog(message, options) {
8
8
  options?.platform && tokens.unshift(options?.platform);
9
9
  debug(tokens.join(": "));
10
10
  }
11
- exports.verboseLog = verboseLog;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addTouchscreenHardwareFeatureToManifest = exports.setTVIcon = exports.setTVBanner = exports.removePortraitOrientation = exports.setLeanBackLauncherIntent = exports.withTVAndroidManifest = void 0;
3
+ exports.withTVAndroidManifest = void 0;
4
+ exports.setLeanBackLauncherIntent = setLeanBackLauncherIntent;
5
+ exports.removePortraitOrientation = removePortraitOrientation;
6
+ exports.setTVBanner = setTVBanner;
7
+ exports.setTVIcon = setTVIcon;
8
+ exports.addTouchscreenHardwareFeatureToManifest = addTouchscreenHardwareFeatureToManifest;
4
9
  const config_plugins_1 = require("expo/config-plugins");
5
10
  const utils_1 = require("./utils");
6
11
  const { getMainActivity, getMainApplication } = config_plugins_1.AndroidConfig.Manifest;
@@ -61,7 +66,6 @@ function setLeanBackLauncherIntent(_config, androidManifest, params) {
61
66
  }
62
67
  return androidManifest;
63
68
  }
64
- exports.setLeanBackLauncherIntent = setLeanBackLauncherIntent;
65
69
  function removePortraitOrientation(_config, androidManifest, params) {
66
70
  const mainActivity = getMainActivity(androidManifest);
67
71
  if (mainActivity?.$) {
@@ -77,7 +81,6 @@ function removePortraitOrientation(_config, androidManifest, params) {
77
81
  }
78
82
  return androidManifest;
79
83
  }
80
- exports.removePortraitOrientation = removePortraitOrientation;
81
84
  function setTVBanner(_config, androidManifest, params, androidTVBannerPath) {
82
85
  if (!androidTVBannerPath) {
83
86
  return androidManifest;
@@ -94,7 +97,6 @@ function setTVBanner(_config, androidManifest, params, androidTVBannerPath) {
94
97
  }
95
98
  return androidManifest;
96
99
  }
97
- exports.setTVBanner = setTVBanner;
98
100
  function setTVIcon(_config, androidManifest, params, androidTVIconPath) {
99
101
  if (!androidTVIconPath) {
100
102
  return androidManifest;
@@ -111,7 +113,6 @@ function setTVIcon(_config, androidManifest, params, androidTVIconPath) {
111
113
  }
112
114
  return androidManifest;
113
115
  }
114
- exports.setTVIcon = setTVIcon;
115
116
  function addTouchscreenHardwareFeatureToManifest(_config, androidManifest, params) {
116
117
  // Add `<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>` to the AndroidManifest.xml
117
118
  if (!Array.isArray(androidManifest.manifest["uses-feature"])) {
@@ -147,4 +148,3 @@ function addTouchscreenHardwareFeatureToManifest(_config, androidManifest, param
147
148
  }
148
149
  return androidManifest;
149
150
  }
150
- exports.addTouchscreenHardwareFeatureToManifest = addTouchscreenHardwareFeatureToManifest;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.addTVPodfileModifications = exports.withTVPodfile = void 0;
6
+ exports.withTVPodfile = void 0;
7
+ exports.addTVPodfileModifications = addTVPodfileModifications;
7
8
  const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
8
9
  const config_plugins_1 = require("expo/config-plugins");
9
10
  const fs_1 = require("fs");
@@ -44,4 +45,3 @@ function addTVPodfileModifications(src) {
44
45
  }).contents;
45
46
  return newSrc.replace("platform :ios", "platform :tvos");
46
47
  }
47
- exports.addTVPodfileModifications = addTVPodfileModifications;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.addTVSplashScreenModifications = exports.withTVSplashScreen = void 0;
6
+ exports.withTVSplashScreen = void 0;
7
+ exports.addTVSplashScreenModifications = addTVSplashScreenModifications;
7
8
  const config_plugins_1 = require("expo/config-plugins");
8
9
  const fs_1 = require("fs");
9
10
  const path_1 = __importDefault(require("path"));
@@ -55,4 +56,3 @@ function modifySource(src, originalStrings, replacementStrings) {
55
56
  function addTVSplashScreenModifications(src) {
56
57
  return modifySource(src, splashScreenStringsForPhone, splashScreenStringsForTV);
57
58
  }
58
- exports.addTVSplashScreenModifications = addTVSplashScreenModifications;
@@ -1,8 +1,7 @@
1
- import { ExpoConfig } from "@expo/config-types";
2
- import { ConfigPlugin, XcodeProject } from "expo/config-plugins";
1
+ import { ConfigPlugin, ExportedConfigWithProps, XcodeProject } from "expo/config-plugins";
3
2
  import { ConfigData } from "./types";
4
3
  export declare const withTVXcodeProject: ConfigPlugin<ConfigData>;
5
- export declare function setXcodeProjectBuildSettings(config: Pick<ExpoConfig, "ios">, { project, params, deploymentTarget, }: {
4
+ export declare function setXcodeProjectBuildSettings(_: ExportedConfigWithProps<XcodeProject>, { project, params, deploymentTarget, }: {
6
5
  project: XcodeProject;
7
6
  params: ConfigData;
8
7
  deploymentTarget: string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setXcodeProjectBuildSettings = exports.withTVXcodeProject = void 0;
3
+ exports.withTVXcodeProject = void 0;
4
+ exports.setXcodeProjectBuildSettings = setXcodeProjectBuildSettings;
4
5
  const config_plugins_1 = require("expo/config-plugins");
5
6
  const utils_1 = require("./utils");
6
7
  const withTVXcodeProject = (config, params) => {
@@ -15,7 +16,7 @@ const withTVXcodeProject = (config, params) => {
15
16
  });
16
17
  };
17
18
  exports.withTVXcodeProject = withTVXcodeProject;
18
- function setXcodeProjectBuildSettings(config, { project, params, deploymentTarget, }) {
19
+ function setXcodeProjectBuildSettings(_, { project, params, deploymentTarget, }) {
19
20
  const configurations = project.pbxXCBuildConfigurationSection();
20
21
  // @ts-ignore
21
22
  for (const { buildSettings } of Object.values(configurations || {})) {
@@ -45,4 +46,3 @@ function setXcodeProjectBuildSettings(config, { project, params, deploymentTarge
45
46
  }
46
47
  return project;
47
48
  }
48
- exports.setXcodeProjectBuildSettings = setXcodeProjectBuildSettings;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-tvos/config-tv",
3
- "version": "0.0.13",
3
+ "version": "0.1.0",
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",
@@ -34,7 +34,7 @@
34
34
  "react-native-tvos"
35
35
  ],
36
36
  "peerDependencies": {
37
- "expo": "^51"
37
+ "expo": "^52"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/getenv": "^1.0.1",