Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24415,7 +24415,9 @@ async function run() {
core4.info(`Dependency count increase: ${depIncrease}`);
if (depIncrease >= dependencyThreshold) {
messages.push(
`\u26A0\uFE0F **Dependency Count Warning**: This PR adds ${depIncrease} new dependencies (${baseDepCount} \u2192 ${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
`## \u26A0\uFE0F Dependency Count

This PR adds ${depIncrease} new dependencies (${baseDepCount} \u2192 ${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
);
}
const duplicateWarnings = [];
Expand All @@ -24433,7 +24435,7 @@ async function run() {

\u{1F4A1} To find out what depends on a specific package, run: \`${exampleCommand}\`` : "";
messages.push(
`\u26A0\uFE0F **Duplicate Dependencies Warning** (threshold: ${duplicateThreshold}):
`## \u26A0\uFE0F Duplicate Dependencies (threshold: ${duplicateThreshold})

${duplicateWarnings.join("\n")}${helpMessage}`
);
Expand All @@ -24458,7 +24460,9 @@ ${duplicateWarnings.join("\n")}${helpMessage}`
if (sizeData !== null && sizeData.totalSize >= sizeThreshold) {
const packageRows = Array.from(sizeData.packageSizes.entries()).sort(([, a], [, b]) => b - a).map(([pkg, size]) => `| ${pkg} | ${formatBytes(size)} |`).join("\n");
messages.push(
`\u26A0\uFE0F **Large Dependency Size Increase**: This PR adds ${formatBytes(sizeData.totalSize)} of new dependencies, which exceeds the threshold of ${formatBytes(sizeThreshold)}.
`## \u26A0\uFE0F Large Dependency Size Increase

This PR adds ${formatBytes(sizeData.totalSize)} of new dependencies, which exceeds the threshold of ${formatBytes(sizeThreshold)}.

| Package | Size |
|---------|------|
Expand Down Expand Up @@ -24498,7 +24502,9 @@ ${packageRows}`
return `| ${change.name} | ${baseSize} | ${sourceSize} | ${sizeChange} |`;
}).join("\n");
messages.push(
`\u26A0\uFE0F **Package Size Increase Warning**: These packages exceed the size increase threshold of ${formatBytes(packSizeThreshold)}:
`## \u26A0\uFE0F Package Size Increase

These packages exceed the size increase threshold of ${formatBytes(packSizeThreshold)}:

| Package | Base Size | Source Size | Size Change |
|---------|-----------|-------------|-------------|
Expand Down
22 changes: 18 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ async function run(): Promise<void> {

if (depIncrease >= dependencyThreshold) {
messages.push(
`⚠️ **Dependency Count Warning**: This PR adds ${depIncrease} new dependencies (${baseDepCount} → ${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
`## ⚠️ Dependency Count

This PR adds ${depIncrease} new dependencies (${baseDepCount} → ${currentDepCount}), which exceeds the threshold of ${dependencyThreshold}.`
);
}

Expand All @@ -141,7 +143,9 @@ async function run(): Promise<void> {
? `\n\n💡 To find out what depends on a specific package, run: \`${exampleCommand}\``
: '';
messages.push(
`⚠️ **Duplicate Dependencies Warning** (threshold: ${duplicateThreshold}):\n\n${duplicateWarnings.join('\n')}${helpMessage}`
`## ⚠️ Duplicate Dependencies (threshold: ${duplicateThreshold})

${duplicateWarnings.join('\n')}${helpMessage}`
);
}

Expand Down Expand Up @@ -179,7 +183,12 @@ async function run(): Promise<void> {
.join('\n');

messages.push(
`⚠️ **Large Dependency Size Increase**: This PR adds ${formatBytes(sizeData.totalSize)} of new dependencies, which exceeds the threshold of ${formatBytes(sizeThreshold)}.\n\n| Package | Size |\n|---------|------|\n${packageRows}`
`## ⚠️ Large Dependency Size Increase

This PR adds ${formatBytes(sizeData.totalSize)} of new dependencies, which exceeds the threshold of ${formatBytes(sizeThreshold)}.

| Package | Size |\n|---------|------|
${packageRows}`
);
}
} catch (err) {
Expand Down Expand Up @@ -229,7 +238,12 @@ async function run(): Promise<void> {
.join('\n');

messages.push(
`⚠️ **Package Size Increase Warning**: These packages exceed the size increase threshold of ${formatBytes(packSizeThreshold)}:\n\n| Package | Base Size | Source Size | Size Change |\n|---------|-----------|-------------|-------------|\n${packRows}`
`## ⚠️ Package Size Increase

These packages exceed the size increase threshold of ${formatBytes(packSizeThreshold)}:

| Package | Base Size | Source Size | Size Change |\n|---------|-----------|-------------|-------------|
${packRows}`
);
}
}
Expand Down