зеркало из https://github.com/microsoft/rnx-kit.git
756ddeba67
Releases: @rnx-kit/third-party-notices@2.0.0 @rnx-kit/cli@0.18.0 @rnx-kit/metro-plugin-cyclic-dependencies-detector@2.0.0 @rnx-kit/react-native-error-trace-decorator@2.0.0 @rnx-kit/esbuild-plugin-import-path-remapper@3.0.0 @rnx-kit/babel-plugin-import-path-remapper@2.0.0 @rnx-kit/babel-preset-metro-react-native@2.0.0 @rnx-kit/metro-plugin-duplicates-checker@3.0.0 @rnx-kit/react-native-test-app-msal@4.0.0 @rnx-kit/react-native-lazy-index@4.0.0 @rnx-kit/tools-react-native@2.0.0 @rnx-kit/typescript-service@2.0.0 @rnx-kit/commitlint-lite@2.0.0 @rnx-kit/metro-serializer@2.0.0 @rnx-kit/tools-language@3.0.0 @rnx-kit/metro-service@4.0.0 @rnx-kit/metro-config@2.0.0 @rnx-kit/bundle-diff@2.0.0 @rnx-kit/align-deps@3.0.0 @rnx-kit/tools-node@3.0.0 @rnx-kit/tsconfig@2.0.0 @rnx-kit/console@2.0.0 @react-native-webapis/battery-status@0.2.0 @react-native-webapis/web-storage@0.3.0 @rnx-kit/esbuild-bundle-analyzer@0.3.0 @rnx-kit/metro-serializer-esbuild@0.2.0 @rnx-kit/rn-changelog-generator@0.5.0 @rnx-kit/metro-plugin-typescript@0.5.0 @rnx-kit/metro-resolver-symlinks@0.2.0 @rnx-kit/react-native-auth@0.3.0 @rnx-kit/react-native-host@0.5.0 @rnx-kit/patcher-rnmacos@0.2.0 @rnx-kit/tools-filesystem@0.1.0 @rnx-kit/tools-workspaces@0.2.0 @rnx-kit/eslint-plugin@0.8.0 @rnx-kit/tools-android@0.2.0 @rnx-kit/tools-windows@0.2.0 @rnx-kit/jest-preset@0.2.0 @rnx-kit/tools-apple@0.2.0 @rnx-kit/tools-shell@0.2.0 @rnx-kit/polyfills@0.2.0 @rnx-kit/config@0.7.0 @rnx-kit/build@0.7.1 @rnx-kit/eslint-config@0.0.4 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
src | ||
test | ||
CHANGELOG.md | ||
README.md | ||
cache.d.ts | ||
cache.js | ||
context.d.ts | ||
context.js | ||
eslint.config.js | ||
metro.d.ts | ||
metro.js | ||
package.json | ||
platform.d.ts | ||
platform.js | ||
tsconfig.json |
README.md
@rnx-kit/tools-react-native
@rnx-kit/tools-react-native
is a collection of supplemental react-native
functions and types.
You can import the entire package, or, to save space, import individual categories:
import * as tools from "@rnx-kit/tools-react-native";
// Alternatively...
import * as metroTools from "@rnx-kit/tools-react-native/metro";
import * as platformTools from "@rnx-kit/tools-react-native/platform";
Category | Type Name | Description |
---|---|---|
platform | AllPlatforms | List of supported react-native platforms. |
Category | Function | Description |
---|---|---|
context | loadContext(root) |
Equivalent to calling loadConfig() from @react-native-community/cli , but the result is cached for faster subsequent accesses. |
context | resolveCommunityCLI(root, reactNativePath) |
Finds path to @react-native-community/cli . |
metro | findMetroPath(projectRoot) |
Finds the installation path of Metro. |
metro | getMetroVersion(projectRoot) |
Returns Metro version number. |
metro | requireModuleFromMetro(moduleName, fromDir) |
Imports specified module starting from the installation directory of the currently used metro version. |
platform | expandPlatformExtensions(platform, extensions) |
Returns a list of extensions that should be tried for the target platform in prioritized order. |
platform | getAvailablePlatforms(startDir) |
Returns a map of available React Native platforms. The result is cached. |
platform | getAvailablePlatformsUncached(startDir, platformMap) |
Returns a map of available React Native platforms. The result is NOT cached. |
platform | parsePlatform(val) |
Parse a string to ensure it maps to a valid react-native platform. |
platform | platformExtensions(platform) |
Returns file extensions that can be mapped to the target platform. |