Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@expo/config-types
Advanced tools
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 1,457,812 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.