chrome-devtools-frontend 1.0.946351 → 1.0.948359

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/.eslintrc.js +1 -0
  2. package/config/gni/all_devtools_files.gni +1 -15
  3. package/config/gni/devtools_grd_files.gni +9 -15
  4. package/config/gni/devtools_image_files.gni +1 -0
  5. package/front_end/.eslintrc.js +6 -1
  6. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  7. package/front_end/core/host/InspectorFrontendHost.ts +0 -3
  8. package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
  9. package/front_end/core/host/UserMetrics.ts +1 -22
  10. package/front_end/core/i18n/locales/en-US.json +38 -29
  11. package/front_end/core/i18n/locales/en-XL.json +38 -29
  12. package/front_end/core/platform/platform.ts +0 -2
  13. package/front_end/core/platform/string-utilities.ts +14 -1
  14. package/front_end/core/platform/utilities.ts +0 -29
  15. package/front_end/core/root/Runtime.ts +4 -211
  16. package/front_end/core/sdk/AccessibilityModel.ts +0 -2
  17. package/front_end/core/sdk/CSSProperty.ts +0 -2
  18. package/front_end/core/sdk/CSSRule.ts +0 -2
  19. package/front_end/core/sdk/Cookie.ts +0 -25
  20. package/front_end/core/sdk/EmulationModel.ts +0 -2
  21. package/front_end/core/sdk/HeapProfilerModel.ts +0 -2
  22. package/front_end/core/sdk/NetworkManager.ts +0 -3
  23. package/front_end/core/sdk/Resource.ts +0 -3
  24. package/front_end/core/sdk/ResourceTreeModel.ts +0 -3
  25. package/front_end/core/sdk/ServiceWorkerManager.ts +0 -2
  26. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  27. package/front_end/devtools_compatibility.js +1 -1
  28. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  29. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  30. package/front_end/entrypoints/inspector/{inspector.js → inspector.ts} +0 -3
  31. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  32. package/front_end/entrypoints/main/MainImpl.ts +0 -1
  33. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
  34. package/front_end/entrypoints/{node_main → node_app}/NodeConnectionsPanel.ts +1 -1
  35. package/front_end/entrypoints/{node_main → node_app}/NodeMain.ts +2 -4
  36. package/front_end/entrypoints/{node_main → node_app}/nodeConnectionsPanel.css +0 -0
  37. package/front_end/entrypoints/node_app/node_app.ts +79 -0
  38. package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
  39. package/front_end/entrypoints/worker_app/{worker_app.js → worker_app.ts} +3 -2
  40. package/front_end/generated/InspectorBackendCommands.js +5 -1
  41. package/front_end/generated/protocol.d.ts +12 -0
  42. package/front_end/legacy/legacy-defs.d.ts +0 -4
  43. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  44. package/front_end/models/bindings/CompilerScriptMapping.ts +0 -1
  45. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +4 -11
  46. package/front_end/models/bindings/SASSSourceMapping.ts +0 -1
  47. package/front_end/models/emulation/DeviceModeModel.ts +0 -2
  48. package/front_end/models/issues_manager/CorsIssue.ts +17 -9
  49. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  50. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  51. package/front_end/panels/animation/AnimationTimeline.ts +0 -2
  52. package/front_end/panels/animation/AnimationUI.ts +0 -2
  53. package/front_end/panels/application/BackForwardCacheStrings.ts +2 -5
  54. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  55. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  56. package/front_end/panels/application/application-legacy.ts +0 -3
  57. package/front_end/panels/application/application-meta.ts +0 -13
  58. package/front_end/panels/application/backForwardCacheView.css +44 -6
  59. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  60. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  61. package/front_end/panels/application/components/StackTrace.ts +1 -1
  62. package/front_end/panels/coverage/CoverageView.ts +1 -1
  63. package/front_end/panels/css_overview/CSSOverviewModel.ts +0 -2
  64. package/front_end/panels/css_overview/CSSOverviewPanel.ts +0 -7
  65. package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +0 -2
  66. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  67. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  68. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  69. package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -11
  70. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  71. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  72. package/front_end/panels/elements/StylesSidebarPane.ts +0 -1
  73. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  74. package/front_end/panels/emulation/DeviceModeToolbar.ts +0 -16
  75. package/front_end/panels/issues/CorsIssueDetailsView.ts +18 -2
  76. package/front_end/panels/lighthouse/lighthouse-meta.ts +0 -3
  77. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  78. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  79. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  80. package/front_end/panels/search/SearchView.ts +24 -4
  81. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  82. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
  83. package/front_end/panels/sources/CSSPlugin.ts +3 -0
  84. package/front_end/panels/sources/CoveragePlugin.ts +2 -0
  85. package/front_end/panels/sources/DebuggerPlugin.ts +29 -5
  86. package/front_end/panels/sources/JavaScriptCompilerPlugin.ts +3 -0
  87. package/front_end/panels/sources/ProfilePlugin.ts +3 -0
  88. package/front_end/panels/sources/UISourceCodeFrame.ts +11 -2
  89. package/front_end/panels/timeline/TimelineTreeView.ts +3 -1
  90. package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
  91. package/front_end/third_party/codemirror.next/chunk/cpp.js +1 -2
  92. package/front_end/third_party/codemirror.next/chunk/java.js +1 -2
  93. package/front_end/third_party/codemirror.next/chunk/json.js +1 -2
  94. package/front_end/third_party/codemirror.next/chunk/markdown.js +1 -2
  95. package/front_end/third_party/codemirror.next/chunk/php.js +1 -2
  96. package/front_end/third_party/codemirror.next/chunk/python.js +1 -2
  97. package/front_end/third_party/codemirror.next/chunk/wast.js +1 -2
  98. package/front_end/third_party/codemirror.next/chunk/xml.js +1 -2
  99. package/front_end/third_party/codemirror.next/codemirror.next.d.ts +1486 -1423
  100. package/front_end/third_party/codemirror.next/codemirror.next.js +1 -2
  101. package/front_end/third_party/codemirror.next/package.json +10 -9
  102. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +168 -164
  103. package/front_end/third_party/lighthouse/locales/ar-XB.json +0 -3
  104. package/front_end/third_party/lighthouse/locales/ar.json +0 -3
  105. package/front_end/third_party/lighthouse/locales/bg.json +17 -20
  106. package/front_end/third_party/lighthouse/locales/ca.json +0 -3
  107. package/front_end/third_party/lighthouse/locales/cs.json +0 -3
  108. package/front_end/third_party/lighthouse/locales/da.json +16 -19
  109. package/front_end/third_party/lighthouse/locales/de.json +0 -3
  110. package/front_end/third_party/lighthouse/locales/el.json +0 -3
  111. package/front_end/third_party/lighthouse/locales/en-GB.json +19 -22
  112. package/front_end/third_party/lighthouse/locales/en-US.json +33 -3
  113. package/front_end/third_party/lighthouse/locales/en-XA.json +0 -3
  114. package/front_end/third_party/lighthouse/locales/en-XL.json +33 -3
  115. package/front_end/third_party/lighthouse/locales/es-419.json +17 -20
  116. package/front_end/third_party/lighthouse/locales/es.json +0 -3
  117. package/front_end/third_party/lighthouse/locales/fi.json +16 -19
  118. package/front_end/third_party/lighthouse/locales/fil.json +33 -36
  119. package/front_end/third_party/lighthouse/locales/fr.json +16 -19
  120. package/front_end/third_party/lighthouse/locales/he.json +16 -19
  121. package/front_end/third_party/lighthouse/locales/hi.json +0 -3
  122. package/front_end/third_party/lighthouse/locales/hr.json +16 -19
  123. package/front_end/third_party/lighthouse/locales/hu.json +16 -19
  124. package/front_end/third_party/lighthouse/locales/id.json +16 -19
  125. package/front_end/third_party/lighthouse/locales/it.json +37 -40
  126. package/front_end/third_party/lighthouse/locales/ja.json +16 -19
  127. package/front_end/third_party/lighthouse/locales/ko.json +16 -19
  128. package/front_end/third_party/lighthouse/locales/lt.json +17 -20
  129. package/front_end/third_party/lighthouse/locales/lv.json +0 -3
  130. package/front_end/third_party/lighthouse/locales/nl.json +16 -19
  131. package/front_end/third_party/lighthouse/locales/no.json +17 -20
  132. package/front_end/third_party/lighthouse/locales/pl.json +16 -19
  133. package/front_end/third_party/lighthouse/locales/pt-PT.json +37 -40
  134. package/front_end/third_party/lighthouse/locales/pt.json +16 -19
  135. package/front_end/third_party/lighthouse/locales/ro.json +0 -3
  136. package/front_end/third_party/lighthouse/locales/ru.json +16 -19
  137. package/front_end/third_party/lighthouse/locales/sk.json +0 -3
  138. package/front_end/third_party/lighthouse/locales/sl.json +0 -3
  139. package/front_end/third_party/lighthouse/locales/sr-Latn.json +16 -19
  140. package/front_end/third_party/lighthouse/locales/sr.json +16 -19
  141. package/front_end/third_party/lighthouse/locales/sv.json +17 -20
  142. package/front_end/third_party/lighthouse/locales/ta.json +0 -3
  143. package/front_end/third_party/lighthouse/locales/te.json +0 -3
  144. package/front_end/third_party/lighthouse/locales/th.json +0 -3
  145. package/front_end/third_party/lighthouse/locales/tr.json +0 -3
  146. package/front_end/third_party/lighthouse/locales/uk.json +17 -20
  147. package/front_end/third_party/lighthouse/locales/vi.json +0 -3
  148. package/front_end/third_party/lighthouse/locales/zh-HK.json +0 -3
  149. package/front_end/third_party/lighthouse/locales/zh-TW.json +0 -3
  150. package/front_end/third_party/lighthouse/locales/zh.json +0 -3
  151. package/front_end/third_party/lighthouse/report/bundle.d.ts +63 -61
  152. package/front_end/third_party/lighthouse/report/bundle.js +36 -7
  153. package/front_end/third_party/lighthouse/report-assets/report-generator.js +205 -192
  154. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  155. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  156. package/front_end/ui/components/helpers/helpers.ts +0 -2
  157. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  158. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  159. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  160. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  161. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  162. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  163. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  164. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  165. package/front_end/ui/components/report_view/reportSection.css +20 -0
  166. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  167. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  168. package/front_end/ui/components/text_editor/config.ts +9 -7
  169. package/front_end/ui/components/text_editor/javascript.ts +15 -11
  170. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  171. package/front_end/ui/legacy/GlassPane.ts +1 -1
  172. package/front_end/ui/legacy/InspectorView.ts +10 -0
  173. package/front_end/ui/legacy/SearchableView.ts +2 -1
  174. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  175. package/front_end/ui/legacy/Widget.ts +1 -1
  176. package/front_end/ui/legacy/XWidget.ts +0 -5
  177. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  178. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  179. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +40 -32
  180. package/front_end/ui/legacy/themeColors.css +1 -1
  181. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  182. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  183. package/inspector_overlay/main.ts +2 -12
  184. package/package.json +2 -4
  185. package/scripts/build/build_inspector_overlay.py +15 -1
  186. package/scripts/build/rjsmin.py +84 -115
  187. package/scripts/eslint_rules/lib/l10n_filename_matches.js +4 -4
  188. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  189. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  190. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  191. package/scripts/eslint_rules/tests/l10n_filename_matches_test.js +4 -0
  192. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  193. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  194. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
  195. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -5
  196. package/front_end/entrypoints/inspector/inspector.json +0 -4
  197. package/front_end/entrypoints/js_app/js_app.js +0 -12
  198. package/front_end/entrypoints/js_app/js_app.json +0 -3
  199. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
  200. package/front_end/entrypoints/node_app/node_app-meta.ts +0 -43
  201. package/front_end/entrypoints/node_app/node_app.js +0 -16
  202. package/front_end/entrypoints/node_app/node_app.json +0 -3
  203. package/front_end/entrypoints/node_main/node_main-meta.ts +0 -48
  204. package/front_end/entrypoints/node_main/node_main.ts +0 -11
  205. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  206. package/front_end/entrypoints/startup/startup.ts +0 -9
  207. package/front_end/entrypoints/worker_app/worker_app.json +0 -3
  208. package/front_end/panels/lighthouse/module.json +0 -6
  209. package/front_end/third_party/lighthouse/report-assets/report.d.ts +0 -1
  210. package/front_end/third_party/lighthouse/report-assets/report.js +0 -233
  211. package/front_end/third_party/lighthouse/report-assets/standalone-template.html +0 -38
  212. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  213. package/scripts/build/build_release_applications.py +0 -216
  214. package/scripts/build/modular_build.py +0 -184
  215. package/scripts/check_gn.js +0 -119
  216. package/scripts/json_validator/module.schema.json +0 -19
  217. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -0,0 +1,101 @@
1
+ // Copyright 2021 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
+ 'use strict';
5
+
6
+ function isLitHtmlTemplateCall(taggedTemplateExpressionNode) {
7
+ // Match LitHtml.html``
8
+ const {tag} = taggedTemplateExpressionNode;
9
+ if (!tag) {
10
+ return false;
11
+ }
12
+ // Match LitHtml.html``
13
+ const isLitHtmlDotHtmlCall = tag.object?.name === 'LitHtml' && tag.property?.name === 'html';
14
+ // Match html`` (and guess that it's Lit)
15
+ const isDestructuredHtmlCall = tag.type === 'Identifier' && tag.name === 'html';
16
+
17
+ return isLitHtmlDotHtmlCall || isDestructuredHtmlCall;
18
+ }
19
+
20
+ function templateElementPartStartsWithDoubleQuote(templateElementPartNode) {
21
+ return templateElementPartNode.value.raw.startsWith('"');
22
+ }
23
+ function templateElementPartEndsWithEqualsDoubleQuote(templateElementPartNode) {
24
+ return templateElementPartNode.value.raw.endsWith('="');
25
+ }
26
+
27
+ function removeQuotesFromAttribute({fixer, firstPart, secondPart}) {
28
+ const [, rangeOfOpeningTemplatePartEnd] = firstPart.range;
29
+ // From the first part, we need to remove the last character, which is the double quote.
30
+ // We can do this by fetching the range of the node (range = start and end position on the line)
31
+ // However, for the template part with the opening quote, the range will also contain the ${ of the interpolation:
32
+ // <p class="${
33
+ // ^^^^^^^^^^^^ this is the text covered by the [start, end] range.
34
+ // So what we need to do is remove the quote, and leave the last two characters alone.
35
+ // Therefore we remove the third character back from the end, and only remove a single character, leaving the ${ part alone.
36
+ const startingQuoteRangeToRemove = [rangeOfOpeningTemplatePartEnd - 3, rangeOfOpeningTemplatePartEnd - 2];
37
+
38
+ const [rangeOfClosingTemplatePartStart] = secondPart.range;
39
+ // It's a similar story for the second part where the range includes the }:
40
+ // }">foo</p>
41
+ // ^^^^^^^^^^ this is the range
42
+ // So therefore we get the start of the range, and add one to it, to dodge the } character, and then remove only the quote.
43
+ const endingQuoteRangeToRemove = [rangeOfClosingTemplatePartStart + 1, rangeOfClosingTemplatePartStart + 2];
44
+
45
+ return [fixer.removeRange(startingQuoteRangeToRemove), fixer.removeRange(endingQuoteRangeToRemove)];
46
+ }
47
+
48
+ module.exports = {
49
+ meta: {
50
+ type: 'problem',
51
+
52
+ docs: {
53
+ description: 'ensure no extra quotes around attributes when the value is interpolated',
54
+ category: 'Possible Errors',
55
+ },
56
+ fixable: 'code',
57
+ messages: {
58
+ attributeQuotesNotRequired:
59
+ 'When interpolating a value as an attribute in LitHtml you do not need double quotes around it.',
60
+ },
61
+ schema: [] // no options
62
+ },
63
+ create: function(context) {
64
+ return {
65
+ TaggedTemplateExpression(node) {
66
+ if (!isLitHtmlTemplateCall(node)) {
67
+ return;
68
+ }
69
+
70
+ // quasis here = the static parts of a template expression
71
+ // expressions = the dynamic parts of a template expression
72
+ // For example, given: <p class="${foo}"> we will have:
73
+ // quasis: ['<p class="', '">']
74
+ // expressions: ['foo'] (it's actually an AST node representing ${foo})
75
+ // So what we do is walk through and look for quasi pairs where:
76
+ // 1. the first ends with ="
77
+ // 2. the second begins with "
78
+ // We can then be confident that we have found an attribute with quotes around it.
79
+ node.quasi.quasis.forEach((templateElement, index) => {
80
+ if (templateElementPartEndsWithEqualsDoubleQuote(templateElement)) {
81
+ const nextElement = node.quasi.quasis[index + 1];
82
+ if (nextElement && templateElementPartStartsWithDoubleQuote(nextElement)) {
83
+ const expressionBetweenTheParts = node.quasi.expressions[index];
84
+ context.report({
85
+ node: expressionBetweenTheParts,
86
+ messageId: 'attributeQuotesNotRequired',
87
+ fix(fixer) {
88
+ return removeQuotesFromAttribute({
89
+ fixer,
90
+ firstPart: templateElement,
91
+ secondPart: nextElement,
92
+ });
93
+ }
94
+ });
95
+ }
96
+ }
97
+ });
98
+ },
99
+ };
100
+ }
101
+ };
@@ -0,0 +1,53 @@
1
+ // Copyright 2021 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
+ module.exports = {
6
+ meta: {
7
+ type: 'problem',
8
+
9
+ docs: {
10
+ description: 'Usage of only: true in ESLint tests',
11
+ category: 'Possible Errors',
12
+ },
13
+ fixable: 'code',
14
+ messages: {noOnlyInESLintTest: 'You cannot use only: true in an ESLint test.'},
15
+ schema: [] // no options
16
+ },
17
+ create: function(context) {
18
+ function checkForOnlyInTestCases(testCaseObjects) {
19
+ for (const testCase of testCaseObjects) {
20
+ const onlyKeyProp = testCase.properties.find(prop => {
21
+ return prop.key.name === 'only';
22
+ });
23
+ if (onlyKeyProp) {
24
+ context.report({
25
+ node: onlyKeyProp,
26
+ messageId: 'noOnlyInESLintTest'
27
+
28
+ });
29
+ }
30
+ }
31
+ }
32
+
33
+ return {
34
+ // match ruleTester.run('foo', rule, {...})
35
+ 'CallExpression[callee.object.name=\'ruleTester\'][callee.property.name=\'run\']'(node) {
36
+ // first argument = string name
37
+ // second argument = rule itself
38
+ // third argument = the object containing the test cases - what we want!
39
+ const tests = node.arguments[2];
40
+ if (!tests) {
41
+ return;
42
+ }
43
+
44
+ for (const testProperty of tests.properties) {
45
+ // Iterate over the "valid" and "invalid" rules
46
+ // Here .value = the array of test cases, and .elements gets us each
47
+ // object (individual test case) within that array.
48
+ checkForOnlyInTestCases(testProperty.value.elements);
49
+ }
50
+ }
51
+ };
52
+ }
53
+ };
@@ -0,0 +1,14 @@
1
+ // Copyright 2021 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
+ const path = require('path');
6
+ const rulesDirPlugin = require('eslint-plugin-rulesdir');
7
+
8
+ rulesDirPlugin.RULES_DIR = path.join(__dirname, '..', 'lib');
9
+
10
+ module.exports = {
11
+ 'rules': {
12
+ 'rulesdir/no_only_eslint_tests': 2,
13
+ }
14
+ };
@@ -17,14 +17,17 @@ ruleTester.run('l10n_filename_matches', rule, {
17
17
  {
18
18
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/test.ts\', UIStrings);',
19
19
  filename: 'front_end/components/test.ts',
20
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
20
21
  },
21
22
  {
22
23
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/ModuleUIStrings.js\', UIStrings);',
23
24
  filename: 'front_end/components/test.ts',
25
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
24
26
  },
25
27
  {
26
28
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/ModuleUIStrings.ts\', UIStrings);',
27
29
  filename: 'front_end/components/test.ts',
30
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}]
28
31
  },
29
32
  {
30
33
  code: 'const str_ = i18n.i18n.registerUIStrings(\'ModuleUIStrings.ts\', UIStrings);',
@@ -41,6 +44,7 @@ ruleTester.run('l10n_filename_matches', rule, {
41
44
  {
42
45
  code: 'const str_ = i18n.i18n.registerUIStrings(\'components/foo.ts\', UIStrings);',
43
46
  filename: 'front_end/components/test.ts',
47
+ options: [{rootFrontendDirectory: path.join(__dirname, '..', '..', '..', 'front_end')}],
44
48
  errors: [{
45
49
  message:
46
50
  'First argument to \'registerUIStrings\' call must be \'components/test.ts\' or the ModuleUIStrings.(js|ts)'
@@ -0,0 +1,45 @@
1
+ // Copyright 2021 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
+ 'use strict';
5
+
6
+ const rule = require('../lib/lit_html_no_attribute_quotes.js');
7
+ const ruleTester = new (require('eslint').RuleTester)({
8
+ parserOptions: {ecmaVersion: 9, sourceType: 'module'},
9
+ parser: require.resolve('@typescript-eslint/parser'),
10
+ });
11
+
12
+ ruleTester.run('lit_html_no_attribute_quotes', rule, {
13
+ valid: [
14
+ {
15
+ code: 'LitHtml.html`<p class=${foo}>foo</p>`',
16
+ filename: 'front_end/components/datagrid.ts',
17
+ },
18
+ {
19
+ code: 'LitHtml.html`<p class=${foo}>"${someOutput}"</p>`',
20
+ filename: 'front_end/components/datagrid.ts',
21
+ },
22
+ {
23
+ code: 'html`<p class=${foo}>"${someOutput}"</p>`',
24
+ filename: 'front_end/components/datagrid.ts',
25
+ },
26
+ {
27
+ code: 'html`<p class="my-${fooClassName}">"${someOutput}"</p>`',
28
+ filename: 'front_end/components/datagrid.ts',
29
+ },
30
+ ],
31
+ invalid: [
32
+ {
33
+ code: 'LitHtml.html`<p class="${foo}">foo</p>`',
34
+ filename: 'front_end/components/datagrid.ts',
35
+ errors: [{messageId: 'attributeQuotesNotRequired', column: 26, line: 1}],
36
+ output: 'LitHtml.html`<p class=${foo}>foo</p>`',
37
+ },
38
+ {
39
+ code: 'html`<p class="${foo}">foo</p>`',
40
+ filename: 'front_end/components/datagrid.ts',
41
+ errors: [{messageId: 'attributeQuotesNotRequired'}],
42
+ output: 'html`<p class=${foo}>foo</p>`',
43
+ },
44
+ ]
45
+ });
@@ -0,0 +1,94 @@
1
+ // Copyright 2021 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
+ const rule = require('../lib/no_only_eslint_tests.js');
6
+ const ruleTester = new (require('eslint').RuleTester)({
7
+ parserOptions: {ecmaVersion: 9, sourceType: 'module'},
8
+ });
9
+
10
+ ruleTester.run('no_only_eslint_tests', rule, {
11
+ valid: [
12
+ {
13
+ code: `ruleTester.run('my_eslint_rule', rule, {
14
+ valid: [{
15
+ code: 'foo',
16
+ filename: 'foo.ts',
17
+ }]
18
+ })`,
19
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
20
+ },
21
+ {
22
+ code: `ruleTester.run('my_eslint_rule', rule, {
23
+ invalid: [{
24
+ code: 'foo',
25
+ filename: 'foo.ts',
26
+ }]
27
+ })`,
28
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
29
+ },
30
+ ],
31
+
32
+ invalid: [
33
+ {
34
+ code: `ruleTester.run('my_eslint_rule', rule, {
35
+ valid: [{
36
+ only: true,
37
+ code: 'foo',
38
+ filename: 'foo.ts',
39
+ }]
40
+ })`,
41
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
42
+ errors: [{messageId: 'noOnlyInESLintTest'}],
43
+ },
44
+ {
45
+ code: `ruleTester.run('my_eslint_rule', rule, {
46
+ invalid: [{
47
+ only: true,
48
+ code: 'foo',
49
+ filename: 'foo.ts',
50
+ errors: [{ messagId: 'foo' }]
51
+ }]
52
+ })`,
53
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
54
+ errors: [{messageId: 'noOnlyInESLintTest'}],
55
+ },
56
+ {
57
+ code: `ruleTester.run('my_eslint_rule', rule, {
58
+ valid: [{
59
+ only: true,
60
+ code: 'foo',
61
+ filename: 'foo.ts',
62
+ }],
63
+ invalid: [{
64
+ only: true,
65
+ code: 'foo',
66
+ filename: 'foo.ts',
67
+ errors: [{ messagId: 'foo' }]
68
+ }]
69
+ })`,
70
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
71
+ errors: [{messageId: 'noOnlyInESLintTest'}, {messageId: 'noOnlyInESLintTest'}],
72
+ },
73
+ {
74
+ code: `ruleTester.run('my_eslint_rule', rule, {
75
+ valid: [{
76
+ only: true,
77
+ code: 'foo',
78
+ filename: 'foo.ts',
79
+ }, {
80
+ code: 'foo',
81
+ filename: 'foo.ts',
82
+ }],
83
+ invalid: [{
84
+ only: true,
85
+ code: 'foo',
86
+ filename: 'foo.ts',
87
+ errors: [{ messagId: 'foo' }]
88
+ }]
89
+ })`,
90
+ filename: 'scripts/eslint_rules/tests/foo_test.js',
91
+ errors: [{messageId: 'noOnlyInESLintTest'}, {messageId: 'noOnlyInESLintTest'}],
92
+ },
93
+ ]
94
+ });
@@ -1,11 +0,0 @@
1
- // Copyright 2018 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
- import '../shell/shell.js';
5
- import './devtools_app-meta-files.js';
6
-
7
- import * as Main from '../main/main.js';
8
- import * as Startup from '../startup/startup.js';
9
-
10
- new Main.MainImpl.MainImpl();
11
- Startup.RuntimeInstantiator.startApplication('devtools_app');
@@ -1,5 +0,0 @@
1
- {
2
- "modules" : [
3
- { "name": "panels/lighthouse" }
4
- ]
5
- }
@@ -1,4 +0,0 @@
1
- {
2
- "modules" : [],
3
- "extends": "devtools_app"
4
- }
@@ -1,12 +0,0 @@
1
- // Copyright 2018 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
- import '../shell/shell.js';
5
- import '../../panels/js_profiler/js_profiler-meta.js';
6
- import './JsMain.js';
7
-
8
- import * as Main from '../main/main.js';
9
- import * as Startup from '../startup/startup.js';
10
-
11
- new Main.MainImpl.MainImpl();
12
- Startup.RuntimeInstantiator.startApplication('js_app');
@@ -1,3 +0,0 @@
1
- {
2
- "modules" : []
3
- }
@@ -1,4 +0,0 @@
1
- {
2
- "modules" : [
3
- ]
4
- }
@@ -1,43 +0,0 @@
1
- // Copyright 2020 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
- import * as i18n from '../../core/i18n/i18n.js';
6
- import * as UI from '../../ui/legacy/legacy.js';
7
- import type * as Sources from '../../panels/sources/sources.js';
8
-
9
- const UIStrings = {
10
- /**
11
- *@description Title of the 'Node' tool in the Network Navigator View, which is part of the Sources tool
12
- */
13
- node: 'Node',
14
- /**
15
- *@description Command for showing the 'Node' tool in the Network Navigator View, which is part of the Sources tool
16
- */
17
- showNode: 'Node',
18
- };
19
-
20
- const str_ = i18n.i18n.registerUIStrings('entrypoints/node_app/node_app-meta.ts', UIStrings);
21
- const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
22
-
23
- let loadedSourcesModule: (typeof Sources|undefined);
24
-
25
- async function loadHelpModule(): Promise<typeof Sources> {
26
- if (!loadedSourcesModule) {
27
- loadedSourcesModule = await import('../../panels/sources/sources.js');
28
- }
29
- return loadedSourcesModule;
30
- }
31
-
32
- UI.ViewManager.registerViewExtension({
33
- location: UI.ViewManager.ViewLocationValues.NAVIGATOR_VIEW,
34
- id: 'navigator-network',
35
- title: i18nLazyString(UIStrings.node),
36
- commandPrompt: i18nLazyString(UIStrings.showNode),
37
- order: 2,
38
- persistence: UI.ViewManager.ViewPersistence.PERMANENT,
39
- async loadView() {
40
- const Sources = await loadHelpModule();
41
- return Sources.SourcesNavigator.NetworkNavigatorView.instance();
42
- },
43
- });
@@ -1,16 +0,0 @@
1
- // Copyright 2018 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
- import '../shell/shell.js';
5
- import '../../panels/js_profiler/js_profiler-meta.js';
6
- import '../node_main/node_main-meta.js';
7
- import './node_app-meta.js';
8
-
9
- import * as Main from '../main/main.js';
10
- import * as Startup from '../startup/startup.js';
11
-
12
- // Side-effect start the `node_main` module, which implements runnables in
13
- // the NodeMain class
14
- await import('../node_main/node_main.js');
15
- new Main.MainImpl.MainImpl();
16
- Startup.RuntimeInstantiator.startApplication('node_app');
@@ -1,3 +0,0 @@
1
- {
2
- "modules" : [ ]
3
- }
@@ -1,48 +0,0 @@
1
- // Copyright 2020 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
- import * as i18n from '../../core/i18n/i18n.js';
6
- import * as UI from '../../ui/legacy/legacy.js';
7
-
8
- import type * as NodeMain from './node_main.js';
9
-
10
- const UIStrings = {
11
- /**
12
- *@description Text that refers to the network connection
13
- */
14
- connection: 'Connection',
15
- /**
16
- *@description A tag of Node.js Connection Panel that can be searched in the command menu
17
- */
18
- node: 'node',
19
- /**
20
- *@description Command for showing the Connection tool
21
- */
22
- showConnection: 'Show Connection',
23
- };
24
-
25
- const str_ = i18n.i18n.registerUIStrings('entrypoints/node_main/node_main-meta.ts', UIStrings);
26
- const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined, str_);
27
-
28
- let loadedNodeMainModule: (typeof NodeMain|undefined);
29
-
30
- async function loadNodeMainModule(): Promise<typeof NodeMain> {
31
- if (!loadedNodeMainModule) {
32
- loadedNodeMainModule = await import('./node_main.js');
33
- }
34
- return loadedNodeMainModule;
35
- }
36
-
37
- UI.ViewManager.registerViewExtension({
38
- location: UI.ViewManager.ViewLocationValues.PANEL,
39
- id: 'node-connection',
40
- title: i18nLazyString(UIStrings.connection),
41
- commandPrompt: i18nLazyString(UIStrings.showConnection),
42
- order: 0,
43
- async loadView() {
44
- const NodeMain = await loadNodeMainModule();
45
- return NodeMain.NodeConnectionsPanel.NodeConnectionsPanel.instance();
46
- },
47
- tags: [i18nLazyString(UIStrings.node)],
48
- });
@@ -1,11 +0,0 @@
1
- // Copyright 2019 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
- import * as NodeConnectionsPanel from './NodeConnectionsPanel.js';
6
- import * as NodeMain from './NodeMain.js';
7
-
8
- export {
9
- NodeConnectionsPanel,
10
- NodeMain,
11
- };
@@ -1,95 +0,0 @@
1
- /*
2
- * Copyright (C) 2014 Google Inc. All rights reserved.
3
- *
4
- * Redistribution and use in source and binary forms, with or without
5
- * modification, are permitted provided that the following conditions are
6
- * met:
7
- *
8
- * * Redistributions of source code must retain the above copyright
9
- * notice, this list of conditions and the following disclaimer.
10
- * * Redistributions in binary form must reproduce the above
11
- * copyright notice, this list of conditions and the following disclaimer
12
- * in the documentation and/or other materials provided with the
13
- * distribution.
14
- * * Neither the name of Google Inc. nor the names of its
15
- * contributors may be used to endorse or promote products derived from
16
- * this software without specific prior written permission.
17
- *
18
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- */
30
-
31
- import '../../core/root/root-legacy.js';
32
-
33
- import * as RootModule from '../../core/root/root.js';
34
-
35
- // Legacy runtime namespace definitions
36
- // @ts-ignore
37
- self.Runtime = self.Runtime || {};
38
- // @ts-ignore
39
- Runtime = Runtime || {};
40
- // The following two variables are initialized in `build_release_applications`
41
- // @ts-ignore
42
- Root.allDescriptors = Root.allDescriptors || [];
43
- // @ts-ignore
44
- Root.applicationDescriptor = Root.applicationDescriptor || undefined;
45
-
46
- export async function startApplication(_appName: string): Promise<void> {
47
- console.timeStamp('Root.Runtime.startApplication');
48
-
49
- const allDescriptorsByName: {
50
- [x: string]: RootModule.Runtime.ModuleDescriptor,
51
- } = {};
52
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
53
- // @ts-ignore
54
- for (let i = 0; i < Root.allDescriptors.length; ++i) {
55
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
56
- // @ts-ignore
57
- const d = Root.allDescriptors[i];
58
- allDescriptorsByName[d['name']] = d;
59
- }
60
-
61
- // TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
62
- // @ts-ignore
63
- const configuration = Root.applicationDescriptor.modules;
64
- const moduleDescriptors = [];
65
- const coreModuleNames = [];
66
- for (let i = 0; i < configuration.length; ++i) {
67
- const descriptor = configuration[i];
68
- const name = descriptor['name'];
69
- moduleDescriptors.push(allDescriptorsByName[name]);
70
- if (descriptor['type'] === 'autostart') {
71
- coreModuleNames.push(name);
72
- }
73
- }
74
-
75
- for (let i = 0; i < moduleDescriptors.length; ++i) {
76
- moduleDescriptors[i].name = configuration[i]['name'];
77
- moduleDescriptors[i].condition = configuration[i]['condition'];
78
- }
79
- const runtimeInstance = RootModule.Runtime.Runtime.instance({forceNew: true, moduleDescriptors});
80
- // @ts-ignore Exposed for legacy layout tests
81
- self.runtime = runtimeInstance;
82
- if (coreModuleNames) {
83
- await runtimeInstance.loadAutoStartModules(coreModuleNames);
84
- }
85
- RootModule.Runtime.appStartedPromiseCallback();
86
- }
87
-
88
- export async function startWorker(appName: string): Promise<void> {
89
- return startApplication(appName).then(sendWorkerReady);
90
-
91
- function sendWorkerReady(): void {
92
- // @ts-ignore
93
- self.postMessage('workerReady');
94
- }
95
- }
@@ -1,9 +0,0 @@
1
- // Copyright 2019 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
- import * as RuntimeInstantiator from './RuntimeInstantiator.js';
6
-
7
- export {
8
- RuntimeInstantiator,
9
- };
@@ -1,3 +0,0 @@
1
- {
2
- "modules" : []
3
- }
@@ -1,6 +0,0 @@
1
- {
2
- "resources": [
3
- "../../third_party/lighthouse/report-assets/standalone-template.html",
4
- "../../third_party/lighthouse/report-assets/report.js"
5
- ]
6
- }