Skip to content

Commit d190af6

Browse files
committed
fix: edit examples
1 parent 0cfaef9 commit d190af6

2 files changed

Lines changed: 109 additions & 1 deletion

File tree

packages/plugin-bundle-stats/code-pushup.large-angular.config.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,34 @@ Detects *newly added packages*, catches **forbidden dependencies**, monitors **3
704704
},
705705
};
706706

707+
const blacklistedFilesAudit: BundleStatsAuditOptions = {
708+
slug: 'blacklisted',
709+
title: '🚫 Blacklisted Files',
710+
description: `
711+
Monitors **blacklisted dependencies** and **deprecated packages** that are present in the bundle. This helps identify potential security risks and compliance issues.`,
712+
selection: {
713+
mode: 'matchingOnly',
714+
includeInputs: [
715+
'**/node_modules/angular2-toaster/**',
716+
'**/node_modules/ngx-float-ui/**',
717+
'**/node_modules/@angular-slider/ngx-slider/**',
718+
'**/node_modules/ngx-slider-v2/**',
719+
'**/node_modules/ngx-toastr/**',
720+
'**/node_modules/@angular/material/dialog/**',
721+
'**/node_modules/@angular/material/slider/**',
722+
'**/node_modules/@angular/material/bottom-sheet/**',
723+
],
724+
},
725+
insightsTable: {
726+
mode: 'onlyMatching',
727+
groups: blacklistedFilesGroups,
728+
},
729+
dependencyTree: {
730+
mode: 'onlyMatching',
731+
groups: blacklistedFilesGroups,
732+
},
733+
};
734+
707735
const config = {
708736
plugins: [
709737
await bundleStatsPlugin({
@@ -712,6 +740,7 @@ const config = {
712740
'./packages/plugin-bundle-stats/mocks/fixtures/stats/angular-large.stats.json',
713741
audits: [
714742
allFilesAudit,
743+
blacklistedFilesAudit,
715744
angularSpecificAudit,
716745
dependencyAudit,
717746
initialBundleSizeAudit,

packages/plugin-bundle-stats/code-pushup.minimal-esbuild.config.ts

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { CoreConfig } from '../models/src/index.js';
12
import bundleStatsPlugin from './src';
23
import { MinMax } from './src/lib/runner/types';
34
import { BundleStatsAuditOptions } from './src/lib/types';
@@ -749,7 +750,7 @@ const TREE_AUDITS: BundleStatsAuditOptions[] = [
749750
},
750751
];
751752

752-
const config = {
753+
const config: CoreConfig = {
753754
plugins: [
754755
await bundleStatsPlugin({
755756
artifactsPaths:
@@ -762,8 +763,86 @@ const config = {
762763
...INSIGHT_AUDITS,
763764
...TREE_AUDITS,
764765
],
766+
groups: [
767+
{
768+
slug: 'selection-group',
769+
title: '🎯 Selection',
770+
description:
771+
'Demonstrates different selection modes and pattern matching for bundle analysis.',
772+
refs: SELECTION_AUDITS.filter(audit => audit.slug).map(audit => ({
773+
slug: audit.slug!,
774+
weight: 1,
775+
})),
776+
},
777+
{
778+
slug: 'scoring-group',
779+
title: '📏 Scoring',
780+
description:
781+
'Shows scoring mechanisms including thresholds, penalties, and size constraints.',
782+
refs: [...SCORING_AUDITS, ...SCORING_PENALTY_AUDITS]
783+
.filter(audit => audit.slug)
784+
.map(audit => ({
785+
slug: audit.slug!,
786+
weight: 1,
787+
})),
788+
},
789+
{
790+
slug: 'insights-group',
791+
title: '📊 Insights Table',
792+
description:
793+
'Configures insights tables with grouping, pruning, and visualization options.',
794+
refs: INSIGHT_AUDITS.filter(audit => audit.slug).map(audit => ({
795+
slug: audit.slug!,
796+
weight: 1,
797+
})),
798+
},
799+
{
800+
slug: 'tree-group',
801+
title: '🌳 Dependency Tree',
802+
description:
803+
'Demonstrates dependency tree configurations with grouping and pruning strategies.',
804+
refs: TREE_AUDITS.filter(audit => audit.slug).map(audit => ({
805+
slug: audit.slug!,
806+
weight: 1,
807+
})),
808+
},
809+
],
765810
}),
766811
],
812+
categories: [
813+
{
814+
slug: 'performance',
815+
title: '⚡ Performance',
816+
description:
817+
'Comprehensive bundle performance analysis including selection, scoring, insights, and dependency trees.',
818+
refs: [
819+
{
820+
type: 'group' as const,
821+
plugin: 'bundle-stats',
822+
slug: 'selection-group',
823+
weight: 1,
824+
},
825+
{
826+
type: 'group' as const,
827+
plugin: 'bundle-stats',
828+
slug: 'scoring-group',
829+
weight: 2,
830+
},
831+
{
832+
type: 'group' as const,
833+
plugin: 'bundle-stats',
834+
slug: 'insights-group',
835+
weight: 1,
836+
},
837+
{
838+
type: 'group' as const,
839+
plugin: 'bundle-stats',
840+
slug: 'tree-group',
841+
weight: 1,
842+
},
843+
],
844+
},
845+
],
767846
};
768847

769848
export default (async () => {

0 commit comments

Comments
 (0)