-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4465 from relative-ci/4463-view-chunk-modules-not…
…-working-as-expected 4463 view chunk modules not working as expected
- Loading branch information
Showing
12 changed files
with
145 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 2 additions & 17 deletions
19
packages/ui/src/components/bundle-modules/bundle-modules.types.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
import { Module } from '@bundle-stats/utils/lib-esm/webpack/types'; | ||
import { ReportMetricRun } from '@bundle-stats/utils/types/report/types'; | ||
|
||
export interface Chunk { | ||
id: string; | ||
name: string; | ||
} | ||
import type { Module } from '@bundle-stats/utils/lib-esm/webpack/types'; | ||
import type { ReportMetricRun } from '@bundle-stats/utils/types/report/types'; | ||
|
||
export type ReportMetricModuleRow = { | ||
thirdParty: boolean; | ||
duplicated: boolean; | ||
fileType: string; | ||
} & ReportMetricRun & | ||
Module; | ||
|
||
export interface Job { | ||
label: string; | ||
internalBuildNumber: number; | ||
meta?: { | ||
webpack?: { | ||
chunks?: Array<Chunk>; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import chunk from 'lodash/chunk'; | ||
|
||
import COLORS from '../chart-colors.json'; | ||
|
||
export function getColors(count = 2) { | ||
const chunks = chunk(COLORS, Math.round(COLORS.length / count)); | ||
|
||
return chunks.map((chunkColors, index) => { | ||
if (index === 0) { | ||
return chunkColors[0]; | ||
} | ||
|
||
if (index === chunks.length - 1) { | ||
return chunkColors[chunkColors.length - 1]; | ||
} | ||
|
||
return chunkColors[Math.floor(chunkColors.length / 2)]; | ||
}); | ||
} |
Oops, something went wrong.