Skip to content

build: migrate from unbuild to tsdown - #29

Merged
bytaesu merged 3 commits into
mainfrom
2026-07-17/build/standardize-tsdown
Jul 25, 2026
Merged

build: migrate from unbuild to tsdown#29
bytaesu merged 3 commits into
mainfrom
2026-07-17/build/standardize-tsdown

Conversation

@bytaesu

@bytaesu bytaesu commented Jul 24, 2026

Copy link
Copy Markdown
Member

Replaces unbuild with tsdown, bumps TypeScript to 6, and centralizes buffer coercion in a shared bytes helper

Copilot AI review requested due to automatic review settings July 24, 2026 23:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Jul 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR migrates the build tooling from unbuild to tsdown, bumps TypeScript from 5.8 to 6.0, and extracts shared buffer-coercion logic into a new src/bytes.ts helper (toBufferSource and toUint8Array) that all crypto/encoding modules now import.

  • tsdown.config.mts mirrors the old build.config.ts entry list; unbundle: true keeps each entry as a separate emitted file so bytes.ts is naturally emitted as a shared chunk without needing an explicit entry.
  • bytes.ts correctly handles the SharedArrayBuffer-backed view edge case (WebCrypto rejects SharedArrayBuffer), and its JSDoc documents the ArrayBuffer-vs-TypedArray memory semantics noted in a prior review thread.
  • TypeScript 6 defaults types to [], no longer auto-including @types/node; password.node.ts uses Buffer as an ambient type that won't be in scope without \"types\": [\"node\"] in tsconfig.json.

Confidence Score: 4/5

Safe to merge once the tsconfig types omission is addressed; all other changes are mechanical refactors with no behavioral regressions.

The TypeScript 6 bump changes the default for types to an empty array, meaning @types/node ambient globals (specifically Buffer, used as a return-type annotation in password.node.ts) are no longer auto-included. This would make tsc --noEmit fail on the password.node.ts entry. Everything else looks correct.

Files Needing Attention: tsconfig.json needs types: [node] added to compilerOptions to keep @types/node ambient globals available under TypeScript 6.

Reviews (2): Last reviewed commit: "chore: add comment" | Re-trigger Greptile

Comment thread src/bytes.ts
Comment thread tsdown.config.mts
Comment thread package.json
@bytaesu
bytaesu merged commit a8f249d into main Jul 25, 2026
2 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.

2 participants