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

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_js.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
« no previous file with comments | « third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_dot.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 "use strict";
2
3 const fs = require('fs');
4 const path = require('path');
5
6 const utils = require('../utils');
7
8 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end');
9 const OUT = path.resolve(__dirname, 'out', 'modules.js');
10
11 function main() {
12 const modules = new Set();
13 const moduleToDependencyList = [];
14 fs.readdirSync(FRONTEND_PATH).forEach(function(file) {
15 const moduleJSONPath = path.join(FRONTEND_PATH, file, 'module.json');
16 if (fs.statSync(path.join(FRONTEND_PATH, file)).isDirectory() &&
17 utils.isFile(moduleJSONPath)) {
18 const module = file;
19 modules.add(module);
20 const moduleJSON = require(moduleJSONPath);
21 if (moduleJSON.dependencies) {
22 for (let d of moduleJSON.dependencies) {
23 moduleToDependencyList.push([module, d]);
24 }
25 }
26 }
27 });
28 const nodes = Array.from(modules);
29 fs.writeFileSync(OUT, `var modules = ${JSON.stringify(moduleToDependencyList)} ; var nodes = ${JSON.stringify(nodes)};`);
30 }
31
32 if (require.main === module)
33 main();
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_dot.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698