Socket
Socket
Sign inDemoInstall

@expo/configure-splash-screen

Package Overview
Dependencies
Maintainers
24
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/configure-splash-screen - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

build/android/Paths.d.ts

23

build/android/MainActivity.js

@@ -6,8 +6,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
const cli_platform_android_1 = require("@react-native-community/cli-platform-android");
const fs_extra_1 = __importDefault(require("fs-extra"));
const path_1 = __importDefault(require("path"));
const constants_1 = require("../constants");
const StateManager_1 = __importDefault(require("../utils/StateManager"));
const string_utils_1 = require("../utils/string-utils");
const Paths_1 = require("./Paths");
/**

@@ -17,20 +16,14 @@ * Injects specific code to MainActivity that would trigger SplashScreen mounting process.

async function configureMainActivity(projectRootPath, config = {}) {
var _a, _b, _c, _d;
var _a, _b, _c;
const resizeMode = (_a = config.imageResizeMode) !== null && _a !== void 0 ? _a : constants_1.SplashScreenImageResizeMode.CONTAIN;
const statusBarTranslucent = (_c = (_b = config.statusBar) === null || _b === void 0 ? void 0 : _b.translucent) !== null && _c !== void 0 ? _c : false;
// eslint-disable-next-line
const mainApplicationPath = (_d = cli_platform_android_1.projectConfig(projectRootPath)) === null || _d === void 0 ? void 0 : _d.mainFilePath;
if (!mainApplicationPath) {
const mainActivity = await Paths_1.getMainActivityAsync(projectRootPath);
if (!mainActivity) {
throw new Error(`Failed to configure 'MainActivity'.`);
}
const mainActivityPathJava = path_1.default.resolve(mainApplicationPath, '../MainActivity.java');
const mainActivityPathKotlin = path_1.default.resolve(mainApplicationPath, '../MainActivity.kt');
const isJava = await fs_extra_1.default.pathExists(mainActivityPathJava);
const isKotlin = !isJava && (await fs_extra_1.default.pathExists(mainActivityPathKotlin));
if (!isJava && !isKotlin) {
throw new Error(`Failed to find 'MainActivity' file.`);
}
const isJava = mainActivity.language === 'java';
const isKotlin = mainActivity.language === 'kt';
const LE = isJava ? ';' : '';
const fileContent = await fs_extra_1.default.readFile(isJava ? mainActivityPathJava : mainActivityPathKotlin, 'utf-8');
const { state: newFileContent } = new StateManager_1.default(fileContent)
const { state: newFileContent } = new StateManager_1.default(mainActivity.contents)
// importing ReactRootView

@@ -143,5 +136,5 @@ .applyAction(content => {

});
await fs_extra_1.default.writeFile(isJava ? mainActivityPathJava : mainActivityPathKotlin, newFileContent);
await fs_extra_1.default.writeFile(mainActivity.path, newFileContent);
}
exports.default = configureMainActivity;
//# sourceMappingURL=MainActivity.js.map
{
"name": "@expo/configure-splash-screen",
"version": "0.3.2",
"version": "0.3.3",
"description": "Supplementary module for 'expo-splash-screen' providing cli configuration command",

@@ -41,3 +41,2 @@ "bin": {

"dependencies": {
"@react-native-community/cli-platform-android": "^4.10.0",
"@react-native-community/cli-platform-ios": "^4.10.0",

@@ -44,0 +43,0 @@ "color-string": "^1.5.3",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc