mirror of
https://github.com/status-im/metro.git
synced 2025-01-21 16:39:43 +00:00
Fix debug namespaces
Summary: @public Have a top-level debug namespace: `ReactNativePackager` And add a couple of debugs in the transformer. This is ground work for adding a verbose option. Reviewed By: @DmitrySoshnikov Differential Revision: D2489960
This commit is contained in:
parent
40cecf94b3
commit
d9c7205e17
@ -11,7 +11,7 @@
|
|||||||
const Activity = require('../../Activity');
|
const Activity = require('../../Activity');
|
||||||
const AssetModule_DEPRECATED = require('../AssetModule_DEPRECATED');
|
const AssetModule_DEPRECATED = require('../AssetModule_DEPRECATED');
|
||||||
const Fastfs = require('../fastfs');
|
const Fastfs = require('../fastfs');
|
||||||
const debug = require('debug')('ReactPackager:DependencyGraph');
|
const debug = require('debug')('ReactNativePackager:DependencyGraph');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
class DeprecatedAssetMap {
|
class DeprecatedAssetMap {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const debug = require('debug')('ReactPackager:DependencyGraph');
|
const debug = require('debug')('ReactNativePackager:DependencyGraph');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const isAbsolutePath = require('absolute-path');
|
const isAbsolutePath = require('absolute-path');
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const Promise = require('promise');
|
const Promise = require('promise');
|
||||||
const debug = require('debug')('DependencyGraph');
|
const debug = require('debug')('ReactNativePackager:DependencyGraph');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
5
react-packager/src/JSTransformer/index.js
vendored
5
react-packager/src/JSTransformer/index.js
vendored
@ -14,6 +14,7 @@ const declareOpts = require('../lib/declareOpts');
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const util = require('util');
|
const util = require('util');
|
||||||
const workerFarm = require('worker-farm');
|
const workerFarm = require('worker-farm');
|
||||||
|
const debug = require('debug')('ReactNativePackager:JStransformer');
|
||||||
|
|
||||||
const readFile = Promise.denodeify(fs.readFile);
|
const readFile = Promise.denodeify(fs.readFile);
|
||||||
|
|
||||||
@ -86,6 +87,8 @@ class Transformer {
|
|||||||
return Promise.reject(new Error('No transfrom module'));
|
return Promise.reject(new Error('No transfrom module'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug('transforming file', filePath);
|
||||||
|
|
||||||
return this._cache.get(
|
return this._cache.get(
|
||||||
filePath,
|
filePath,
|
||||||
'transformedSource',
|
'transformedSource',
|
||||||
@ -107,6 +110,8 @@ class Transformer {
|
|||||||
throw formatError(res.error, filePath);
|
throw formatError(res.error, filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debug('done transforming file', filePath);
|
||||||
|
|
||||||
return new ModuleTransport({
|
return new ModuleTransport({
|
||||||
code: res.code,
|
code: res.code,
|
||||||
map: res.map,
|
map: res.map,
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
const Bundle = require('../Bundler/Bundle');
|
const Bundle = require('../Bundler/Bundle');
|
||||||
const Promise = require('promise');
|
const Promise = require('promise');
|
||||||
const bser = require('bser');
|
const bser = require('bser');
|
||||||
const debug = require('debug')('ReactPackager:SocketClient');
|
const debug = require('debug')('ReactNativePackager:SocketClient');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
const Promise = require('promise');
|
const Promise = require('promise');
|
||||||
const Server = require('../Server');
|
const Server = require('../Server');
|
||||||
const bser = require('bser');
|
const bser = require('bser');
|
||||||
const debug = require('debug')('ReactPackager:SocketServer');
|
const debug = require('debug')('ReactNativePackager:SocketServer');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
|
|
||||||
|
4
react-packager/src/SocketInterface/index.js
vendored
4
react-packager/src/SocketInterface/index.js
vendored
@ -13,7 +13,7 @@ const SocketClient = require('./SocketClient');
|
|||||||
const SocketServer = require('./SocketServer');
|
const SocketServer = require('./SocketServer');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const crypto = require('crypto');
|
const crypto = require('crypto');
|
||||||
const debug = require('debug')('ReactPackager:SocketInterface');
|
const debug = require('debug')('ReactNativePackager:SocketInterface');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
@ -90,7 +90,7 @@ function createServer(resolve, reject, options, sockPath) {
|
|||||||
|
|
||||||
// Enable server debugging by default since it's going to a log file.
|
// Enable server debugging by default since it's going to a log file.
|
||||||
const env = _.clone(process.env);
|
const env = _.clone(process.env);
|
||||||
env.DEBUG = 'ReactPackager:SocketServer';
|
env.DEBUG = 'ReactNativePackager:SocketServer';
|
||||||
|
|
||||||
// We have to go through the main entry point to make sure
|
// We have to go through the main entry point to make sure
|
||||||
// we go through the babel require hook.
|
// we go through the babel require hook.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user