Skip to content

Commit

Permalink
fix(): fix size check by each brick
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed May 22, 2024
1 parent a7663be commit 6381f46
Showing 1 changed file with 28 additions and 17 deletions.
45 changes: 28 additions & 17 deletions packages/brick-container/serve/utils/sizeCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,18 @@ export function getSizeCheckStoryboards(brickPackages, sizeCheckFilter) {
{
brick: "ul",
children: brickPackages.flatMap((pkg) =>
pkg.bricks.concat(pkg.elements ?? []).map((brick) => ({
brick: "li",
properties: {
textContent: `${pkg.id.split("/")[1]}:${brick}`,
},
}))
pkg.bricks
.concat(pkg.elements ?? [])
.filter(
(brick) =>
!sizeCheckFilter || sizeCheckFilter(brick, pkg.id)
)
.map((brick) => ({
brick: "li",
properties: {
textContent: `${pkg.id.split("/")[1]}:${brick}`,
},
}))
),
},
{
Expand All @@ -38,17 +44,22 @@ export function getSizeCheckStoryboards(brickPackages, sizeCheckFilter) {
],
},
...brickPackages.flatMap((pkg) =>
pkg.bricks.concat(pkg.elements ?? []).map((brick) => ({
path: `\${APP.homepage}/${brick}`,
exact: true,
preLoadBricks: [brick],
bricks: [
{
brick: "p",
properties: { textContent: "This is size-check!" },
},
],
}))
pkg.bricks
.concat(pkg.elements ?? [])
.filter(
(brick) => !sizeCheckFilter || sizeCheckFilter(brick, pkg.id)
)
.map((brick) => ({
path: `\${APP.homepage}/${brick}`,
exact: true,
preLoadBricks: [brick],
bricks: [
{
brick: "p",
properties: { textContent: "This is size-check!" },
},
],
}))
),

// By each package
Expand Down

0 comments on commit 6381f46

Please sign in to comment.