You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,10 @@ This repo is a TypeScript GitHub Action for comparing bundle sizes. The action r
8
8
9
9
Core behavior today:
10
10
11
-
- Accepts a `tarball-uri` baseline archive.
11
+
- Accepts an npm `package-name` baseline.
12
12
- Accepts newline-delimited `files` to compare.
13
13
- Resolves local files under `path`.
14
+
- Resolves npm release tarballs for the latest release plus up to 10 previous stable releases.
14
15
- Resolves tarball files relative to the archive root, stripping a single shared top-level directory such as `package/`.
15
16
- Measures gzip-compressed byte size.
16
17
- Writes a JSON comparison report.
@@ -24,6 +25,7 @@ Current modules:
24
25
25
26
-`src/action.ts`: orchestrates the GitHub Action run and action outputs.
26
27
-`src/config.ts`: reads and validates `@actions/core` inputs.
28
+
-`src/npm.ts`: resolves npm package metadata and release tarball baselines.
27
29
-`src/paths.ts`: normalizes configured paths and prevents path traversal.
28
30
-`src/tarball.ts`: downloads tarballs and extracts regular files from `.tar.gz` archives.
29
31
-`src/comparison.ts`: computes gzip sizes and per-file/totals deltas.
@@ -56,7 +58,7 @@ When asked to commit changes in this repository, use Conventional Commit message
56
58
- Runtime dependencies should stay small. Prefer Node built-ins when they are clear and maintainable.
57
59
- Do not assume the caller has installed dependencies at action runtime.
58
60
- Do not build the target project inside the action; workflows should build artifacts before invoking this action.
59
-
- Treat missing configured files as errors. A comparison report should only be produced from trustworthy inputs.
61
+
- Treat missing configured local files and latest-release baseline files as errors. Historical previous-release missing files may be reported as incomplete context.
60
62
61
63
## Tarball And Path Handling
62
64
@@ -103,13 +105,13 @@ This repo uses OpenSpec for scoped changes.
103
105
104
106
When implementing a spec-driven change, read proposal, design, specs, and tasks before editing. Mark tasks complete as they are implemented. If a change introduces or modifies requirements, sync the delta spec into `openspec/specs/` before archiving.
105
107
106
-
The current tarball gzip behavior is captured in `openspec/specs/tarball-gzip-comparison/spec.md`.
108
+
The current tarball gzip behavior is captured in `openspec/specs/tarball-gzip-comparison/spec.md`. Npm release baseline behavior is captured in `openspec/specs/npm-release-baselines/spec.md` after the corresponding change is archived.
107
109
108
110
## Workflow Lessons Learned
109
111
110
112
- Keep action code modular early. A single `index.ts` becomes difficult to review once config parsing, tarball handling, path safety, gzip measurement, reporting, and GitHub outputs are all mixed together.
111
113
- Preserve `path` as the local project root. New inputs should not overload it.
112
-
- Treat the tarball URI as an explicit baseline contract. Do not add package-manager shorthand such as `npm:axios@latest` unless a spec/proposal calls for registry resolution.
114
+
- Treat the npm package name as the release baseline contract. Do not add package-manager shorthand such as `npm:axios@latest` unless a spec/proposal calls for it.
113
115
- Build comparison files on PRs from already-built local artifacts. On GitHub pull requests, the checkout/build represents the merge result when using the default PR merge ref.
114
116
- Avoid target-size enforcement in the current capability. Reporting and enforcing are different product behaviors and should remain separate changes.
115
117
- Keep `dist/index.js` synchronized with `src/`; otherwise the committed action will not match the reviewed TypeScript.
Copy file name to clipboardExpand all lines: COLLABORATOR_GUIDE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ For issues and discussions:
57
57
- Keep unsupported feature requests open only when they fit the project direction.
58
58
- Close issues that are duplicates, out of scope, or cannot be reproduced after reasonable follow-up.
59
59
60
-
This action compares already-built files. If a report is wrong, first verify the configured `path`, `files`, `tarball-uri`, and `output-file` values before assuming comparison logic is faulty.
60
+
This action compares already-built files. If a report is wrong, first verify the configured `path`, `files`, `package-name`, and `output-file` values before assuming comparison logic is faulty.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Contributing
2
2
3
-
Thanks for helping improve `axios/bundle-size`. This repository contains a TypeScript GitHub Action that compares gzip bundle sizes against a tarball baseline.
3
+
Thanks for helping improve `axios/bundle-size`. This repository contains a TypeScript GitHub Action that compares gzip bundle sizes against npm release baselines.
4
4
5
5
Please follow the [Code of Conduct](./CODE_OF_CONDUCT.md) when participating in this project.
The latest npm release is the primary baseline for top-level `baseline`, `files`, `totals`, and action outputs. The `history` array includes the latest release plus up to 10 previous stable releases ordered by npm publish time. Previous releases that do not contain every configured file are marked as incomplete instead of failing the action.
185
+
149
186
Because this repository *is* the action, a workflow inside the same repo can reference it with `./` after preparing local files to compare:
The action downloads the configured tarball, reads regular file entries, strips a single shared top-level directory such as `package/`, and compares the configured paths against local files under `path`. It measures gzip-compressed bytes for each file and writes a JSON report. It does not enforce budgets or target sizes.
273
+
The action fetches npm registry metadata for `package-name`, resolves the `latest` dist-tag plus up to 10 previous stable releases, downloads each selected release tarball, reads regular file entries, strips a single shared top-level directory such as `package/`, and compares the configured paths against local files under `path`. It measures gzip-compressed bytes for each file and writes a JSON report. It does not enforce budgets or target sizes.
0 commit comments