mirror of https://github.com/status-im/metro.git
[Logs] Name fs step
Summary: There are two fs steps and it wasn't clear why. This now puts the right label: ``` [9:38:25 PM] <START> Building in-memory fs for JavaScript [9:38:27 PM] <END> Building in-memory fs for JavaScript (2030ms) [9:38:27 PM] <START> Building in-memory fs for Assets [9:38:27 PM] <END> Building in-memory fs for Assets (615ms) ```
This commit is contained in:
parent
37774b463d
commit
c675840fd9
|
@ -89,10 +89,15 @@ class DependencyGraph {
|
|||
});
|
||||
this._crawling.then((files) => Activity.endEvent(crawlActivity));
|
||||
|
||||
this._fastfs = new Fastfs(this._opts.roots, this._opts.fileWatcher, {
|
||||
ignore: this._opts.ignoreFilePath,
|
||||
crawling: this._crawling,
|
||||
});
|
||||
this._fastfs = new Fastfs(
|
||||
'JavaScript',
|
||||
this._opts.roots,
|
||||
this._opts.fileWatcher,
|
||||
{
|
||||
ignore: this._opts.ignoreFilePath,
|
||||
crawling: this._crawling,
|
||||
}
|
||||
);
|
||||
|
||||
this._fastfs.on('change', this._processFileChange.bind(this));
|
||||
|
||||
|
@ -544,6 +549,7 @@ class DependencyGraph {
|
|||
this._assetMap_DEPRECATED = Object.create(null);
|
||||
|
||||
const fastfs = new Fastfs(
|
||||
'Assets',
|
||||
this._opts.assetRoots_DEPRECATED,
|
||||
this._opts.fileWatcher,
|
||||
{ ignore: this._opts.ignoreFilePath, crawling: this._crawling }
|
||||
|
|
|
@ -40,6 +40,7 @@ describe('Module', () => {
|
|||
describe('Async Dependencies', () => {
|
||||
function expectAsyncDependenciesToEqual(expected) {
|
||||
var fastfs = new Fastfs(
|
||||
'test',
|
||||
['/root'],
|
||||
fileWatcher,
|
||||
{crawling: Promise.resolve(['/root/index.js']), ignore: []},
|
||||
|
|
|
@ -14,8 +14,9 @@ const stat = Promise.denodeify(fs.stat);
|
|||
const hasOwn = Object.prototype.hasOwnProperty;
|
||||
|
||||
class Fastfs extends EventEmitter {
|
||||
constructor(roots, fileWatcher, {ignore, crawling}) {
|
||||
constructor(name, roots, fileWatcher, {ignore, crawling}) {
|
||||
super();
|
||||
this._name = name;
|
||||
this._fileWatcher = fileWatcher;
|
||||
this._ignore = ignore;
|
||||
this._roots = roots.map(root => new File(root, { isDir: true }));
|
||||
|
@ -29,7 +30,7 @@ class Fastfs extends EventEmitter {
|
|||
);
|
||||
|
||||
return this._crawling.then(files => {
|
||||
const fastfsActivity = Activity.startEvent('Building in-memory fs');
|
||||
const fastfsActivity = Activity.startEvent('Building in-memory fs for ' + this._name);
|
||||
files.forEach(filePath => {
|
||||
if (filePath.match(rootsPattern)) {
|
||||
const newFile = new File(filePath, { isDir: false });
|
||||
|
|
Loading…
Reference in New Issue