mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Making bundle viz links collapsable (#11542)
This commit is contained in:
parent
6f0e54aa26
commit
ff521fe210
@ -50,18 +50,11 @@ async function start() {
|
|||||||
const bundleName = fileName.split(fileType)[0];
|
const bundleName = fileName.split(fileType)[0];
|
||||||
const url = `${BUILD_LINK_BASE}${sourceMapRoot}${fileName}`;
|
const url = `${BUILD_LINK_BASE}${sourceMapRoot}${fileName}`;
|
||||||
let fileRoot = bundleName;
|
let fileRoot = bundleName;
|
||||||
let fileIndex;
|
let fileIndex = bundleName.match(/-[0-9]{1,}$/u)?.index;
|
||||||
|
|
||||||
if (bundleName.indexOf('-') > -1) {
|
if (fileIndex) {
|
||||||
const split = bundleName.split('-');
|
fileRoot = bundleName.slice(0, fileIndex);
|
||||||
// Handle bundles that have hyphens in their name
|
fileIndex = bundleName.slice(fileIndex + 1, bundleName.length);
|
||||||
if (split.length === 2 && !isNaN(parseInt(split[1], 10))) {
|
|
||||||
fileRoot = split[0];
|
|
||||||
fileIndex = split[1];
|
|
||||||
} else if (split.length === 3) {
|
|
||||||
fileRoot = [split[0], split[1]].join('-');
|
|
||||||
fileIndex = split[2];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const link = `<a href="${url}">${fileIndex || fileRoot}</a>`;
|
const link = `<a href="${url}">${fileIndex || fileRoot}</a>`;
|
||||||
@ -92,11 +85,14 @@ async function start() {
|
|||||||
|
|
||||||
const contentRows = [
|
const contentRows = [
|
||||||
`builds: ${buildLinks}`,
|
`builds: ${buildLinks}`,
|
||||||
`bundle viz: ${bundleMarkup}`,
|
|
||||||
`build viz: ${depVizLink}`,
|
`build viz: ${depVizLink}`,
|
||||||
`code coverage: ${coverageLink}`,
|
`code coverage: ${coverageLink}`,
|
||||||
`storybook: ${storybookLink}`,
|
`storybook: ${storybookLink}`,
|
||||||
`<a href="${allArtifactsUrl}">all artifacts</a>`,
|
`<a href="${allArtifactsUrl}">all artifacts</a>`,
|
||||||
|
`<details>
|
||||||
|
<summary>bundle viz:</summary>
|
||||||
|
${bundleMarkup}
|
||||||
|
</details>`,
|
||||||
];
|
];
|
||||||
const hiddenContent = `<ul>${contentRows
|
const hiddenContent = `<ul>${contentRows
|
||||||
.map((row) => `<li>${row}</li>`)
|
.map((row) => `<li>${row}</li>`)
|
||||||
|
Loading…
Reference in New Issue
Block a user