OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 'use strict'; | 4 'use strict'; |
5 const fs = require('fs'); | 5 const fs = require('fs'); |
6 const path = require('path'); | 6 const path = require('path'); |
7 | 7 |
8 const utils = require('../utils'); | 8 const utils = require('../utils'); |
9 | 9 |
10 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end'); | 10 const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end'); |
11 const BUILD_GN_PATH = path.resolve(__dirname, '..', '..', 'BUILD.gn'); | 11 const BUILD_GN_PATH = path.resolve(__dirname, '..', '..', 'BUILD.gn'); |
12 const SPECIAL_CASE_NAMESPACES_PATH = path.resolve(__dirname, '..', 'special_case
_namespaces.json'); | 12 const SPECIAL_CASE_NAMESPACES_PATH = path.resolve(__dirname, '..', 'special_case
_namespaces.json'); |
13 | 13 |
14 const APPLICATION_DESCRIPTORS = [ | 14 const APPLICATION_DESCRIPTORS = [ |
15 'inspector.json', | 15 'inspector.json', |
16 'toolbox.json', | 16 'toolbox.json', |
17 'unit_test_runner.json', | 17 'unit_test_runner.json', |
18 'formatter_worker.json', | 18 'formatter_worker.json', |
19 'heap_snapshot_worker.json', | 19 'heap_snapshot_worker.json', |
20 'utility_shared_worker.json', | 20 'utility_shared_worker.json', |
21 ]; | 21 ]; |
22 | 22 |
23 // Replace based on specified transformation | 23 // Replace based on specified transformation |
24 const MODULES_TO_REMOVE = []; | 24 const MODULES_TO_REMOVE = []; |
25 | 25 |
26 const JS_FILES_MAPPING = [ | 26 const JS_FILES_MAPPING = [ |
27 {file: 'components/CustomPreviewComponent.js', new: 'object_ui'}, | 27 {file: 'sdk/ConsoleModel.js', new: 'console_model'}, |
28 {file: 'components/ObjectPopoverHelper.js', new: 'object_ui'}, | |
29 {file: 'components/ObjectPropertiesSection.js', new: 'object_ui'}, | |
30 {file: 'components/JavaScriptAutocomplete.js', new: 'object_ui'}, | |
31 {file: 'components/RemoteObjectPreviewFormatter.js', new: 'object_ui'}, | |
32 ]; | 28 ]; |
33 | 29 |
34 const MODULE_MAPPING = { | 30 const MODULE_MAPPING = { |
35 object_ui: { | 31 console_model: { |
36 dependencies: ['ui', 'sdk', 'components'], | 32 dependencies: ['sdk'], |
37 dependents: ['console', 'sources', 'extensions', 'event_listeners', 'resourc
es', 'profiler', 'network'], | 33 dependents: ['bindings', 'console', 'main'], |
38 applications: ['inspector.json'], | 34 applications: ['inspector.json'], |
39 autostart: true, // set to autostart because of extensions | 35 autostart: true, // set to autostart because of extensions |
40 }, | 36 }, |
41 }; | 37 }; |
42 | 38 |
43 const NEW_DEPENDENCIES_BY_EXISTING_MODULES = { | 39 const NEW_DEPENDENCIES_BY_EXISTING_MODULES = { |
44 // resources: ['components'], | 40 // resources: ['components'], |
45 }; | 41 }; |
46 | 42 |
47 const REMOVE_DEPENDENCIES_BY_EXISTING_MODULES = {}; | 43 const REMOVE_DEPENDENCIES_BY_EXISTING_MODULES = {}; |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 return string.split('') | 678 return string.split('') |
683 .map(function(char) { | 679 .map(function(char) { |
684 var charCode = char.charCodeAt(0); | 680 var charCode = char.charCodeAt(0); |
685 return charCode > 127 ? unicodeCharEscape(charCode) : char; | 681 return charCode > 127 ? unicodeCharEscape(charCode) : char; |
686 }) | 682 }) |
687 .join(''); | 683 .join(''); |
688 } | 684 } |
689 | 685 |
690 if (require.main === module) | 686 if (require.main === module) |
691 extractModule(); | 687 extractModule(); |
OLD | NEW |