-
Notifications
You must be signed in to change notification settings - Fork 0
パッケージバージョンアップとtsdownの設定追加と型キャストの修正 #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
deflis
commented
Dec 9, 2025
- tsdown.config.tsを新規作成し、ターゲットをES2020に設定、出力形式をCJSとESMに設定。
- responseGzipOrJson関数内でgzipSyncの戻り値をArrayBufferにキャスト。
- unzippテスト内でgzipAsyncの戻り値をArrayBufferにキャスト。
- package.jsonのエクスポート設定を更新し、typesとimportの拡張子を変更。
- fetchサンプルを新規作成し、関連ファイルを追加。
- ターゲットをES2020に設定 - 出力形式をCJSとESMに設定 - クリーンビルドと型定義ファイルの生成を有効化 - エントリーポイントにsrc/index.tsとsrc/index.browser.tsを指定 - ソースマップの生成を有効化
- responseGzipOrJson関数内でgzipSyncの戻り値をArrayBufferにキャスト - unzippテスト内でgzipAsyncの戻り値をArrayBufferにキャスト
- typesの拡張子を.d.tsから.d.mtsに変更 - importの拡張子を.jsから.mjsに変更 - browserエクスポートの設定を更新 - build:tscスクリプトの引数を修正
- README.md、brower.ts、index.ts、package.jsonを新規作成 - pnpm-lock.yamlにfetchの依存関係を追加
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
このPRは、ビルドツールをtsupからtsdownに移行し、それに伴う設定ファイルの更新、型キャストの追加、パッケージエクスポート設定の変更を行っています。また、fetchの使用例を示す新しいサンプルディレクトリが追加されています。
主な変更点:
- ビルドツール
tsupからtsdownへの移行と設定ファイルの更新 - テストおよびモックコード内での
ArrayBufferへの型キャスト追加 - package.jsonのエクスポートパスを
.d.tsから.d.mts、.jsから.mjsに変更
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsdown.config.ts | tsupからtsdownへのインポートパス変更 |
| test/util/unzipp.test.ts | gzipAsync/TextEncoderの戻り値をArrayBufferにキャスト |
| test/mock.ts | gzipSyncの戻り値をArrayBufferにキャスト |
| package.json | エクスポートパスの拡張子変更、依存関係の更新、tsdownへの移行 |
| examples/fetch/* | fetchサンプルコードの新規追加 |
| pnpm-lock.yaml | 依存関係の更新 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "types": "./dist/index.d.mts", | ||
| "node": { | ||
| "import": "./dist/index.js", | ||
| "import": "./dist/index.mjs", | ||
| "require": "./dist/index.cjs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exports point to artifacts tsdown does not emit
In package.json the root export now targets ./dist/index.mjs and ./dist/index.d.mts (lines 14–17), but the build config in tsdown.config.ts still uses the default format: ["cjs", "esm"] with no out-extension override or NodeNext module settings, so tsdown will continue to emit index.js/index.cjs and .d.ts files. After running pnpm run build, the files referenced in exports will not exist, causing module resolution/type lookup errors for consumers importing narou.
Useful? React with 👍 / 👎.