diff --git a/Libraries/Image/AssetRegistry.js b/Libraries/Image/AssetRegistry.js index 78613fbe5be08f..961faf495632af 100644 --- a/Libraries/Image/AssetRegistry.js +++ b/Libraries/Image/AssetRegistry.js @@ -10,4 +10,4 @@ 'use strict'; -module.exports = require('@react-native/assets/registry'); +module.exports = require('../../packages/assets/registry'); diff --git a/Libraries/Image/AssetSourceResolver.js b/Libraries/Image/AssetSourceResolver.js index 5e7f2c2b738ef4..58928c2e9aae4a 100644 --- a/Libraries/Image/AssetSourceResolver.js +++ b/Libraries/Image/AssetSourceResolver.js @@ -18,16 +18,16 @@ export type ResolvedAssetSource = {| +scale: number, |}; -import type {PackagerAsset} from '@react-native/assets/registry'; +import type {PackagerAsset} from '../../packages/assets/registry'; -const PixelRatio = require('../Utilities/PixelRatio'); -const Platform = require('../Utilities/Platform'); -const {pickScale} = require('./AssetUtils'); const { getAndroidResourceFolderName, getAndroidResourceIdentifier, getBasePath, -} = require('@react-native/assets/path-support'); +} = require('../../packages/assets/path-support'); +const PixelRatio = require('../Utilities/PixelRatio'); +const Platform = require('../Utilities/Platform'); +const {pickScale} = require('./AssetUtils'); const invariant = require('invariant'); /** diff --git a/Libraries/Image/RelativeImageStub.js b/Libraries/Image/RelativeImageStub.js index c8cf0f4da4418c..f45b2aad52f935 100644 --- a/Libraries/Image/RelativeImageStub.js +++ b/Libraries/Image/RelativeImageStub.js @@ -13,7 +13,7 @@ // This is a stub for flow to make it understand require('./icon.png') // See metro/src/Bundler/index.js -const AssetRegistry = require('@react-native/assets/registry'); +const AssetRegistry = require('../../packages/assets/registry'); module.exports = (AssetRegistry.registerAsset({ __packager_asset: true, diff --git a/Libraries/Image/__tests__/resolveAssetSource-test.js b/Libraries/Image/__tests__/resolveAssetSource-test.js index 475e623741991f..7e4a0cd1a13979 100644 --- a/Libraries/Image/__tests__/resolveAssetSource-test.js +++ b/Libraries/Image/__tests__/resolveAssetSource-test.js @@ -19,7 +19,7 @@ describe('resolveAssetSource', () => { beforeEach(() => { jest.resetModules(); - AssetRegistry = require('@react-native/assets/registry'); + AssetRegistry = require('../../../packages/assets/registry'); resolveAssetSource = require('../resolveAssetSource'); NativeSourceCode = require('../../NativeModules/specs/NativeSourceCode').default; diff --git a/Libraries/Image/resolveAssetSource.js b/Libraries/Image/resolveAssetSource.js index 8848a0f18c10e4..cb06cf673f99d8 100644 --- a/Libraries/Image/resolveAssetSource.js +++ b/Libraries/Image/resolveAssetSource.js @@ -14,9 +14,9 @@ import type {ResolvedAssetSource} from './AssetSourceResolver'; +const AssetRegistry = require('../../packages/assets/registry'); const AssetSourceResolver = require('./AssetSourceResolver'); const {pickScale} = require('./AssetUtils'); -const AssetRegistry = require('@react-native/assets/registry'); let _customSourceTransformer, _serverURL, _scriptURL; diff --git a/package.json b/package.json index 249563734ea6a7..dbdd553c5e7745 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "Libraries", "LICENSE", "local-cli", + "packages/assets", "packages/polyfills", "packages/normalize-color", "React-Core.podspec", @@ -114,7 +115,6 @@ "@react-native-community/cli": "10.0.0-alpha.5", "@react-native-community/cli-platform-android": "10.0.0-alpha.4", "@react-native-community/cli-platform-ios": "10.0.0-alpha.3", - "@react-native/assets": "1.0.0", "abort-controller": "^3.0.0", "anser": "^1.4.9", "base64-js": "^1.1.2", diff --git a/packages/assets/package.json b/packages/assets/package.json index 885e7175338867..ea0d35fe221fdb 100644 --- a/packages/assets/package.json +++ b/packages/assets/package.json @@ -1,6 +1,6 @@ { - "name": "@react-native/assets", - "version": "1.0.0", + "name": "@react-native/assets-registry", + "version": "0.72.0", "description": "Asset support code for React Native.", "repository": { "type": "git",