Skip to content

Support arbitrary sub-file paths for BundleJS badges#770

Merged
amio merged 1 commit into
mainfrom
support-bundlejs-subpaths-15938144163441773012
May 6, 2026
Merged

Support arbitrary sub-file paths for BundleJS badges#770
amio merged 1 commit into
mainfrom
support-bundlejs-subpaths-15938144163441773012

Conversation

@amio

@amio amio commented May 6, 2026

Copy link
Copy Markdown
Member

This change enables the bundlejs badge service to support arbitrary sub-file paths in package names (e.g., @noble/hashes/sha3.js).

I updated the route patterns in pages/api/bundlejs.ts to use :name+ instead of :name for both scoped and non-scoped packages. I also added a new example to the service metadata to showcase this feature.

Verification:

  1. Started the dev server and used curl to request a badge with a sub-path (/bundlejs/minzip/@noble/hashes/sha3.js).
  2. Confirmed via logs that the package name was correctly extracted as @noble/hashes/sha3.js.
  3. Ran the project's test suite and end-to-end tests, all of which passed.
  4. Reverted accidental changes to next-env.d.ts that occurred during local development.

PR created automatically by Jules for task 15938144163441773012 started by @amio

Update the route patterns in `pages/api/bundlejs.ts` to use greedy
matching (:name+) for the package name. This allows the badge service
to correctly handle packages with sub-file paths, such as
`@noble/hashes/sha3.js`.

Added a new example to demonstrate this capability.
Verified with manual testing and existing test suite.

Ref: #734

Co-authored-by: amio <215282+amio@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented May 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
badgen.net Ready Ready Preview, Comment May 6, 2026 1:32pm

Request Review

@amio amio merged commit 4ef8094 into main May 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant