Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract CLI out #22174

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 0 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
; We fork some components by platform
.*/*[.]android.js

; Ignore templates for 'react-native init'
.*/local-cli/templates/.*

; Ignore the Dangerfile
<PROJECT_ROOT>/bots/dangerfile.js

Expand Down
2 changes: 1 addition & 1 deletion Libraries/Image/AssetSourceResolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {PackagerAsset} from 'AssetRegistry';
const PixelRatio = require('PixelRatio');
const Platform = require('Platform');

const assetPathUtils = require('../../local-cli/bundle/assetPathUtils');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assetPathUtils are not limited to images. They also impact all other types of assets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but my understanding is that the "impact" is more present in the local-cli context where the utils are used to generate a path to any type of asset.

On the React Native side of things, this file is only used in Image module. Anyway, this shouldn't be an issue now that the local-cli folder will not be removed. I am going to revert this change and w can leave this to be refactored at some point.

const assetPathUtils = require('./assetPathUtils');
const invariant = require('fbjs/lib/invariant');

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import type {PackagerAsset} from '../../Libraries/Image/AssetRegistry';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if moving this utility and making it specific to Image makes sense. This is for all assets. Maybe this should be a separate util.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not an issue that we leave local-cli. However, this is only used in Image module on the React Native side.

import type {PackagerAsset} from './AssetRegistry';

/**
* FIXME: using number to represent discrete scale numbers is fragile in essence because of
Expand Down
2 changes: 1 addition & 1 deletion jest/hasteImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'use strict';

const path = require('path');
const findPlugins = require('../local-cli/core/findPlugins');
const findPlugins = require('react-native-local-cli/core/findPlugins');

const REACT_NATIVE_CI = process.cwd() === path.resolve(__dirname, '..');

Expand Down
1 change: 0 additions & 1 deletion jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const generate = require('@babel/generator').default;

const nodeFiles = new RegExp(
[
'/local-cli/',
'/metro(?:-[^/]*)?/', // metro, metro-core, metro-source-map, metro-etc
].join('|'),
);
Expand Down
2 changes: 0 additions & 2 deletions local-cli/.npmignore

This file was deleted.

15 changes: 0 additions & 15 deletions local-cli/__mocks__/beeper.js

This file was deleted.

61 changes: 0 additions & 61 deletions local-cli/__mocks__/fs.js

This file was deleted.

22 changes: 0 additions & 22 deletions local-cli/__mocks__/path.js

This file was deleted.

16 changes: 0 additions & 16 deletions local-cli/bundle/__mocks__/sign.js

This file was deleted.

42 changes: 0 additions & 42 deletions local-cli/bundle/__tests__/filterPlatformAssetScales-test.js

This file was deleted.

75 changes: 0 additions & 75 deletions local-cli/bundle/__tests__/getAssetDestPathAndroid-test.js

This file was deleted.

45 changes: 0 additions & 45 deletions local-cli/bundle/__tests__/getAssetDestPathIOS-test.js

This file was deleted.

Loading