chrome-devtools-frontend 1.0.947377 → 1.0.948295

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 (97) hide show
  1. package/config/gni/all_devtools_files.gni +1 -6
  2. package/config/gni/devtools_grd_files.gni +5 -6
  3. package/config/gni/devtools_image_files.gni +1 -0
  4. package/front_end/.eslintrc.js +1 -0
  5. package/front_end/Images/src/circled_backslash_icon.svg +3 -0
  6. package/front_end/core/host/UserMetrics.ts +1 -1
  7. package/front_end/core/i18n/locales/en-US.json +17 -14
  8. package/front_end/core/i18n/locales/en-XL.json +17 -14
  9. package/front_end/core/platform/platform.ts +0 -2
  10. package/front_end/core/platform/string-utilities.ts +14 -1
  11. package/front_end/core/platform/utilities.ts +0 -29
  12. package/front_end/core/root/Runtime.ts +4 -207
  13. package/front_end/core/sdk/Cookie.ts +0 -21
  14. package/front_end/core/sdk/sdk-legacy.ts +0 -3
  15. package/front_end/entrypoints/devtools_app/{devtools_app-meta-files.ts → devtools_app.ts} +9 -2
  16. package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +2 -1
  17. package/front_end/entrypoints/js_app/{JsMain.ts → js_app.ts} +5 -1
  18. package/front_end/entrypoints/main/MainImpl.ts +0 -1
  19. package/front_end/entrypoints/ndb_app/{ndb_app.js → ndb_app.ts} +0 -2
  20. package/front_end/entrypoints/node_app/node_app.ts +1 -3
  21. package/front_end/entrypoints/shell/{shell.js → shell.ts} +0 -2
  22. package/front_end/entrypoints/worker_app/worker_app.ts +1 -3
  23. package/front_end/legacy/legacy-defs.d.ts +0 -4
  24. package/front_end/legacy_test_runner/test_runner/TestRunner.js +35 -59
  25. package/front_end/models/issues_manager/CorsIssue.ts +15 -15
  26. package/front_end/models/issues_manager/descriptions/{corsInsecurePrivateNetworkPreflight.md → corsPreflightAllowPrivateNetworkError.md} +1 -1
  27. package/front_end/panels/accessibility/AccessibilitySidebarView.ts +3 -1
  28. package/front_end/panels/application/BackForwardCacheStrings.ts +1 -5
  29. package/front_end/panels/application/BackForwardCacheView.ts +150 -58
  30. package/front_end/panels/application/ResourcesPanel.ts +0 -42
  31. package/front_end/panels/application/application-legacy.ts +0 -3
  32. package/front_end/panels/application/application-meta.ts +0 -13
  33. package/front_end/panels/application/backForwardCacheView.css +44 -6
  34. package/front_end/panels/application/components/FrameDetailsView.ts +3 -3
  35. package/front_end/panels/application/components/OriginTrialTreeView.ts +3 -3
  36. package/front_end/panels/application/components/StackTrace.ts +1 -1
  37. package/front_end/panels/coverage/CoverageView.ts +1 -1
  38. package/front_end/panels/css_overview/components/cssOverviewStartView.css +1 -0
  39. package/front_end/panels/css_overview/cssOverviewCompletedView.css +1 -1
  40. package/front_end/panels/developer_resources/DeveloperResourcesView.ts +2 -1
  41. package/front_end/panels/elements/ElementsPanel.ts +9 -1
  42. package/front_end/panels/elements/ElementsTreeElement.ts +1 -1
  43. package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +1 -1
  44. package/front_end/panels/issues/CorsIssueDetailsView.ts +20 -8
  45. package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -0
  46. package/front_end/panels/profiler/CPUProfileFlameChart.ts +3 -1
  47. package/front_end/panels/profiler/ProfileDataGrid.ts +2 -1
  48. package/front_end/panels/settings/components/SyncSection.ts +2 -2
  49. package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +46 -46
  50. package/front_end/panels/timeline/TimelineTreeView.ts +2 -1
  51. package/front_end/ui/components/diff_view/DiffView.ts +4 -4
  52. package/front_end/ui/components/helpers/component-server-setup.ts +1 -12
  53. package/front_end/ui/components/helpers/helpers.ts +0 -2
  54. package/front_end/ui/components/icon_button/IconButton.ts +1 -1
  55. package/front_end/ui/components/issue_counter/IssueCounter.ts +2 -2
  56. package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +3 -3
  57. package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -4
  58. package/front_end/ui/components/panel_feedback/PreviewToggle.ts +98 -0
  59. package/front_end/ui/components/panel_feedback/panel_feedback.ts +1 -0
  60. package/front_end/ui/components/panel_feedback/previewToggle.css +24 -0
  61. package/front_end/ui/components/report_view/ReportView.ts +22 -0
  62. package/front_end/ui/components/report_view/reportSection.css +20 -0
  63. package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
  64. package/front_end/ui/components/settings/SettingCheckbox.ts +2 -2
  65. package/front_end/ui/components/text_editor/config.ts +4 -3
  66. package/front_end/ui/components/text_editor/javascript.ts +8 -4
  67. package/front_end/ui/components/text_prompt/TextPrompt.ts +2 -2
  68. package/front_end/ui/legacy/GlassPane.ts +1 -1
  69. package/front_end/ui/legacy/SearchableView.ts +2 -1
  70. package/front_end/ui/legacy/Treeoutline.ts +1 -1
  71. package/front_end/ui/legacy/Widget.ts +1 -1
  72. package/front_end/ui/legacy/XWidget.ts +0 -5
  73. package/front_end/ui/legacy/components/inline_editor/CSSVarSwatch.ts +2 -2
  74. package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +1 -1
  75. package/front_end/ui/legacy/utils/append-style.ts +2 -13
  76. package/front_end/ui/legacy/utils/create-shadow-root-with-core-styles.ts +7 -5
  77. package/package.json +2 -4
  78. package/scripts/build/build_inspector_overlay.py +15 -1
  79. package/scripts/build/rjsmin.py +84 -115
  80. package/scripts/eslint_rules/lib/lit_html_no_attribute_quotes.js +101 -0
  81. package/scripts/eslint_rules/lib/no_only_eslint_tests.js +53 -0
  82. package/scripts/eslint_rules/tests/.eslintrc.js +14 -0
  83. package/scripts/eslint_rules/tests/lit_html_no_attribute_quotes_test.js +45 -0
  84. package/scripts/eslint_rules/tests/no_only_eslint_tests_test.js +94 -0
  85. package/front_end/entrypoints/devtools_app/devtools_app.js +0 -11
  86. package/front_end/entrypoints/devtools_app/devtools_app.json +0 -4
  87. package/front_end/entrypoints/js_app/js_app.js +0 -12
  88. package/front_end/entrypoints/js_app/js_app.json +0 -3
  89. package/front_end/entrypoints/ndb_app/ndb_app.json +0 -4
  90. package/front_end/entrypoints/startup/RuntimeInstantiator.ts +0 -95
  91. package/front_end/entrypoints/startup/startup.ts +0 -9
  92. package/front_end/ui/components/helpers/get-stylesheet.ts +0 -45
  93. package/scripts/build/build_release_applications.py +0 -216
  94. package/scripts/build/modular_build.py +0 -184
  95. package/scripts/check_gn.js +0 -119
  96. package/scripts/json_validator/module.schema.json +0 -19
  97. package/scripts/json_validator/validate_module_json.js +0 -44
@@ -7,6 +7,7 @@ import * as LitHtml from '../../lit-html/lit-html.js';
7
7
 
8
8
  import reportStyles from './report.css.js';
9
9
  import reportKeyStyles from './reportKey.css.js';
10
+ import reportSectionStyles from './reportSection.css.js';
10
11
  import reportSectionDividerStyles from './reportSectionDivider.css.js';
11
12
  import reportSectionHeaderStyles from './reportSectionHeader.css.js';
12
13
  import reportValueStyles from './reportValue.css.js';
@@ -66,6 +67,25 @@ export interface ReportSectionData {
66
67
  sectionTitle: string;
67
68
  }
68
69
 
70
+ export class ReportSection extends HTMLElement {
71
+ static readonly litTagName = LitHtml.literal`devtools-report-section`;
72
+ private readonly shadow = this.attachShadow({mode: 'open'});
73
+ connectedCallback(): void {
74
+ this.shadow.adoptedStyleSheets = [reportSectionStyles];
75
+ this.render();
76
+ }
77
+ private render(): void {
78
+ // Disabled until https://crbug.com/1079231 is fixed.
79
+ // clang-format off
80
+ LitHtml.render(LitHtml.html`
81
+ <div class="section">
82
+ <slot></slot>
83
+ </div>
84
+ `, this.shadow, {host: this});
85
+ // clang-format on
86
+ }
87
+ }
88
+
69
89
  export class ReportSectionHeader extends HTMLElement {
70
90
  static readonly litTagName = LitHtml.literal`devtools-report-section-header`;
71
91
 
@@ -146,6 +166,7 @@ export class ReportValue extends HTMLElement {
146
166
  }
147
167
 
148
168
  ComponentHelpers.CustomElements.defineComponent('devtools-report', Report);
169
+ ComponentHelpers.CustomElements.defineComponent('devtools-report-section', ReportSection);
149
170
  ComponentHelpers.CustomElements.defineComponent('devtools-report-section-header', ReportSectionHeader);
150
171
  ComponentHelpers.CustomElements.defineComponent('devtools-report-key', ReportKey);
151
172
  ComponentHelpers.CustomElements.defineComponent('devtools-report-value', ReportValue);
@@ -155,6 +176,7 @@ declare global {
155
176
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
156
177
  interface HTMLElementTagNameMap {
157
178
  'devtools-report': Report;
179
+ 'devtools-report-section': ReportSection;
158
180
  'devtools-report-section-header': ReportSectionHeader;
159
181
  'devtools-report-key': ReportKey;
160
182
  'devtools-report-value': ReportValue;
@@ -0,0 +1,20 @@
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
+ :host {
8
+ grid-column-start: span 2;
9
+ }
10
+
11
+ .section {
12
+ padding: 12px;
13
+ margin-left: 18px;
14
+ display: flex;
15
+ flex-direction: row;
16
+ align-items: center;
17
+ flex: auto;
18
+ overflow-wrap: break-word;
19
+ overflow: hidden;
20
+ }
@@ -179,7 +179,7 @@ export class RequestLinkIcon extends HTMLElement {
179
179
  return LitHtml.nothing;
180
180
  }
181
181
  const filename = extractShortPath(url);
182
- return LitHtml.html`<span aria-label="${i18nString(UIStrings.shortenedURL)}" title="${url}">${filename}</span>`;
182
+ return LitHtml.html`<span aria-label=${i18nString(UIStrings.shortenedURL)} title=${url}>${filename}</span>`;
183
183
  }
184
184
 
185
185
  private render(): Promise<void> {
@@ -55,8 +55,8 @@ export class SettingCheckbox extends HTMLElement {
55
55
  LitHtml.html`
56
56
  <p>
57
57
  <label>
58
- <input type="checkbox" ?checked=${this.#setting.get()} ?disabled=${this.#disabled} @change="${
59
- this.checkboxChanged}" aria-label="${this.#setting.title()}" /> ${this.#setting.title()}
58
+ <input type="checkbox" ?checked=${this.#setting.get()} ?disabled=${this.#disabled} @change=${
59
+ this.checkboxChanged} aria-label=${this.#setting.title()} /> ${this.#setting.title()}
60
60
  </label>
61
61
  </p>`,
62
62
  this.#shadow, {host: this});
@@ -325,11 +325,12 @@ export const showCompletionHint = CM.ViewPlugin.fromClass(class {
325
325
  if (pos !== lineBefore.to) {
326
326
  return null;
327
327
  }
328
- const wordBefore = /#?[\w$]+$/.exec(lineBefore.text);
329
- if (wordBefore && !label.startsWith(wordBefore[0])) {
328
+ const partBefore = (label[0] === '\'' ? /'(\\.|[^'\\])*$/ : label[0] === '"' ? /"(\\.|[^"\\])*$/ : /#?[\w$]+$/)
329
+ .exec(lineBefore.text);
330
+ if (partBefore && !label.startsWith(partBefore[0])) {
330
331
  return null;
331
332
  }
332
- return label.slice(wordBefore ? wordBefore[0].length : 0);
333
+ return label.slice(partBefore ? partBefore[0].length : 0);
333
334
  }
334
335
  }, {decorations: p => p.decorations});
335
336
 
@@ -159,6 +159,7 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
159
159
  }
160
160
 
161
161
  let result: CompletionSet;
162
+ let quote: string|undefined = undefined;
162
163
  if (query.type === QueryType.Expression) {
163
164
  const [scope, global] = await Promise.all([
164
165
  completeExpressionInScope(),
@@ -174,7 +175,6 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
174
175
  }
175
176
  } else if (query.type === QueryType.PropertyName || query.type === QueryType.PropertyExpression) {
176
177
  const objectExpr = (query.relatedNode as CodeMirror.SyntaxNode).getChild('Expression');
177
- let quote = undefined;
178
178
  if (query.type === QueryType.PropertyExpression) {
179
179
  quote = query.from === undefined ? '\'' : cx.state.sliceDoc(query.from, query.from + 1);
180
180
  }
@@ -189,10 +189,13 @@ export async function javascriptCompletionSource(cx: CodeMirror.CompletionContex
189
189
  return {
190
190
  from: query.from ?? cx.pos,
191
191
  options: result.completions,
192
- span: /^#?[\w\P{ASCII}]*/u,
192
+ span: !quote ? SPAN_IDENT : quote === '\'' ? SPAN_SINGLE_QUOTE : SPAN_DOUBLE_QUOTE,
193
193
  };
194
194
  }
195
195
 
196
+ const SPAN_IDENT = /^#?[\w\P{ASCII}]*$/u, SPAN_SINGLE_QUOTE = /^\'(\\.|[^\\'\n])*'?$/,
197
+ SPAN_DOUBLE_QUOTE = /^"(\\.|[^\\"\n])*"?$/;
198
+
196
199
  function getExecutionContext(): SDK.RuntimeModel.ExecutionContext|null {
197
200
  return UI.Context.Context.instance().flavor(SDK.RuntimeModel.ExecutionContext);
198
201
  }
@@ -330,8 +333,9 @@ async function completePropertiesInner(
330
333
  const isFunction = object.type === 'function';
331
334
  for (const prop of properties.properties || []) {
332
335
  if (!prop.symbol && !(isFunction && (prop.name === 'arguments' || prop.name === 'caller')) &&
333
- (!prop.private || expression === 'this')) {
334
- const label = quoted ? quoted + prop.name + quoted : prop.name;
336
+ (!prop.private || expression === 'this') && (quoted || SPAN_IDENT.test(prop.name))) {
337
+ const label =
338
+ quoted ? quoted + prop.name.replaceAll('\\', '\\\\').replaceAll(quoted, '\\' + quoted) + quoted : prop.name;
335
339
  const completion: CodeMirror.Completion = {
336
340
  label,
337
341
  type: prop.value?.type === 'function' ? functionType : otherType,
@@ -127,8 +127,8 @@ export class TextPrompt extends HTMLElement {
127
127
  const output = LitHtml.html`
128
128
  <span class="prefix">${this.#prefixText} </span>
129
129
  <span class="text-prompt-input"><input aria-label=${this.#ariaLabelText} spellcheck="false" @input=${
130
- this.onInput} @keydown=${this.onKeyDown}/><span class='suggestion' suggestion="${
131
- this.#suggestionText}"></span></span>`;
130
+ this.onInput} @keydown=${this.onKeyDown}/><span class='suggestion' suggestion=${
131
+ this.#suggestionText}></span></span>`;
132
132
  LitHtml.render(output, this.#shadow, {host: this});
133
133
  }
134
134
  }
@@ -55,7 +55,7 @@ export class GlassPane {
55
55
  return this.widgetInternal.isShowing();
56
56
  }
57
57
 
58
- registerRequiredCSS(cssFile: string|{cssContent: string}): void {
58
+ registerRequiredCSS(cssFile: {cssContent: string}): void {
59
59
  // eslint-disable-next-line no-restricted-syntax -- Should import styles https://crbug.com/1106746
60
60
  this.widgetInternal.registerRequiredCSS(cssFile);
61
61
  }
@@ -35,6 +35,7 @@
35
35
 
36
36
  import * as Common from '../../core/common/common.js';
37
37
  import * as i18n from '../../core/i18n/i18n.js';
38
+ import * as Platform from '../../core/platform/platform.js';
38
39
 
39
40
  import * as ARIAUtils from './ARIAUtils.js';
40
41
  import {HistoryInput} from './HistoryInput.js';
@@ -629,7 +630,7 @@ export class SearchConfig {
629
630
 
630
631
  // Otherwise just do a plain text search.
631
632
  if (!regex) {
632
- regex = createPlainTextSearchRegex(query, modifiers);
633
+ regex = Platform.StringUtilities.createPlainTextSearchRegex(query, modifiers);
633
634
  }
634
635
 
635
636
  return regex;
@@ -399,7 +399,7 @@ export class TreeOutlineInShadow extends TreeOutline {
399
399
  this.renderSelection = true;
400
400
  }
401
401
 
402
- registerRequiredCSS(cssFile: string|{cssContent: string}): void {
402
+ registerRequiredCSS(cssFile: {cssContent: string}): void {
403
403
  Utils.appendStyle(this.shadowRoot, cssFile);
404
404
  }
405
405
 
@@ -458,7 +458,7 @@ export class Widget {
458
458
  this.doResize();
459
459
  }
460
460
 
461
- registerRequiredCSS(cssFile: string|{cssContent: string}): void {
461
+ registerRequiredCSS(cssFile: {cssContent: string}): void {
462
462
  if (this.isWebComponent) {
463
463
  Utils.appendStyle((this.shadowRoot as DocumentFragment), cssFile);
464
464
  } else {
@@ -3,7 +3,6 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as ComponentHelpers from '../components/helpers/helpers.js';
6
- import * as Utils from './utils/utils.js';
7
6
 
8
7
  import {XElement} from './XElement.js';
9
8
 
@@ -55,10 +54,6 @@ export class XWidget extends XElement {
55
54
  return this.visible;
56
55
  }
57
56
 
58
- registerRequiredCSS(cssFile: string): void {
59
- Utils.appendStyle(this.shadowRootInternal || this, cssFile);
60
- }
61
-
62
57
  setOnShown(callback: (() => void)|null): void {
63
58
  this.onShownCallback = callback;
64
59
  }
@@ -113,7 +113,7 @@ export class CSSVarSwatch extends HTMLElement {
113
113
  // The this.variableName's space must be removed, otherwise it cannot be triggered when clicked.
114
114
  const onActivate = isDefined ? this.onLinkActivate.bind(this, this.variableName.trim()) : null;
115
115
 
116
- return html`<span class="${classes}" title="${title}" @mousedown=${onActivate} @keydown=${
116
+ return html`<span class=${classes} title=${title} @mousedown=${onActivate} @keydown=${
117
117
  onActivate} role="link" tabindex="-1">${variableName}</span>`;
118
118
  }
119
119
 
@@ -129,7 +129,7 @@ export class CSSVarSwatch extends HTMLElement {
129
129
  // Disabled until https://crbug.com/1079231 is fixed.
130
130
  // clang-format off
131
131
  render(
132
- html`<span title="${this.computedValue || ''}">${functionParts.pre}${link}${functionParts.post}</span>`,
132
+ html`<span title=${this.computedValue || ''}>${functionParts.pre}${link}${functionParts.post}</span>`,
133
133
  this.shadow, { host: this });
134
134
  // clang-format on
135
135
  }
@@ -118,7 +118,7 @@ export class ColorSwatch extends HTMLElement {
118
118
  // Note also that whitespace between nodes is removed on purpose to avoid pushing these elements apart. Do not
119
119
  // re-format the HTML code.
120
120
  LitHtml.render(
121
- LitHtml.html`<span class="color-swatch" title="${this.tooltip}"><span class="color-swatch-inner"
121
+ LitHtml.html`<span class="color-swatch" title=${this.tooltip}><span class="color-swatch-inner"
122
122
  style="background-color: ${this.text};"
123
123
  @click=${this.onClick}
124
124
  @mousedown=${this.consume}
@@ -2,19 +2,8 @@
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
4
 
5
- import * as Root from '../../../core/root/root.js';
6
-
7
- export function appendStyle(node: Node, cssReference: string|{cssContent: string}): void {
8
- let content: string;
9
- if (typeof cssReference === 'string') {
10
- content = Root.Runtime.cachedResources.get(cssReference) || '';
11
- if (!content) {
12
- console.error(cssReference + ' not preloaded. Check module.json');
13
- }
14
- } else {
15
- content = cssReference.cssContent;
16
- }
5
+ export function appendStyle(node: Node, {cssContent}: {cssContent: string}): void {
17
6
  const styleElement = document.createElement('style');
18
- styleElement.textContent = content;
7
+ styleElement.textContent = cssContent;
19
8
  node.appendChild(styleElement);
20
9
  }
@@ -7,7 +7,7 @@ import {focusChanged} from './focus-changed.js';
7
7
  import {injectCoreStyles} from './inject-core-styles.js';
8
8
 
9
9
  interface Options {
10
- cssFile?: string|CSSStyleSheet[]|{cssContent: string};
10
+ cssFile?: CSSStyleSheet[]|{cssContent: string};
11
11
  delegatesFocus?: boolean;
12
12
  }
13
13
 
@@ -22,10 +22,12 @@ export function createShadowRootWithCoreStyles(element: Element, options: Option
22
22
 
23
23
  const shadowRoot = element.attachShadow({mode: 'open', delegatesFocus});
24
24
  injectCoreStyles(shadowRoot);
25
- if (typeof cssFile === 'string' || (cssFile !== undefined && 'cssContent' in cssFile)) {
26
- appendStyle(shadowRoot, cssFile);
27
- } else if (cssFile) {
28
- shadowRoot.adoptedStyleSheets = cssFile;
25
+ if (cssFile) {
26
+ if ('cssContent' in cssFile) {
27
+ appendStyle(shadowRoot, cssFile);
28
+ } else {
29
+ shadowRoot.adoptedStyleSheets = cssFile;
30
+ }
29
31
  }
30
32
  shadowRoot.addEventListener('focus', focusChanged, true);
31
33
  return shadowRoot;
package/package.json CHANGED
@@ -27,10 +27,8 @@
27
27
  "auto-unittest": "scripts/test/run_auto_unittests.py --no-text-coverage",
28
28
  "build": "autoninja -C out/Default",
29
29
  "build-release": "autoninja -C out/Release",
30
- "check": "npm run check-json && npm run check-gn && npm run check-lint && npm run check-loc",
30
+ "check": "npm run check-lint && npm run check-loc",
31
31
  "check-external-links": "third_party/node/node.py --output scripts/check_external_links.js",
32
- "check-gn": "third_party/node/node.py --output scripts/check_gn.js",
33
- "check-json": "third_party/node/node.py --output scripts/json_validator/validate_module_json.js",
34
32
  "check-lint": "third_party/node/node.py --output scripts/test/run_lint_check_js.mjs && third_party/node/node.py --output scripts/test/run_lint_check_css.js",
35
33
  "check-lint-css": "third_party/node/node.py --output scripts/test/run_lint_check_css.js",
36
34
  "collect-strings": "third_party/node/node.py --output third_party/i18n/collect-strings.js front_end",
@@ -55,5 +53,5 @@
55
53
  "unittest": "scripts/test/run_unittests.py --no-text-coverage",
56
54
  "watch": "third_party/node/node.py --output scripts/watch_build.js"
57
55
  },
58
- "version": "1.0.947377"
56
+ "version": "1.0.948295"
59
57
  }
@@ -12,7 +12,6 @@ Builds inspector overlay:
12
12
 
13
13
  from os import path
14
14
  from os.path import join
15
- from modular_build import read_file, write_file
16
15
  from itertools import tee
17
16
 
18
17
  import os
@@ -29,6 +28,21 @@ finally:
29
28
  sys.path = original_sys_path
30
29
 
31
30
 
31
+ def read_file(filename):
32
+ with open(path.normpath(filename), 'rt', encoding='utf-8') as input:
33
+ return input.read()
34
+
35
+
36
+ def write_file(filename, content):
37
+ if path.exists(filename):
38
+ os.remove(filename)
39
+ directory = path.dirname(filename)
40
+ if not path.exists(directory):
41
+ os.makedirs(directory)
42
+ with open(filename, 'wt', encoding='utf-8') as output:
43
+ output.write(content)
44
+
45
+
32
46
  def check_size(filename, data, max_size):
33
47
  assert len(
34
48
  data