Files
Alex Hunt 41d52189e2 Create @react-native/asset-utils package (#57368)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57368

**Context**

This stack intends to relocate the `AssetRegistry` API from `react-native/assets-registry` into `react-native` — addressing runtime safety and public deep imports issues (1.0 and JS Stable API blockers).

**This diff**

Create a new `react-native/asset-utils` package, intended for internal/framework use (read: **will not be an end user concern**). This re-houses `react-native/assets-registry/path-support.js`.

Stacked with the next two diffs, this contributes to the 0.87 objective to delete `react-native/assets-registry` towards install-layout-safe behaviour and JS deep import removal.

- (Temporarily, this leaves two copies of `path-support.js` until I enact the package removal down the stack.)

This change also enables us to de-duplicate `assetPathUtils.js` inside `community-cli-plugin` and use one source of truth.

- Additionally, we have fbsource consumers of this util that cannot have a circular Buck dep on `react-native`, so the main package was not a suitable relocation point (secondarily to not adding an awkward new public API here).

**Changes**
- Add `react-native/asset-utils` (`packages/asset-utils/`): `src/AssetPathUtils.js` containing Android path helpers and tests.
- De-duplicate usages in `community-cli-plugin`: delete `src/commands/bundle/assetPathUtils.js`.

Changelog:
[General][Added] - Introduce `react-native/asset-utils` package (relocates Android path utils for libraries/frameworks)

Reviewed By: robhogan

Differential Revision: D110045272

fbshipit-source-id: 781e75c58ae9ce7f0fa860e66beca3b9990d26ea
2026-07-06 10:32:14 -07:00

32 lines
778 B
JSON

{
"name": "@react-native/asset-utils",
"version": "0.87.0-main",
"description": "Asset path utilities for React Native.",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/react/react-native.git",
"directory": "packages/asset-utils"
},
"homepage": "https://github.com/react/react-native/tree/HEAD/packages/asset-utils#readme",
"keywords": [
"react-native"
],
"bugs": "https://github.com/react/react-native/issues",
"engines": {
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
},
"exports": {
".": "./src/index.js",
"./package.json": "./package.json"
},
"files": [
"src",
"README.md",
"!**/__docs__/**",
"!**/__fixtures__/**",
"!**/__mocks__/**",
"!**/__tests__/**"
]
}