Skip to content

Commit

Permalink
refactor(react-native/assets): rename @react-native/assets to @react-…
Browse files Browse the repository at this point in the history
…native/assets-registry

Summary:
Changelog:
[General][Changed] - renamed react-native/assets to react-native/assets-registry as a part of [migration to monorepo structure](facebook#34692)

Differential Revision: D41342783

fbshipit-source-id: 47c88c7c32bbe6d8e1dfc5f37ecb2209ecd48020
  • Loading branch information
hoxy authored and facebook-github-bot committed Nov 17, 2022
1 parent a4872b3 commit 3762772
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Libraries/Image/AssetRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

'use strict';

module.exports = require('@react-native/assets/registry');
module.exports = require('../../packages/assets/registry');
10 changes: 5 additions & 5 deletions Libraries/Image/AssetSourceResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

/**
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/RelativeImageStub.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/__tests__/resolveAssetSource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/resolveAssetSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"Libraries",
"LICENSE",
"local-cli",
"packages/assets",
"packages/polyfills",
"packages/normalize-color",
"React-Core.podspec",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/assets/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 3762772

Please sign in to comment.