Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ yalc.lock
coverage/
*.pid
tests/**/bee-dev/
tests/integration/tmp/
**.tgz

*.md
Expand Down
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependencies
node_modules
node_modules/

# Tests
tests/
Expand Down Expand Up @@ -48,4 +48,7 @@ Thumbs.db
.nvmrc

# docs
REFERENCE.md
CLAUDE.md
REFERENCE.md
memory/
changelog/
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v24
v22
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ flowchart TD
pnpm install @solarpunkltd/file-manager-lib
```

Peer dependency: `@ethersphere/bee-js`.
Requires **Node.js ≥ 22**. Peer dependency: `@ethersphere/bee-js`. The package ships dual **ESM + CJS** builds with
separate **Node** and **browser** bundles, selected automatically via `package.json` `exports` conditions — bundlers get
a `fs`/`path`-free browser build.

---

Expand Down Expand Up @@ -205,7 +207,7 @@ when each fires.

From `package.json`:

- `pnpm run build` → compile Node + browser + types.
- `pnpm run build` → bundle Node + browser (ESM + CJS) + type declarations via **tsup**.
- `pnpm run test` → run Jest tests (see [tests/TESTS.md](tests/TESTS.md)).
- `pnpm run lint` / `pnpm run lint:fix` → linting.
- `pnpm init:husky` → husky init.
Expand Down
8 changes: 4 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ export default [
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'dist/**',
'eslint.config.mjs',
'eslint-compat.cjs',
'commitlint.config.cjs',
'tests/fixtures/**',
'tests/**/bee-dev/**',
'**/coverage/**',
'tests/coverage/**',
'tsup.config.ts',
],
},
{
Expand Down Expand Up @@ -103,6 +102,7 @@ export default [
'simple-import-sort': simpleImportSort,
},
rules: {
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
Expand Down
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const browserSetup = '<rootDir>/tests/platform.browser.ts';
const browserSetup = '<rootDir>/tests/platform-browser.ts';

const tsProject = {
preset: 'ts-jest',
Expand Down
39 changes: 24 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@
"name": "@solarpunkltd/file-manager-lib",
"version": "2.0.0",
"description": "A file manager for storing and handling data on Swarm.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/types/index.d.ts",
"main": "dist/node/index.cjs",
"module": "dist/node/index.mjs",
"types": "dist/node/index.d.ts",
"exports": {
".": {
"types": "./dist/types/index.d.ts",
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
"types": "./dist/node/index.d.ts",
"browser": {
"import": "./dist/browser/index.mjs",
"require": "./dist/browser/index.cjs"
},
"node": {
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.cjs"
},
"default": "./dist/node/index.mjs"
},
"./package.json": "./package.json"
},
"scripts": {
"prepublishOnly": "pnpm run build",
"build": "rimraf dist && pnpm run build:types && pnpm run build:cjs && pnpm run build:esm",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist/types",
"build": "tsup",
"test": "jest --config=jest.config.ts --maxWorkers=4 --verbose --silent",
"test:ut": "pnpm run test --selectProjects=unit-node && pnpm run test --selectProjects=unit-browser",
"test:it": "pnpm run test --selectProjects=integration",
Expand All @@ -27,10 +31,11 @@
"test:coverage": "pnpm run test --coverage",
"lint": "eslint . --report-unused-disable-directives --no-cache --max-warnings=5",
"lint:fix": "pnpm run lint --fix",
"check:types": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.cjs.json --noEmit && tsc -p tsconfig.esm.json --noEmit",
"check:types": "tsc -p tsconfig.json --noEmit",
"depcheck": "depcheck .",
"init:husky": "pnpm husky install"
},
"sideEffects": false,
"files": [
"dist"
],
Expand All @@ -51,6 +56,10 @@
"author": "SolarPunkLtd",
"homepage": "https://github.com/Solar-Punk-Ltd/file-manager-lib",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/Solar-Punk-Ltd/file-manager-lib.git"
},
"dependencies": {
"@ethersphere/bee-js": "npm:@solarpunkltd/bee-js@0.0.0-fmv2.1",
"cafe-utility": "^36.2.0",
Expand All @@ -64,8 +73,8 @@
"devDependencies": {
"@commitlint/cli": "^20.4.1",
"@commitlint/config-conventional": "^20.4.1",
"@ethersphere/bee-factory": "^1.1.1",
"@eslint/js": "^9.39.2",
"@ethersphere/bee-factory": "^1.1.1",
"@types/event-emitter": "^0.3.5",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^30.0.0",
Expand All @@ -85,15 +94,15 @@
"husky": "^9.1.7",
"jest": "^30.2.0",
"prettier": "^3.8.1",
"rimraf": "^6.1.2",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"tsup": "^8.5.1",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=24.0.0",
"node": ">=22.0.0",
"npm": ">=11.0.0",
"pnpm": ">=10.0.0",
"bee": "2.8.0"
"bee": "2.8.1"
}
}
Loading
Loading