mirror of https://github.com/status-im/metro.git
Move `getPlatformExtension` and `getAssetDataFromName` into `DependencyResolver`
Reviewed By: martinbigio Differential Revision: D2619690 fb-gh-sync-id: 04ca68a1fa2dc7b77a49c38ea1515d7afbdee603
This commit is contained in:
parent
0d1a442cff
commit
57fed218a8
|
@ -1,8 +1,8 @@
|
|||
'use strict';
|
||||
|
||||
jest
|
||||
.dontMock('../../lib/getPlatformExtension')
|
||||
.dontMock('../../lib/getAssetDataFromName')
|
||||
.dontMock('../../DependencyResolver/lib/getPlatformExtension')
|
||||
.dontMock('../../DependencyResolver/lib/getAssetDataFromName')
|
||||
.dontMock('../');
|
||||
|
||||
jest
|
||||
|
|
|
@ -13,7 +13,7 @@ const Promise = require('promise');
|
|||
const crypto = require('crypto');
|
||||
const declareOpts = require('../lib/declareOpts');
|
||||
const fs = require('fs');
|
||||
const getAssetDataFromName = require('../lib/getAssetDataFromName');
|
||||
const getAssetDataFromName = require('../DependencyResolver/lib/getAssetDataFromName');
|
||||
const path = require('path');
|
||||
|
||||
const stat = Promise.denodeify(fs.stat);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const Module = require('./Module');
|
||||
const Promise = require('promise');
|
||||
const getAssetDataFromName = require('../lib/getAssetDataFromName');
|
||||
const getAssetDataFromName = require('./lib/getAssetDataFromName');
|
||||
|
||||
class AssetModule extends Module {
|
||||
constructor(...args) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const Module = require('./Module');
|
||||
const Promise = require('promise');
|
||||
const getAssetDataFromName = require('../lib/getAssetDataFromName');
|
||||
const getAssetDataFromName = require('./lib/getAssetDataFromName');
|
||||
|
||||
class AssetModule_DEPRECATED extends Module {
|
||||
constructor(...args) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const getPlatformExtension = require('../../lib/getPlatformExtension');
|
||||
const getPlatformExtension = require('../lib/getPlatformExtension');
|
||||
const Promise = require('promise');
|
||||
|
||||
const GENERIC_PLATFORM = 'generic';
|
||||
|
|
|
@ -12,7 +12,7 @@ const debug = require('debug')('ReactNativePackager:DependencyGraph');
|
|||
const util = require('util');
|
||||
const path = require('path');
|
||||
const isAbsolutePath = require('absolute-path');
|
||||
const getAssetDataFromName = require('../../lib/getAssetDataFromName');
|
||||
const getAssetDataFromName = require('../lib/getAssetDataFromName');
|
||||
const Promise = require('promise');
|
||||
|
||||
class ResolutionRequest {
|
||||
|
|
|
@ -13,7 +13,7 @@ const ModuleCache = require('../ModuleCache');
|
|||
const Promise = require('promise');
|
||||
const crawl = require('../crawlers');
|
||||
const declareOpts = require('../../lib/declareOpts');
|
||||
const getPontentialPlatformExt = require('../../lib/getPlatformExtension');
|
||||
const getPlatformExtension = require('../lib/getPlatformExtension');
|
||||
const isAbsolutePath = require('absolute-path');
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
|
@ -173,7 +173,7 @@ class DependencyGraph {
|
|||
|
||||
_getRequestPlatform(entryPath, platform) {
|
||||
if (platform == null) {
|
||||
platform = getPontentialPlatformExt(entryPath);
|
||||
platform = getPlatformExtension(entryPath);
|
||||
if (platform == null || this._opts.platforms.indexOf(platform) === -1) {
|
||||
platform = null;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
const Activity = require('../Activity');
|
||||
const AssetServer = require('../AssetServer');
|
||||
const FileWatcher = require('../FileWatcher');
|
||||
const getPlatformExtension = require('../lib/getPlatformExtension');
|
||||
const getPlatformExtension = require('../DependencyResolver/lib/getPlatformExtension');
|
||||
const Bundler = require('../Bundler');
|
||||
const Promise = require('promise');
|
||||
|
||||
|
|
Loading…
Reference in New Issue