Skip to content

Conversation

@nd0ut
Copy link
Member

@nd0ut nd0ut commented Jun 19, 2025

Description

Checklist

@nd0ut nd0ut requested a review from Copilot June 19, 2025 10:54
Copy link

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 introduces a new cname-prefix package and aligns testing dependencies across the monorepo.

  • Bumps Vitest and coverage tooling in image-shrink
  • Adds packages/cname-prefix with its source code, tests, build/config files, and documentation
  • Updates root package.json and CI workflow to include the new package

Reviewed Changes

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

File Description
packages/image-shrink/package.json Upgraded Vitest from v1 to v3 and replaced coverage-istanbul
packages/cname-prefix/… All new config, source, tests, and build files for package
package.json Included packages/cname-prefix in the workspace
.github/workflows/checks.yml Added cname-prefix paths to the CI job triggers
Comments suppressed due to low confidence (1)

packages/cname-prefix/README.md:39

  • Since getCnamePrefix is async, the usage example should await the call (const prefix = await getCnamePrefix(...)) or handle the returned Promise to avoid confusion.
const prefix = getCnamePrefix('demopublickey')

@@ -0,0 +1 @@
export default '6.2.1'
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

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

The version in version.ts ('6.2.1') does not match the package.json version ('6.14.3'), leading to inconsistent versioning. Please synchronize them.

Suggested change
export default '6.2.1'
export default '6.14.3'

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +8
export const sha256Encode = async (data: string): Promise<number> => {
const msgUint8 = new TextEncoder().encode(data)
const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgUint8)
const hashArray = Array.from(new Uint8Array(hashBuffer))
const hashHexStr = hashArray
.map((b) => b.toString(16).padStart(2, '0'))
.join('')
const hashHexInt = parseInt(hashHexStr, 16)
Copy link

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

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

Using parseInt on a full 256-bit hex string will exceed JavaScript's Number safe range, causing precision loss. Consider using BigInt('0x' + hashHexStr) or returning the hex string directly to preserve the full value.

Suggested change
export const sha256Encode = async (data: string): Promise<number> => {
const msgUint8 = new TextEncoder().encode(data)
const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgUint8)
const hashArray = Array.from(new Uint8Array(hashBuffer))
const hashHexStr = hashArray
.map((b) => b.toString(16).padStart(2, '0'))
.join('')
const hashHexInt = parseInt(hashHexStr, 16)
export const sha256Encode = async (data: string): Promise<bigint> => {
const msgUint8 = new TextEncoder().encode(data)
const hashBuffer = await window.crypto.subtle.digest('SHA-256', msgUint8)
const hashArray = Array.from(new Uint8Array(hashBuffer))
const hashHexStr = hashArray
.map((b) => b.toString(16).padStart(2, '0'))
.join('')
const hashHexInt = BigInt('0x' + hashHexStr)

Copilot uses AI. Check for mistakes.
@nd0ut nd0ut requested a review from egordidenko June 19, 2025 11:49
@nd0ut nd0ut force-pushed the feat/cname-prefix branch from a7133d6 to 6abe1b0 Compare June 22, 2025 23:37
@nd0ut nd0ut force-pushed the feat/cname-prefix branch 3 times, most recently from e8c18da to fe69159 Compare June 23, 2025 09:34
@nd0ut nd0ut force-pushed the feat/cname-prefix branch from fe69159 to 3f03ec6 Compare June 23, 2025 09:36
@nd0ut nd0ut merged commit aa26175 into master Jun 23, 2025
4 checks passed
@nd0ut nd0ut deleted the feat/cname-prefix branch June 23, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants