Skip to content

fix: the problem of the formatAssetName function#1482

Merged
yifancong merged 4 commits intomainfrom
fix/format-asset-path
Jan 13, 2026
Merged

fix: the problem of the formatAssetName function#1482
yifancong merged 4 commits intomainfrom
fix/format-asset-path

Conversation

@yifancong
Copy link
Contributor

@yifancong yifancong commented Jan 13, 2026

Summary

fix: the problem of the formatAssetName function

When formatting the path config/config-basic.[hash].html, the result is config/config.html, but it should be config/config-basic.html.

Related Links

Copilot AI review requested due to automatic review settings January 13, 2026 08:48
@netlify
Copy link

netlify bot commented Jan 13, 2026

Deploy Preview for rsdoctor ready!

Name Link
🔨 Latest commit 8f3e4fa
🔍 Latest deploy log https://app.netlify.com/projects/rsdoctor/deploys/696613b77d623b0008d23f03
😎 Deploy Preview https://deploy-preview-1482--rsdoctor.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the formatAssetName function where the hash pattern regex was incorrectly matching common words like "basic" and "main" that don't contain digits, causing them to be treated as hashes and removed from filenames.

Changes:

  • Updated the hashPattern regex to be more strict, requiring either a hex string (4-32 chars) or an alphanumeric string that contains at least one digit
  • Added comprehensive test cases to verify that common words without digits are preserved and actual hash patterns are correctly removed
  • Updated pnpm-lock.yaml with compiled dependency entries

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/utils/src/common/graph/assets.ts Modified hash pattern regex to prevent matching pure alphabetic words by requiring at least one digit in non-hex patterns
packages/utils/tests/common/graph.test.ts Added test cases verifying that filenames with common words (basic, main) are preserved while actual hashes are removed
pnpm-lock.yaml Added empty entries for compiled packages (maintenance update)
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yifancong yifancong requested a review from Copilot January 13, 2026 09:20
@yifancong yifancong enabled auto-merge (squash) January 13, 2026 09:54
@yifancong yifancong merged commit 2ec1f3a into main Jan 13, 2026
7 of 8 checks passed
@yifancong yifancong deleted the fix/format-asset-path branch January 13, 2026 09:57
@yifancong yifancong mentioned this pull request Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants