Conversation
* chore: update @ethersphere/bee-js to version 12.0.0 * chore: bump version to 1.0.9 in package.json
Additive to the shared constants module (no v1 removals): the six MANIFEST_METADATA_* fork-metadata keys, drive-scoped metadata keys, ROOT_PATH, DRIVE_FORK_PREFIX, and the feed/upload concurrency caps that the v2 asserts and (later) the engine consume. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Side-by-side v2 type layer under src/types/v2/ so it coexists with the still-present v1 types (the v1->v2 FileManager cutover lands in api-core). - info.ts: NodeResource base; FileRecord, DriveInfo, FolderInfo, ManifestHost, TrashEntry, NodeEntry, NodeHeader, ShareItem; and the NodeType / NodeStatus / ListDepth enums. - upload.ts: BrowserUploadOptions, NodeUploadOptions, UploadSource, UploadItem, UpdateItem, UploadFilesResult. - download.ts: DownloadResource, DownloadResult. - utils.ts: ActReferences plus the feed-result helpers. - index.ts: v2 barrel (FileManager service interface intentionally excluded). Copied verbatim from feat/folder-and-version-handling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Superset of the v1 enum (no member removed or renamed): adds FILE_UPDATED, FILE_MOVED, FILES_UPLOADED and the FOLDER_* lifecycle events. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v2 assert layer under src/utils/v2/ (side-by-side with the v1 asserts): assertActReferences, assertNodeResource, assertFileRecord, assertShareItem, assertDriveInfo, assertFolderInfo, assertDriveInfoFromMetadata, parseTrashedNodes and assertReady. Copied from feat/folder-and-version-handling with import paths adjusted for the v2 dir. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
refactor: remove upload, download and version handlers
…er, froget and move
… types, functions chore: rename fileInfoList to recordList
chore: add v2-interface.md changelog
fix: implement v2 related tests
fix: folder status on creation fix: failing IT cases
chore: recoverFolder unit test
v2/tests: fix and restructure integration and unit tests
fix: mock browser env and set coverage to run both envs fix: assert uploadable source paths
There was a problem hiding this comment.
Pull request overview
This PR delivers the v2 rewrite of @solarpunkltd/file-manager-lib, shifting to a Swarm-native filesystem model (drives/folders/files as manifest+feed nodes), updating the transport layer to one-hop /bytes uploads + readable-stream downloads, and overhauling tests/CI to support the new architecture.
Changes:
- Introduces the v2 data model (
FileRecord,DriveInfo,FolderInfo,NodeType/Status, upload/download resource types) plus new Swarm manifest/feed utilities (MantarayStore, mantaray metadata helpers, path helpers). - Reworks upload/download transport to use
bee.uploadData+bee.downloadReadableDataand removes the prior node/browser download modules and directory upload path. - Reorganizes unit/integration tests (including a browser-mocked unit project) and migrates integration environment provisioning to
bee-factory; updates docs and GitHub Actions accordingly.
Reviewed changes
Copilot reviewed 81 out of 85 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | TS compiler settings adjusted for v2 + aliasing. |
| tests/utils.ts | Shared test helpers updated for new APIs and bee-factory URLs. |
| tests/unit/version.spec.ts | New unit coverage for file-version read/restore logic. |
| tests/unit/trash.spec.ts | New unit coverage for trash/recover/forget lifecycle. |
| tests/unit/setup.ts | Centralized Jest mocks for unit tests. |
| tests/unit/mock.ts | Updated mock seeding + default Bee/mantaray mocks. |
| tests/unit/init.spec.ts | New unit coverage for initialization/reinitialization behavior. |
| tests/unit/folder.spec.ts | New unit coverage for folder operations (list/move/create/etc.). |
| tests/unit/events.spec.ts | New unit coverage for emitted events. |
| tests/unit/drive.spec.ts | New unit coverage for drive create/forget semantics. |
| tests/unit/abort.spec.ts | New unit coverage for AbortSignal propagation. |
| tests/platform.browser.ts | Browser-mode unit test shim (std-env mock). |
| tests/integration/trash.spec.ts | New integration coverage for lifecycle operations against live Bee. |
| tests/integration/testSetupHelpers.ts | Removed legacy integration setup helpers. |
| tests/integration/test-node-setup/stopBeeNode.sh | Removed legacy Bee bootstrap script. |
| tests/integration/test-node-setup/runBeeNode.sh | Removed legacy Bee bootstrap script. |
| tests/integration/test-node-setup/jestTeardown.ts | Removed legacy Jest global teardown. |
| tests/integration/test-node-setup/jestSetup.ts | Removed legacy Jest global setup. |
| tests/integration/setup/utils.ts | New bee-factory-based integration fixtures + temp file registry. |
| tests/integration/setup/jestTeardown.ts | Integration teardown now stops bee-factory stack. |
| tests/integration/setup/jestSetup.ts | Integration setup now starts bee-factory stack (tag-configurable). |
| tests/integration/init.spec.ts | Integration coverage for init + revalidation flows. |
| tests/integration/folder.spec.ts | Integration coverage for folder listing/download/move. |
| tests/integration/e2e.spec.ts | End-to-end workflow integration coverage. |
| tests/integration/drive.spec.ts | Integration coverage for drive creation + forgetting. |
| tests/integration/abort.spec.ts | Integration coverage for abort behavior across operations. |
| tests/fixtures/test.txt | Removed static fixture (replaced by temp files). |
| tests/fixtures/nested/nested.txt | Removed static fixture (replaced by temp files). |
| tests/fixtures/nested/extra/extra.txt | Removed static fixture (replaced by temp files). |
| tests/fixtures/folder/2.txt | Fixture directory contents updated (now largely temp-file driven). |
| tests/fixtures/folder/1.txt | Removed static fixture (replaced by temp files). |
| tests/fixtures/data.txt | Removed static fixture (replaced by temp files). |
| src/utils/path.ts | New path utilities + relative path validation. |
| src/utils/mantaray.ts | Expanded mantaray helpers: entries listing + metadata builders + manifest save. |
| src/utils/logger.ts | New logger singleton used across v2 utilities. |
| src/utils/index.ts | Updated exports to match new error/types surface. |
| src/utils/fs/fs.node.ts | Node FS file data narrowed to stream-based upload source. |
| src/utils/events.ts | Expanded event enum for v2 capabilities. |
| src/utils/errors.ts | New error hierarchy + ErrorHandler singleton. |
| src/utils/constants.ts | New v2 constants (paths, concurrency caps, metadata keys). |
| src/utils/common.ts | New bounded concurrency helper + path/status utilities; updated settlePromises. |
| src/utils/capacity.ts | Removed legacy capacity estimation utilities. |
| src/utils/bee.ts | New feed helpers + ACT feed write path + stamp/version helpers. |
| src/utils/asserts.ts | New v2 asserts + metadata parsing helpers. |
| src/upload/upload.node.ts | Node upload rewritten to one-hop uploadData stream path. |
| src/upload/upload.browser.ts | Browser upload rewritten to one-hop uploadData. |
| src/upload/index.ts | Upload option normalization + env dispatch updated for v2 upload sources. |
| src/types/utils.ts | Types reshaped around ActReferences and v2 result structs. |
| src/types/upload.ts | New upload types (UploadItem, UpdateItem, results, sources). |
| src/types/info.ts | New v2 node/drive/folder/file model types + enums. |
| src/types/index.ts | Barrel exports updated for v2 public surface. |
| src/types/download.ts | New download resource/result types. |
| src/mantarayStore.ts | New stateful store for manifest/feed caching + resolve/load/save. |
| src/download/index.ts | Download rewritten to downloadReadableData + per-resource results. |
| src/download/download.node.ts | Removed legacy node download module. |
| src/download/download.browser.ts | Removed legacy browser download module. |
| README.md | Major documentation update for v2 architecture and usage. |
| pnpm-workspace.yaml | Workspace/pnpm policy additions (build allowlist, release-age exclusions). |
| package.json | Version bump to 2.0.0; deps/scripts updated; adds bee-factory + bee-js aliasing. |
| jest.config.ts | Split unit into node/browser projects; integration uses bee-factory setup/teardown. |
| eslint.config.mjs | ESLint globals/rules updated for new runtime APIs and test patterns. |
| changelog/v2-types.md | New v2 change documentation (types/events/asserts). |
| changelog/v2-transport.md | New v2 transport documentation. |
| changelog/v2-tests.md | New v2 test/CI documentation. |
| changelog/v2-interface.md | New v2 interface finalization documentation. |
| changelog/v2-engine.md | New v2 engine/store documentation. |
| changelog/v2-api-trash.md | New v2 trash API documentation. |
| changelog/v2-api-folder.md | New v2 folder API documentation. |
| changelog/v2-api-file-write.md | New v2 file-write API documentation. |
| changelog/v2-api-file-read.md | New v2 file-read/version API documentation. |
| changelog/v2-api-drive.md | New v2 drive teardown API documentation. |
| changelog/v2-api-core.md | New v2 core cutover documentation. |
| .gitignore | Ignore rules updated (notably for Markdown + memory artifacts). |
| .github/workflows/tests.yaml | CI split for unit vs integration; adds conditional integration gating + concurrency. |
| .depcheckrc.json | Depcheck ignore list updated for new tooling deps. |
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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 81 out of 85 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (2)
jest.config.ts:9
transformIgnorePatternsallowsbee-js, but the actual dependency used throughout the repo is the scoped package@ethersphere/bee-js. As written, Jest will still treatnode_modules/@ethersphere/bee-jsas ignored (not transformed), which can break tests if that package ships ESM/TS syntax.
transformIgnorePatterns: ['node_modules/(?!(std-env|cafe-utility|bee-js)/)'],
tests/utils.ts:28
makeUploadSource()returns aBlobcast toFile. If any code under test (or bee-js) relies onFilefields (e.g.name,lastModified) orinstanceof File, this can cause subtle browser-test failures. Prefer constructing a realFilefor the browser branch.
chore: complete node and browser env build separation chore: update docs and packaging chore: update tests to write to a temp folder
chore: use tsup for build
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 86 out of 90 changed files in this pull request and generated no new comments.
Suppressed comments (1)
jest.config.ts:12
transformIgnorePatternswhitelistsbee-js, but the dependency is imported as the scoped package@ethersphere/bee-js(via an npm alias). With the current regex, Jest will still ignore (not transform)node_modules/@ethersphere/bee-js, which commonly breaks when that dependency ships ESM/TS. Consider updating the allowlist here and the identicaltransformIgnorePatternssetting in the root config further down in this file.
transform: {
'^.+\\.tsx?$': 'ts-jest',
},
transformIgnorePatterns: ['node_modules/(?!(std-env|cafe-utility|bee-js)/)'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
},
…trol chore: extend tests with path collisions
chore: extend tests accordingly
refactor: consistent error handling chore: delete unused functions
fix: trash as root folder and caching strageties
No description provided.