项目文件夹

文件
dependabot[bot] 12eb494466 chore(deps-dev): bump chrome-devtools-frontend from 1.0.1524741 to 1.0.1531367 in the chrome-devtools-frontend group (#429)
Bumps the chrome-devtools-frontend group with 1 update:
[chrome-devtools-frontend](https://github.com/ChromeDevTools/devtools-frontend).

Updates `chrome-devtools-frontend` from 1.0.1524741 to 1.0.1531367
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/6f4312a899ff0af345ba1a51ba719d0c0a1bf5d2"><code>6f4312a</code></a>
Update DevTools DEPS (trusted)</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/03ffc0b5fc5f07fdde976d2ad47670138bf5cca7"><code>03ffc0b</code></a>
Update Chrome (for Testing) PIN</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/a717fef99f53ea02dbc91867206546800ae52f69"><code>a717fef</code></a>
[RPP] Actually hide Workspaces in trace app</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/9ac40d2b0c7d7cf9d6493905df1a72dd4b90803b"><code>9ac40d2</code></a>
Increase performance tests timeout</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/ca1486a6501f6926009969c0c1aa3a577ec93210"><code>ca1486a</code></a>
Create throttling/blocking conditions from the context menu</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/19213823907008766d5759b8b25feca602ea93fa"><code>1921382</code></a>
[Console Insights Teasers] Add error state</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/2678dc3548a7fbb9aa80455ffa0dc13fd0714e86"><code>2678dc3</code></a>
Update DevTools DEPS (trusted)</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/db045b91de4fa65c651bda1968ad882f78160a26"><code>db045b9</code></a>
[Console Insights Teasers] Handle slowness</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/a95ceaf384f7917fe9e3a2aac3d10000a8f14fc6"><code>a95ceaf</code></a>
Fix console sidebar filter selection</li>
<li><a
href="https://github.com/ChromeDevTools/devtools-frontend/commit/a32c47b13d74ba38f478f3369d57bf9647a458b1"><code>a32c47b</code></a>
Support individual request throttling in the request blocking panel</li>
<li>Additional commits viewable in <a
href="https://github.com/ChromeDevTools/devtools-frontend/compare/v1.0.1524741...v1.0.1531367">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by [GitHub Actions](<a
href="https://www.npmjs.com/~GitHub">https://www.npmjs.com/~GitHub</a>
Actions), a new releaser for chrome-devtools-frontend since your current
version.</p>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=chrome-devtools-frontend&package-manager=npm_and_yarn&previous-version=1.0.1524741&new-version=1.0.1531367)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Rudenko <alexrudenko@chromium.org>
2025-10-22 13:02:29 +02:00

175 行
5.0 KiB
TypeScript

/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as fs from 'node:fs';
import * as path from 'node:path';
import tsConfig from '../tsconfig.json' with {type: 'json'};
import {sed} from './sed.ts';
const BUILD_DIR = path.join(process.cwd(), 'build');
/**
* Writes content to a file.
* @param filePath The path to the file.
* @param content The content to write.
*/
function writeFile(filePath: string, content: string): void {
fs.writeFileSync(filePath, content, 'utf-8');
}
/**
* Ensures that licenses for third party files we use gets copied into the build/ dir.
*/
function copyThirdPartyLicenseFiles() {
const thirdPartyDirectories = tsConfig.include.filter(location => {
return location.includes(
'node_modules/chrome-devtools-frontend/front_end/third_party',
);
});
for (const thirdPartyDir of thirdPartyDirectories) {
const fullPath = path.join(process.cwd(), thirdPartyDir);
const licenseFile = path.join(fullPath, 'LICENSE');
if (!fs.existsSync(licenseFile)) {
console.error('No LICENSE for', path.basename(thirdPartyDir));
}
const destinationDir = path.join(BUILD_DIR, thirdPartyDir);
const destinationFile = path.join(destinationDir, 'LICENSE');
fs.copyFileSync(licenseFile, destinationFile);
}
}
function main(): void {
const devtoolsThirdPartyPath =
'node_modules/chrome-devtools-frontend/front_end/third_party';
const devtoolsFrontEndCorePath =
'node_modules/chrome-devtools-frontend/front_end/core';
// Create i18n mock
const i18nDir = path.join(BUILD_DIR, devtoolsFrontEndCorePath, 'i18n');
fs.mkdirSync(i18nDir, {recursive: true});
const i18nFile = path.join(i18nDir, 'i18n.js');
const i18nContent = `
export const i18n = {
registerUIStrings: () => {},
getLocalizedString: (_, str) => {
// So that the string passed in gets output verbatim.
return str;
},
lockedLazyString: () => {},
getLazilyComputedLocalizedString: () => {},
};
// TODO(jacktfranklin): once the DocumentLatency insight does not depend on
// this method, we can remove this stub.
export const TimeUtilities = {
millisToString(x) {
const separator = '\xA0';
const formatter = new Intl.NumberFormat('en-US', {
style: 'unit',
unitDisplay: 'narrow',
minimumFractionDigits: 0,
maximumFractionDigits: 1,
unit: 'millisecond',
});
const parts = formatter.formatToParts(x);
for (const part of parts) {
if (part.type === 'literal') {
if (part.value === ' ') {
part.value = separator;
}
}
}
return parts.map(part => part.value).join('');
}
};
// TODO(jacktfranklin): once the ImageDelivery insight does not depend on this method, we can remove this stub.
export const ByteUtilities = {
bytesToString(x) {
const separator = '\xA0';
const formatter = new Intl.NumberFormat('en-US', {
style: 'unit',
unit: 'kilobyte',
unitDisplay: 'narrow',
minimumFractionDigits: 1,
maximumFractionDigits: 1,
});
const parts = formatter.formatToParts(x / 1000);
for (const part of parts) {
if (part.type === 'literal') {
if (part.value === ' ') {
part.value = separator;
}
}
}
return parts.map(part => part.value).join('');
}
};`;
writeFile(i18nFile, i18nContent);
// Create codemirror.next mock.
const codeMirrorDir = path.join(
BUILD_DIR,
devtoolsThirdPartyPath,
'codemirror.next',
);
fs.mkdirSync(codeMirrorDir, {recursive: true});
const codeMirrorFile = path.join(codeMirrorDir, 'codemirror.next.js');
const codeMirrorContent = `export default {}`;
writeFile(codeMirrorFile, codeMirrorContent);
// Create root mock
const rootDir = path.join(BUILD_DIR, devtoolsFrontEndCorePath, 'root');
fs.mkdirSync(rootDir, {recursive: true});
const runtimeFile = path.join(rootDir, 'Runtime.js');
const runtimeContent = `
export function getChromeVersion() { return ''; };
export const hostConfig = {};
`;
writeFile(runtimeFile, runtimeContent);
// Update protocol_client to remove:
// 1. self.Protocol assignment
// 2. Call to register backend commands.
const protocolClientDir = path.join(
BUILD_DIR,
devtoolsFrontEndCorePath,
'protocol_client',
);
const clientFile = path.join(protocolClientDir, 'protocol_client.js');
const globalAssignment = /self\.Protocol = self\.Protocol \|\| \{\};/;
const registerCommands =
/InspectorBackendCommands\.registerCommands\(InspectorBackend\.inspectorBackend\);/;
sed(clientFile, globalAssignment, '');
sed(clientFile, registerCommands, '');
const devtoolsLicensePath = path.join(
'node_modules',
'chrome-devtools-frontend',
'LICENSE',
);
const devtoolsLicenseFileSource = path.join(
process.cwd(),
devtoolsLicensePath,
);
const devtoolsLicenseFileDestination = path.join(
BUILD_DIR,
devtoolsLicensePath,
);
fs.copyFileSync(devtoolsLicenseFileSource, devtoolsLicenseFileDestination);
copyThirdPartyLicenseFiles();
}
main();