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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_js.js
diff --git a/third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_js.js b/third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_js.js
new file mode 100644
index 0000000000000000000000000000000000000000..cdf80f5c610016aa62a0f771d3453057f66302e5
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/scripts/visualize_deps/generate_js.js
@@ -0,0 +1,33 @@
+"use strict";
+
+const fs = require('fs');
+const path = require('path');
+
+const utils = require('../utils');
+
+const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end');
+const OUT = path.resolve(__dirname, 'out', 'modules.js');
+
+function main() {
+ const modules = new Set();
+ const moduleToDependencyList = [];
+ fs.readdirSync(FRONTEND_PATH).forEach(function(file) {
+ const moduleJSONPath = path.join(FRONTEND_PATH, file, 'module.json');
+ if (fs.statSync(path.join(FRONTEND_PATH, file)).isDirectory() &&
+ utils.isFile(moduleJSONPath)) {
+ const module = file;
+ modules.add(module);
+ const moduleJSON = require(moduleJSONPath);
+ if (moduleJSON.dependencies) {
+ for (let d of moduleJSON.dependencies) {
+ moduleToDependencyList.push([module, d]);
+ }
+ }
+ }
+ });
+ const nodes = Array.from(modules);
+ fs.writeFileSync(OUT, `var modules = ${JSON.stringify(moduleToDependencyList)}; var nodes = ${JSON.stringify(nodes)};`);
+}
+
+if (require.main === module)
+ main();
« 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