New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

forcereact

Package Overview
Dependencies
Maintainers
0
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forcereact - npm Package Compare versions

Comparing version 12.1.1 to 12.2.0

2

package.json
{
"name": "forcereact",
"version": "12.1.1",
"version": "12.2.0",
"description": "Utilities for creating react native mobile apps based on the Salesforce Mobile SDK for iOS and Android",

@@ -5,0 +5,0 @@ "keywords": [ "mobilesdk", "ios", "android", "react", "salesforce", "mobile", "sdk" ],

@@ -31,3 +31,3 @@ /*

var VERSION= '12.1.1';
var VERSION= '12.2.0';

@@ -272,3 +272,13 @@ module.exports = {

hidden: true
}
},
sdkDependencies: {
name: 'sdkdependencies',
description: 'override sdk dependencies',
'char': 'd',
error: cli => val => 'Invalid value for sdk dependencies: \'' + val + '\'.',
validate: cli => val => /.*/.test(val),
required: false,
type: 'string',
hidden: true
},
},

@@ -287,3 +297,4 @@

'verbose',
cli.name === 'forcehybrid' ? 'pluginRepoUri' : null
cli.name === 'forcehybrid' ? 'pluginRepoUri' : null,
'sdkDependencies'
].filter(x=>x!=null),

@@ -304,3 +315,4 @@ description: cli => 'create ' + cli.purpose,

'verbose',
cli.name === 'forcehybrid' ? 'pluginRepoUri' : null
cli.name === 'forcehybrid' ? 'pluginRepoUri' : null,
'sdkDependencies'
].filter(x=>x!=null),

@@ -307,0 +319,0 @@ description: cli => 'create ' + cli.purpose + ' from a template',

@@ -112,14 +112,2 @@ /*

if (config.platform.split(',').indexOf('ios') != -1) {
fixPods(config, path.join('platforms', 'ios'));
// Remove libCordova.a from build
utils.logInfo('Updating xcode project file');
var xcodeProjectFile = path.join(config.projectDir,'platforms', 'ios', config.appname + '.xcodeproj', 'project.pbxproj')
var xcodeProjectFileContent = fs.readFileSync(xcodeProjectFile, 'utf8');
var newXcodeProjectFileContent = xcodeProjectFileContent.split('\n').filter(line => line.indexOf('libCordova.a in Frameworks') == -1).join('\n');
fs.writeFileSync(xcodeProjectFile, newXcodeProjectFileContent);
utils.logInfo('Updated xcode project file');
}
// Done

@@ -130,36 +118,2 @@ return prepareResult;

//
// Patch pod file for hybrid apps on xcode 14
//
function fixPods(config, iosSubDir) {
var iosDir = path.join(config.projectDir, iosSubDir)
var podfilePath = path.join(iosDir, 'Podfile');
var originalPodfileContent = fs.readFileSync(podfilePath, 'utf8');
var preInstallCode = "\n" +
"$dynamic_framework = ['SalesforceAnalytics', 'SalesforceSDKCore', 'SalesforceSDKCommon', 'SmartStore', 'FMDB', 'SQLCipher', 'MobileSync']\n" +
"pre_install do |installer|\n" +
" installer.pod_targets.each do |pod|\n" +
" if $dynamic_framework.include?(pod.name)\n" +
" def pod.build_type\n" +
" Pod::BuildType.dynamic_framework\n" +
" end\n" +
" end\n" +
" end\n" +
"end" +
"\n" +
"post_install do |installer|\n" +
" installer.pods_project.targets.each do |target|\n" +
" if target.deployment_target.to_i < 9\n" +
" target.build_configurations.each do |config|\n" +
" config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'\n" +
" end\n" +
" end\n" +
" end\n" +
"end"
utils.logInfo('Updating Podfile for project ' + config.appname);
fs.writeFileSync(podfilePath, originalPodfileContent.replace("use_frameworks!","") + preInstallCode);
utils.runProcessThrowError('pod update', iosDir);
}
//
// Print details

@@ -184,2 +138,6 @@ //

if (config.sdkdependencies) {
details = details.concat([' sdk dependencies: ' + config.sdkdependencies]);
}
// Hybrid extra details

@@ -305,2 +263,39 @@ if (config.apptype.indexOf('hybrid') >= 0) {

//
// Override sdk dependencies in package.json
//
function overrideSdkDependencies(packageJsonPath, sdkDependenciesString) {
try {
console.log("packageJsonPath =>" + packageJsonPath);
// Parse sdkDependencies
let sdkDependencies = JSON.parse(sdkDependenciesString)
// Read the package.json file
let originalContent = fs.readFileSync(packageJsonPath, 'utf8');
console.log("original content =>" + originalContent);
let packageJson = JSON.parse(originalContent)
// Ensure "sdkDependencies" exists in the package.json
if (!packageJson.sdkDependencies) {
packageJson.sdkDependencies = {};
}
// Merge the sdkDependencies argument into the packageJson.sdkDependencies
packageJson.sdkDependencies = {
...packageJson.sdkDependencies,
...sdkDependencies
};
// Write the updated package.json back to file
let updatedContent = JSON.stringify(packageJson, null, 2);
console.log("updated content =>" + updatedContent);
fs.writeFileSync(packageJsonPath, updatedContent, 'utf8');
} catch (err) {
console.error(`Failed to override sdk dependencies in package.json: ${err}`);
}
}
//
// Actually create app

@@ -360,2 +355,7 @@ //

// Override sdk dependencies in package.json if any were provided
if (config.sdkdependencies) {
overrideSdkDependencies(path.join(config.templateLocalPath, 'package.json'), config.sdkdependencies);
}
// Getting apptype from template

@@ -362,0 +362,0 @@ config.apptype = require(path.join(config.templateLocalPath, 'template.js')).appType;

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