Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_dot.js

Issue 2624873002: DevTools: visualize deps (Closed)
Patch Set: clean Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 "use strict";
6
7 const fs = require('fs');
8 const path = require('path');
9
10 const utils = require('../utils');
11
12 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end');
13 const OUT = path.resolve(__dirname, 'out', 'dependencies.dot');
14
15 function main() {
16 const modules = new Set();
17 const moduleToDependencyList = ['digraph dependencies {'];
18 fs.readdirSync(FRONTEND_PATH).forEach(function(file) {
19 const moduleJSONPath = path.join(FRONTEND_PATH, file, 'module.json');
20 if (fs.statSync(path.join(FRONTEND_PATH, file)).isDirectory() &&
21 utils.isFile(moduleJSONPath)) {
22 const module = file;
23 modules.add(module);
24 const moduleJSON = require(moduleJSONPath);
25 if (moduleJSON.dependencies) {
26 for (let d of moduleJSON.dependencies) {
27 moduleToDependencyList.push(` ${module} -> ${d}`);
28 }
29 }
30 }
31 });
32 moduleToDependencyList.push('}');
33 const content = moduleToDependencyList.join('\n');
34 fs.writeFileSync(OUT, content);
35 }
36
37 if (require.main === module)
38 main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698