Skip to content

Commit 94752ff

Browse files
zyzyzyryxyPiotr Paulski
andauthored
fix: prevent dropping license notices on some files when publishing (#604)
This PR prevents license notices being dropped when creating package for publication. This can happen when first import in the file is type-only import that gets removed during build. When there is no empty line between the license block comment and such import, the comment is treated as related to the import and gets removed alongside it. Adding an empty line between copyright notice and the import fixes the issue. Co-authored-by: Piotr Paulski <[email protected]>
1 parent eea5b80 commit 94752ff

27 files changed

+27
-0
lines changed

src/McpContext.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import fs from 'node:fs/promises';
78
import os from 'node:os';
89
import path from 'node:path';

src/McpResponse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import {
78
AggregatedIssue,
89
Marked,

src/WaitForHelper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import {logger} from './logger.js';
78
import type {Page, Protocol, CdpPage} from './third_party/index.js';
89

src/formatters/snapshotFormatter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import type {TextSnapshot, TextSnapshotNode} from '../McpContext.js';
78

89
export function formatSnapshotNode(

src/logger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import fs from 'node:fs';
78

89
import {debug} from './third_party/index.js';

src/third_party/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import 'core-js/modules/es.promise.with-resolvers.js';
78
import 'core-js/proposals/iterator-helpers.js';
89

src/utils/keyboard.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import type {KeyInput} from '../third_party/index.js';
78

89
// See the KeyInput type for the list of supported keys.

tests/DevtoolsUtils.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import assert from 'node:assert';
78
import {describe, it} from 'node:test';
89

tests/McpContext.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import assert from 'node:assert';
78
import {describe, it} from 'node:test';
89

tests/McpResponse.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright 2025 Google LLC
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6+
67
import assert from 'node:assert';
78
import {readFile, rm} from 'node:fs/promises';
89
import {tmpdir} from 'node:os';

0 commit comments

Comments
 (0)