Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix internal name #4

Merged
merged 1 commit into from
May 1, 2024
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
2 changes: 1 addition & 1 deletion __tests__/no-base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe("examples w/o base analysis", () => {
describe(`example ${example.name}`, () => {
const input: Options = {
analyzerDirectory: ".analyzer",
budgetPercentIncreaseRed: 20,
percentExtraAttention: 20,
includeExtensions: [".js", ".mjs", ".cjs"],
metafiles: ["out/meta.json"],
name: "test",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/with-base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("examples w/ base analysis", () => {

const input: Options = {
analyzerDirectory: ".analyzer",
budgetPercentIncreaseRed: 20,
percentExtraAttention: 20,
includeExtensions: [".js", ".mjs", ".cjs"],
metafiles,
name: "test",
Expand Down
10 changes: 5 additions & 5 deletions dist/index.mjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ This analysis was generated by [esbuild-bundle-analyzer](https://github.com/exoe
});

if (hasAnyChange) {
output += markdownTable(comparison, input.budgetPercentIncreaseRed);
output += markdownTable(comparison, input.percentExtraAttention);

if (input.showDetails) {
output += `\n<details>
<summary>Details</summary>
<p>Next to the size is how much the size has increased or decreased compared with the base branch of this PR.</p>
<ul>
<li>‼️: Size increased by ${input.budgetPercentIncreaseRed}% or more. Special attention should be given to this.</li>
<li>⚠️: Size increased in acceptable range (lower than ${input.budgetPercentIncreaseRed}%).</li>
<li>‼️: Size increased by ${input.percentExtraAttention}% or more. Special attention should be given to this.</li>
<li>⚠️: Size increased in acceptable range (lower than ${input.percentExtraAttention}%).</li>
<li>✅: No change or even downsized.</li>
<li>🗑️: The out file is deleted: not found in base branch.</li>
<li>🆕: The out file is newly found: will be added to base branch.</li>
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getOptions(): Options {
throw new Error("name is not specified");
}
return {
budgetPercentIncreaseRed: Number.parseInt(
percentExtraAttention: Number.parseInt(
getInput("percent_extra_attention") || "20",
10,
),
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ export interface Options {
metafiles: Array<string>;
includeExtensions: Array<string>;
analyzerDirectory: string;
budgetPercentIncreaseRed: number;
percentExtraAttention: number;
showDetails: boolean;
}