Skip to content

Chrome DevTools for coding agents

fix: prevent dropping license notices on some files when publishing (#604)

zyzyzyryxy94752ffade84
diff --git a/src/McpContext.ts b/src/McpContext.ts
index 0bdf0663..22d54c94 100644
--- a/src/McpContext.ts
+++ b/src/McpContext.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import fs from 'node:fs/promises';
import os from 'node:os';
import path from 'node:path';
diff --git a/src/McpResponse.ts b/src/McpResponse.ts
index 8dc0cd07..0cf54925 100644
--- a/src/McpResponse.ts
+++ b/src/McpResponse.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import {
AggregatedIssue,
Marked,
diff --git a/src/WaitForHelper.ts b/src/WaitForHelper.ts
index 7a5edaf4..44dbdd3c 100644
--- a/src/WaitForHelper.ts
+++ b/src/WaitForHelper.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import {logger} from './logger.js';
import type {Page, Protocol, CdpPage} from './third_party/index.js';
diff --git a/src/formatters/snapshotFormatter.ts b/src/formatters/snapshotFormatter.ts
index 5018381e..15464dd2 100644
--- a/src/formatters/snapshotFormatter.ts
+++ b/src/formatters/snapshotFormatter.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import type {TextSnapshot, TextSnapshotNode} from '../McpContext.js';
export function formatSnapshotNode(
diff --git a/src/logger.ts b/src/logger.ts
index 072ece38..4c31f1ff 100644
--- a/src/logger.ts
+++ b/src/logger.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import fs from 'node:fs';
import {debug} from './third_party/index.js';
diff --git a/src/third_party/index.ts b/src/third_party/index.ts
index 6facde82..83194e38 100644
--- a/src/third_party/index.ts
+++ b/src/third_party/index.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import 'core-js/modules/es.promise.with-resolvers.js';
import 'core-js/proposals/iterator-helpers.js';
diff --git a/src/utils/keyboard.ts b/src/utils/keyboard.ts
index 55c56782..51b0a3f7 100644
--- a/src/utils/keyboard.ts
+++ b/src/utils/keyboard.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import type {KeyInput} from '../third_party/index.js';
// See the KeyInput type for the list of supported keys.
diff --git a/tests/DevtoolsUtils.test.ts b/tests/DevtoolsUtils.test.ts
index 2c130084..40ecf2c3 100644
--- a/tests/DevtoolsUtils.test.ts
+++ b/tests/DevtoolsUtils.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/McpContext.test.ts b/tests/McpContext.test.ts
index 63887a05..4b5de091 100644
--- a/tests/McpContext.test.ts
+++ b/tests/McpContext.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/McpResponse.test.ts b/tests/McpResponse.test.ts
index 4cf52252..2c9516bc 100644
--- a/tests/McpResponse.test.ts
+++ b/tests/McpResponse.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {readFile, rm} from 'node:fs/promises';
import {tmpdir} from 'node:os';
diff --git a/tests/PageCollector.test.ts b/tests/PageCollector.test.ts
index ef31d006..bcf17ff5 100644
--- a/tests/PageCollector.test.ts
+++ b/tests/PageCollector.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {afterEach, beforeEach, describe, it} from 'node:test';
diff --git a/tests/browser.test.ts b/tests/browser.test.ts
index 8066da5f..3c8e31ca 100644
--- a/tests/browser.test.ts
+++ b/tests/browser.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import os from 'node:os';
import path from 'node:path';
diff --git a/tests/cli.test.ts b/tests/cli.test.ts
index 19502e28..c5c8b088 100644
--- a/tests/cli.test.ts
+++ b/tests/cli.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/index.test.ts b/tests/index.test.ts
index 4bbe3ddd..f31d1a84 100644
--- a/tests/index.test.ts
+++ b/tests/index.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import fs from 'node:fs';
import {describe, it} from 'node:test';
diff --git a/tests/server.ts b/tests/server.ts
index a0c6e318..fb6fcd5b 100644
--- a/tests/server.ts
+++ b/tests/server.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import http, {
type IncomingMessage,
type Server,
diff --git a/tests/setup.ts b/tests/setup.ts
index ce4e1b21..f79b8735 100644
--- a/tests/setup.ts
+++ b/tests/setup.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import '../src/polyfill.js';
import path from 'node:path';
diff --git a/tests/tools/console.test.ts b/tests/tools/console.test.ts
index 73c6f092..c7f6a97d 100644
--- a/tests/tools/console.test.ts
+++ b/tests/tools/console.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {afterEach, before, beforeEach, describe, it} from 'node:test';
diff --git a/tests/tools/emulation.test.ts b/tests/tools/emulation.test.ts
index 568631cc..35b79ea6 100644
--- a/tests/tools/emulation.test.ts
+++ b/tests/tools/emulation.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/tools/input.test.ts b/tests/tools/input.test.ts
index b6f39622..230b8a5d 100644
--- a/tests/tools/input.test.ts
+++ b/tests/tools/input.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import fs from 'node:fs/promises';
import path from 'node:path';
diff --git a/tests/tools/network.test.ts b/tests/tools/network.test.ts
index 2a6a1680..740fb3a1 100644
--- a/tests/tools/network.test.ts
+++ b/tests/tools/network.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/tools/pages.test.ts b/tests/tools/pages.test.ts
index a4a76bcd..d116e352 100644
--- a/tests/tools/pages.test.ts
+++ b/tests/tools/pages.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/tools/performance.test.ts b/tests/tools/performance.test.ts
index 32425788..900a10c2 100644
--- a/tests/tools/performance.test.ts
+++ b/tests/tools/performance.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it, afterEach} from 'node:test';
diff --git a/tests/tools/screenshot.test.ts b/tests/tools/screenshot.test.ts
index ebf207e1..69e70fe1 100644
--- a/tests/tools/screenshot.test.ts
+++ b/tests/tools/screenshot.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {rm, stat, mkdir, chmod, writeFile} from 'node:fs/promises';
import {tmpdir} from 'node:os';
diff --git a/tests/tools/script.test.ts b/tests/tools/script.test.ts
index 981ca92e..b6d52507 100644
--- a/tests/tools/script.test.ts
+++ b/tests/tools/script.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/tools/snapshot.test.ts b/tests/tools/snapshot.test.ts
index 718ea998..9dc48d94 100644
--- a/tests/tools/snapshot.test.ts
+++ b/tests/tools/snapshot.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/trace-processing/parse.test.ts b/tests/trace-processing/parse.test.ts
index 79b4ecb5..d54ff24b 100644
--- a/tests/trace-processing/parse.test.ts
+++ b/tests/trace-processing/parse.test.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import assert from 'node:assert';
import {describe, it} from 'node:test';
diff --git a/tests/utils.ts b/tests/utils.ts
index a1f97b90..3a717381 100644
--- a/tests/utils.ts
+++ b/tests/utils.ts
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
+
import logger from 'debug';
import type {Browser} from 'puppeteer';
import puppeteer, {Locator} from 'puppeteer';