chrome-devtools-frontend 1.0.952403 → 1.0.953165

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 (96) hide show
  1. package/front_end/.eslintrc.js +1 -0
  2. package/front_end/core/host/UserMetrics.ts +515 -481
  3. package/front_end/core/i18n/locales/af.json +158 -176
  4. package/front_end/core/i18n/locales/am.json +163 -181
  5. package/front_end/core/i18n/locales/ar.json +162 -180
  6. package/front_end/core/i18n/locales/as.json +163 -181
  7. package/front_end/core/i18n/locales/az.json +161 -179
  8. package/front_end/core/i18n/locales/be.json +160 -178
  9. package/front_end/core/i18n/locales/bg.json +159 -177
  10. package/front_end/core/i18n/locales/bn.json +166 -184
  11. package/front_end/core/i18n/locales/bs.json +161 -179
  12. package/front_end/core/i18n/locales/ca.json +159 -177
  13. package/front_end/core/i18n/locales/cs.json +159 -177
  14. package/front_end/core/i18n/locales/cy.json +164 -182
  15. package/front_end/core/i18n/locales/da.json +158 -176
  16. package/front_end/core/i18n/locales/de.json +160 -178
  17. package/front_end/core/i18n/locales/el.json +158 -176
  18. package/front_end/core/i18n/locales/en-GB.json +158 -176
  19. package/front_end/core/i18n/locales/es-419.json +160 -178
  20. package/front_end/core/i18n/locales/es.json +156 -174
  21. package/front_end/core/i18n/locales/et.json +161 -179
  22. package/front_end/core/i18n/locales/eu.json +159 -177
  23. package/front_end/core/i18n/locales/fa.json +166 -184
  24. package/front_end/core/i18n/locales/fi.json +161 -179
  25. package/front_end/core/i18n/locales/fil.json +162 -180
  26. package/front_end/core/i18n/locales/fr-CA.json +159 -177
  27. package/front_end/core/i18n/locales/fr.json +158 -176
  28. package/front_end/core/i18n/locales/gl.json +160 -178
  29. package/front_end/core/i18n/locales/gu.json +179 -197
  30. package/front_end/core/i18n/locales/he.json +160 -178
  31. package/front_end/core/i18n/locales/hi.json +166 -184
  32. package/front_end/core/i18n/locales/hr.json +161 -179
  33. package/front_end/core/i18n/locales/hu.json +161 -179
  34. package/front_end/core/i18n/locales/hy.json +157 -175
  35. package/front_end/core/i18n/locales/id.json +160 -178
  36. package/front_end/core/i18n/locales/is.json +163 -181
  37. package/front_end/core/i18n/locales/it.json +162 -180
  38. package/front_end/core/i18n/locales/ja.json +160 -178
  39. package/front_end/core/i18n/locales/ka.json +161 -179
  40. package/front_end/core/i18n/locales/kk.json +164 -182
  41. package/front_end/core/i18n/locales/km.json +160 -178
  42. package/front_end/core/i18n/locales/kn.json +162 -180
  43. package/front_end/core/i18n/locales/ko.json +162 -180
  44. package/front_end/core/i18n/locales/ky.json +160 -178
  45. package/front_end/core/i18n/locales/lo.json +159 -177
  46. package/front_end/core/i18n/locales/lt.json +159 -177
  47. package/front_end/core/i18n/locales/lv.json +162 -180
  48. package/front_end/core/i18n/locales/mk.json +162 -180
  49. package/front_end/core/i18n/locales/ml.json +160 -178
  50. package/front_end/core/i18n/locales/mn.json +164 -182
  51. package/front_end/core/i18n/locales/mr.json +163 -181
  52. package/front_end/core/i18n/locales/ms.json +163 -181
  53. package/front_end/core/i18n/locales/my.json +164 -182
  54. package/front_end/core/i18n/locales/ne.json +160 -178
  55. package/front_end/core/i18n/locales/nl.json +160 -178
  56. package/front_end/core/i18n/locales/no.json +281 -299
  57. package/front_end/core/i18n/locales/or.json +165 -183
  58. package/front_end/core/i18n/locales/pa.json +159 -177
  59. package/front_end/core/i18n/locales/pl.json +163 -181
  60. package/front_end/core/i18n/locales/pt-PT.json +160 -178
  61. package/front_end/core/i18n/locales/pt.json +159 -177
  62. package/front_end/core/i18n/locales/ro.json +161 -179
  63. package/front_end/core/i18n/locales/ru.json +159 -177
  64. package/front_end/core/i18n/locales/si.json +161 -179
  65. package/front_end/core/i18n/locales/sk.json +158 -176
  66. package/front_end/core/i18n/locales/sl.json +160 -178
  67. package/front_end/core/i18n/locales/sq.json +279 -297
  68. package/front_end/core/i18n/locales/sr-Latn.json +160 -178
  69. package/front_end/core/i18n/locales/sr.json +160 -178
  70. package/front_end/core/i18n/locales/sv.json +159 -177
  71. package/front_end/core/i18n/locales/sw.json +164 -182
  72. package/front_end/core/i18n/locales/ta.json +160 -178
  73. package/front_end/core/i18n/locales/te.json +165 -183
  74. package/front_end/core/i18n/locales/th.json +158 -176
  75. package/front_end/core/i18n/locales/tr.json +162 -180
  76. package/front_end/core/i18n/locales/uk.json +160 -178
  77. package/front_end/core/i18n/locales/ur.json +160 -178
  78. package/front_end/core/i18n/locales/uz.json +160 -178
  79. package/front_end/core/i18n/locales/vi.json +162 -180
  80. package/front_end/core/i18n/locales/zh-HK.json +160 -178
  81. package/front_end/core/i18n/locales/zh-TW.json +161 -179
  82. package/front_end/core/i18n/locales/zh.json +162 -180
  83. package/front_end/core/i18n/locales/zu.json +164 -182
  84. package/front_end/core/sdk/ChildTargetManager.ts +1 -0
  85. package/front_end/third_party/lighthouse/lighthouse-dt-bundle.js +188 -185
  86. package/front_end/third_party/lighthouse/locales/en-US.json +1 -1
  87. package/front_end/third_party/lighthouse/locales/en-XL.json +1 -1
  88. package/front_end/third_party/lighthouse/report/bundle.js +3 -3
  89. package/front_end/third_party/lighthouse/report-assets/report-generator.js +1 -1
  90. package/front_end/ui/components/docs/component_docs.ts +4 -4
  91. package/front_end/ui/components/docs/component_docs_styles.css +51 -0
  92. package/package.json +1 -1
  93. package/scripts/check_experiments.js +3 -6
  94. package/scripts/component_server/server.js +4 -12
  95. package/scripts/eslint_rules/lib/check_enumerated_histograms.js +32 -0
  96. package/scripts/eslint_rules/tests/check_enumerated_histograms_test.js +32 -0
@@ -16,13 +16,13 @@ ToggleFonts.init();
16
16
  // This can be used by tests to hide the UI elements that are part of the component docs interface.
17
17
  // E.g., this is useful for screenshot tests.
18
18
  window.addEventListener('hidecomponentdocsui', () => {
19
- for (const node of document.querySelectorAll('.component-docs-ui')) {
20
- (node as HTMLElement).style.display = 'none';
19
+ for (const node of document.querySelectorAll<HTMLElement>('.component-docs-ui')) {
20
+ node.style.display = 'none';
21
21
  }
22
22
  });
23
23
 
24
24
  window.addEventListener('showcomponentdocsui', () => {
25
- for (const node of document.querySelectorAll('.component-docs-ui')) {
26
- (node as HTMLElement).style.display = '';
25
+ for (const node of document.querySelectorAll<HTMLElement>('.component-docs-ui')) {
26
+ node.style.display = '';
27
27
  }
28
28
  });
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Copyright 2021 The Chromium Authors. All rights reserved.
3
+ * Use of this source code is governed by a BSD-style license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ body {
8
+ margin: 0;
9
+ padding: 0;
10
+ font-family: ".SFNSDisplay-Regular", "Helvetica Neue", "Lucida Grande", sans-serif;
11
+ }
12
+
13
+ #index-page h1 {
14
+ text-align: left;
15
+ border-bottom: 1px solid var(--color-details-hairline);
16
+ padding: 10px;
17
+ width: 100%;
18
+ margin-bottom: 10px;
19
+ }
20
+
21
+ .components-list {
22
+ display: flex;
23
+ flex-wrap: wrap;
24
+ list-style: none;
25
+ margin: 0;
26
+ padding: 10px;
27
+ }
28
+
29
+ .components-list li {
30
+ width: 20%;
31
+ min-width: 150px;
32
+ max-width: 300px;
33
+ margin: 0 12px 12px 0;
34
+ }
35
+
36
+ .components-list a {
37
+ display: block;
38
+ padding: 10px;
39
+ }
40
+
41
+ .components-list a:link,
42
+ .components-list a:visited {
43
+ text-transform: capitalize;
44
+ color: var(--color-primary);
45
+ text-decoration: none;
46
+ box-shadow: var(--drop-shadow);
47
+ }
48
+
49
+ .components-list a:hover {
50
+ box-shadow: var(--drop-shadow-depth-3);
51
+ }
package/package.json CHANGED
@@ -53,5 +53,5 @@
53
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
54
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
55
55
  },
56
- "version": "1.0.952403"
56
+ "version": "1.0.953165"
57
57
  }
@@ -15,7 +15,7 @@ const parseOptions = {
15
15
  range: true,
16
16
  };
17
17
 
18
- const USER_METRICS_ENUM_ENDPOINT = '__lastValidEnumPosition';
18
+ const USER_METRICS_ENUM_ENDPOINT = 'MaxValue';
19
19
 
20
20
  /**
21
21
  * Determines if a node is a class declaration.
@@ -162,8 +162,7 @@ function getMainImplExperimentList(mainImplFile, experimentNames) {
162
162
  * Determines if AST Node is the DevtoolsExperiments Enum declaration
163
163
  */
164
164
  function isExperimentEnumDeclaration(node) {
165
- return node.type === 'ExportNamedDeclaration' && node.declaration.declarations &&
166
- node.declaration.declarations[0].id.name === 'DevtoolsExperiments';
165
+ return node.type === 'ExportNamedDeclaration' && node?.declaration?.id?.name === 'DevtoolsExperiments';
167
166
  }
168
167
 
169
168
  /**
@@ -173,9 +172,7 @@ function getUserMetricExperimentList(userMetricsFile) {
173
172
  const userMetricsAST = espree.parse(userMetricsFile, {ecmaVersion: 11, sourceType: 'module', range: true});
174
173
  for (const node of userMetricsAST.body) {
175
174
  if (isExperimentEnumDeclaration(node)) {
176
- return node.declaration.declarations[0].init.properties.map(property => {
177
- return property.key.value;
178
- });
175
+ return node.declaration.members.map(member => member.id.value);
179
176
  }
180
177
  }
181
178
  return null;
@@ -150,20 +150,12 @@ function createServerIndexFile(componentNames) {
150
150
  <meta charset="UTF-8" />
151
151
  <meta name="viewport" content="width=device-width" />
152
152
  <title>DevTools components</title>
153
- <style>
154
- a:link, a:visited {
155
- color: blue;
156
- text-transform: capitalize;
157
- text-decoration: none;
158
- }
159
- a:hover {
160
- text-decoration: underline;
161
- }
162
- </style>
153
+ <link rel="stylesheet" href="/front_end/ui/legacy/themeColors.css" />
154
+ <link rel="stylesheet" href="/front_end/ui/components/docs/component_docs_styles.css" />
163
155
  </head>
164
- <body>
156
+ <body id="index-page">
165
157
  <h1>DevTools components</h1>
166
- <ul>
158
+ <ul class="components-list">
167
159
  ${componentNames.map(name => {
168
160
  const niceName = name.replace(/_/g, ' ');
169
161
  return `<li><a href='/front_end/ui/components/docs/${name}'>${niceName}</a></li>`;
@@ -0,0 +1,32 @@
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
+ 'use strict';
5
+
6
+ module.exports = {
7
+ meta: {
8
+ type: 'problem',
9
+ docs: {
10
+ description: 'check arguments when recording enumerated histograms',
11
+ category: 'Possible Errors',
12
+ },
13
+ fixable: 'code',
14
+ schema: [] // no options
15
+ },
16
+ create: function(context) {
17
+ return {
18
+ CallExpression(node) {
19
+ if (node?.callee?.object?.name === 'InspectorFrontendHostInstance' &&
20
+ node.callee.property.name === 'recordEnumeratedHistogram') {
21
+ if (node?.arguments[2]?.property?.name !== 'MaxValue') {
22
+ context.report({
23
+ node: node,
24
+ message:
25
+ 'When calling \'recordEnumeratedHistogram\' the third argument should be of the form \'SomeEnum.MaxValue\'.'
26
+ });
27
+ }
28
+ }
29
+ }
30
+ };
31
+ }
32
+ };
@@ -0,0 +1,32 @@
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/check_enumerated_histograms.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('check_enumerated_histograms', rule, {
13
+ valid: [
14
+ {
15
+ code: 'InspectorFrontendHostInstance.recordEnumeratedHistogram(\'someparam\', 1, foo.MaxValue);',
16
+ filename: 'front_end/components/test.ts',
17
+ },
18
+ {
19
+ code:
20
+ 'InspectorFrontendHostInstance.recordEnumeratedHistogram(EnumeratedHistogram.IssueCreated, issueCreated, IssueCreated.MaxValue);',
21
+ filename: 'front_end/components/test.ts'
22
+ }
23
+ ],
24
+ invalid: [{
25
+ code: 'InspectorFrontendHostInstance.recordEnumeratedHistogram(\'someparam\', 1, 5);',
26
+ filename: 'front_end/components/test.ts',
27
+ errors: [{
28
+ message:
29
+ 'When calling \'recordEnumeratedHistogram\' the third argument should be of the form \'SomeEnum.MaxValue\'.'
30
+ }],
31
+ }]
32
+ });