Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@expo/config-types
Advanced tools
Types for the Expo config object app.config.ts
The @expo/config-types package provides TypeScript definitions for Expo config (`app.json` / `app.config.js`). It allows developers to have type checking and auto-completion when working with Expo configuration files, ensuring that the configuration adheres to the expected structure and types defined by Expo.
Type checking for app.json
This code sample demonstrates how to define an Expo app configuration with type checking. It ensures that the configuration object adheres to the structure and types expected by Expo, providing auto-completion and preventing common mistakes.
import { ExpoConfig } from '@expo/config-types';
const config: ExpoConfig = {
name: 'My Expo App',
slug: 'my-expo-app',
version: '1.0.0',
orientation: 'portrait',
icon: './path/to/icon.png',
splash: {
image: './path/to/splash.png',
resizeMode: 'contain',
backgroundColor: '#ffffff'
},
updates: {
fallbackToCacheTimeout: 0
},
assetBundlePatterns: ['**/*'],
ios: {
supportsTablet: true
},
android: {
adaptiveIcon: {
foregroundImage: './path/to/foreground.png',
backgroundColor: '#FFFFFF'
}
}
};
While not directly related to Expo configuration, @types/react-native provides TypeScript definitions for React Native components and APIs. It serves a similar purpose in the context of React Native development by offering type checking and auto-completion, enhancing developer experience and code reliability.
typescript-json-schema is a tool that generates JSON schemas from TypeScript types. It can be used to validate JSON data structures against TypeScript interfaces. In comparison, @expo/config-types specifically provides TypeScript definitions for Expo configuration, whereas typescript-json-schema is a more general tool for generating JSON schemas from any TypeScript types.
@expo/config-types
Types for the Expo config object app.config.ts
.
import { ExpoConfig } from '@expo/config-types';
export default (): ExpoConfig => {
return {
name: 'My App',
slug: 'my-app',
};
};
This package is 100% generated using the versioned JSON schemas from the Expo server.
yarn generate
- uses the major version from the package.json
.yarn generate --path ../../../universe/server/www/xdl-schemas/UNVERSIONED-schema.json
- uses the latest version from your local directory.yarn generate 39
- uses the given version.yarn generate unversioned
- uses the latest version.FAQs
Types for the Expo config object app.config.ts
The npm package @expo/config-types receives a total of 965,418 weekly downloads. As such, @expo/config-types popularity was classified as popular.
We found that @expo/config-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 27 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.