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 <piotrpaulski@chromium.org>
This commit is contained in:
zyzyzyryxyandPiotr Paulski authored and GitHub committed 2025-11-24 12:38:30 +00:00
1 parent eea5b80165
commit 94752ffade
27 files changed
+27

No files matched your search

+1
View File
@@ -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';
+1
View File
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import {
AggregatedIssue,
Marked,
+1
View File
@@ -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';
+1
View File
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import type {TextSnapshot, TextSnapshotNode} from '../McpContext.js';
export function formatSnapshotNode(
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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.
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import http, {
type IncomingMessage,
type Server,
+1
View File
@@ -3,6 +3,7 @@
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import '../src/polyfill.js';
import path from 'node:path';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';
+1
View File
@@ -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';