chore: use tsup for build - #72
Merged
Merged
Conversation
chore: complete node and browser env build separation chore: update docs and packaging chore: update tests to write to a temp folder
There was a problem hiding this comment.
Pull request overview
Migrates the library build pipeline to tsup while producing separate Node and browser bundles (with conditional exports) and updates tests/docs to reflect the new platform split and temp-fixture handling.
Changes:
- Added
tsup.config.tsto generate dual ESM+CJS outputs for Node (dist/node) and browser (dist/browser), with esbuild stubs to prevent cross-platform module loading. - Updated packaging (
package.jsonexports, engines,sideEffects) and TypeScript config (moduleResolution: Bundler,noEmit,isolatedModules) to align with bundler-based builds. - Adjusted Jest projects (unit-node/unit-browser) and integration/unit tests to write fixtures under
tests/integration/tmp/, plus added a browser shim setup file.
Reviewed changes
Copilot reviewed 41 out of 46 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsup.config.ts | Defines tsup Node/browser build outputs and esbuild stubs for platform-specific modules. |
| tsconfig.json | Switches TS to bundler-style resolution and typecheck-only (noEmit) to match tsup builds. |
| tests/utils.ts | Aligns imports with inline type-only imports. |
| tests/unit/version.spec.ts | Updates unit test imports for type-only usage. |
| tests/unit/trash.spec.ts | Updates unit test imports for type-only usage. |
| tests/unit/mock.ts | Updates mock types to type-only imports for lint consistency. |
| tests/unit/folder.spec.ts | Refactors imports into typed/value split (inline type imports). |
| tests/unit/file.spec.ts | Refactors imports and updates fs-node module path usage. |
| tests/unit/drive.spec.ts | Updates unit test imports for type-only usage. |
| tests/unit/abort.spec.ts | Updates unit test imports for type-only usage. |
| tests/TESTS.md | Documents new Jest project layout and temp fixture behavior/location. |
| tests/platform-browser.ts | Adds unit-browser setup shim to force isNode=false for browser-path coverage. |
| tests/integration/version.spec.ts | Decouples drive path vs on-disk sourcePath using the temp registry. |
| tests/integration/trash.spec.ts | Uses stable temp source paths for repeated uploads. |
| tests/integration/setup/utils.ts | Moves temp fixtures under tests/integration/tmp/ and returns absolute paths. |
| tests/integration/init.spec.ts | Updates integration test imports for type-only usage. |
| tests/integration/folder.spec.ts | Updates integration test imports for type-only usage. |
| tests/integration/file.spec.ts | Decouples drive paths from disk paths across upload/update/move tests. |
| tests/integration/e2e.spec.ts | Uses absolute disk path for update source while keeping manifest paths stable. |
| tests/integration/drive.spec.ts | Updates integration test imports for type-only usage. |
| tests/integration/abort.spec.ts | Tracks temp source paths explicitly for abort-related upload scenarios. |
| src/utils/mantaray.ts | Converts bee-js and internal imports to type-only where applicable. |
| src/utils/fs/fs-node.ts | Adds Node-only fs helpers (isDir, readFile, content-type detection). |
| src/utils/common.ts | Converts internal type imports to inline type-only. |
| src/utils/bee.ts | Converts bee-js and internal imports to type-only where applicable. |
| src/utils/asserts.ts | Splits value vs type imports while preserving runtime validation constructors. |
| src/upload/upload-node.ts | Updates Node upload implementation to import fs-node helper module. |
| src/upload/upload-browser.ts | Converts imports to type-only where applicable. |
| src/upload/index.ts | Updates dynamic imports to new upload-node / upload-browser module names. |
| src/types/utils.ts | Converts bee-js imports to type-only where applicable. |
| src/types/upload.ts | Converts internal imports to type-only where applicable. |
| src/types/info.ts | Converts imports to type-only where applicable. |
| src/types/fileManager.ts | Converts imports (bee-js + internal) to type-only where applicable. |
| src/types/download.ts | Converts imports to type-only where applicable. |
| src/mantarayStore.ts | Converts bee-js and internal imports to type-only where applicable. |
| src/fileManager.ts | Converts bee-js and internal imports to type-only where applicable. |
| src/download/index.ts | Converts imports to type-only where applicable. |
| README.md | Updates build/package documentation for tsup + dual platform bundles and Node version requirement. |
| pnpm-workspace.yaml | Allows esbuild to build during pnpm install (tsup/ts-jest dependency chain). |
| pnpm-lock.yaml | Locks new toolchain deps (notably tsup/esbuild/rollup) and related transitive updates. |
| package.json | Switches build script to tsup, adds conditional exports, updates engines, removes rimraf, adds repo metadata. |
| jest.config.ts | Fixes browser setup filename and keeps multi-project Jest config. |
| eslint.config.mjs | Ignores tsup config and enforces consistent-type-imports inline style. |
| .nvmrc | Drops Node version to v22 to match engines/docs. |
| .npmignore | Refines ignored paths for published package contents. |
| .gitignore | Ignores integration temp directory under tests. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
chore: complete node and browser env build separation
chore: update docs and packaging
chore: update tests to write to a temp folder