Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
expo-native-lockfiles
Advanced tools
Achieve more reproducible builds by committing your native project lockfiles to source control.
Achieve more reproducible builds by committing your native project lockfiles to source control.
This library is both a config plugin and a CLI tool for managing native mobile project lockfiles. By default, Expo's Continuous Native Generation ("CNG") pattern generates an iOS project with a Cocoapods lockfile, and an Android project with no Gradle lockfile, based on javascript dependencies locked with yarn.lock or similar. This module ensures more stable inputs to your native builds by allowing you to:
Not convinced? Read more about why this exists below.
yarn add -D expo-native-lockfiles
expo-native-lockfiles
as a plugin to your app.json or app.config.js (see example)expo-native-lockfiles CLI
Usage: yarn native-lock [subcommand]
Subcommands:
check: Check if lockfiles after prebuild are the same as those in the root of the repo.
write: Write the lockfiles generated after prebuild to the root of the repo.
help: Print this help message.
Options:
--android: Generate or check a lockfile for Android (opt-in).
--non-interactive: Skip interactive prompts (assumes 'yes').
--debug: Print debug information.
Choose one of the following approaches to keep your native lockfiles up to date and committed to your repository.
A CI-based check that runs whenever your yarn.lock changes might be the least intrusive way to ensure your native lockfiles stay in sync with any JS-based dependency changes.
The easiest approach to setup, but least efficient is to add yarn native-lock write
to your postinstall
script in your package.json.
You may notice the occasional drift in native dependencies with Expo's Managed Workflow (also known as Continuous Native Generation, "CNG") given that only the javascript dependency tree has dependency versions locked. This leaves the door open for the following scenario:
~> 1.0
which means 1.1 would be an acceptable versionexpo prebuild
and your project is generated, along with its native lockfile, based on the native dependency constraints dictated by your javascript dependency
1.0
for that native dependency in your ios/Podfile.lock
but now it would be 1.1
, meaning that while your JS dependency hasn't changed, it's underlying native dependency hasThe above may be desirable if you're OK with the risk that the underlying dependency does not use semantic versioning correctly and maintains backwards compatibility. Even if the version bump is not a breaking change it may have undesirable or unexpected runtime characteristics. This risk increases if the maintainer of the JS dependency is not also the maintainer of the native dependency it uses.
It can also be good to have visibility into the state of native dependencies for security scanning or supply chain management (SAST scans). With the recommended approach of ignoring the native project folders under CNG, you have no visibility into what dependencies your yarn lockfile-defined dependencies are pulling in.
React Native dependencies on Android aren't really dependencies but instead are "sub projects" that are included into the main "app" project. This structure is termed a Composite Build. Gradle's locking mechanism does not support composite builds out of the box. More work on this to follow.
Things to iron out:
FAQs
Achieve more reproducible builds by committing your native project lockfiles to source control.
The npm package expo-native-lockfiles receives a total of 3 weekly downloads. As such, expo-native-lockfiles popularity was classified as not popular.
We found that expo-native-lockfiles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.