Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.
Closed
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,30 @@
<a href="https://fhenixjs.fhenix.zone" target="_blank"><strong>Explore the Docs »</strong></a>
</p>

## Module Resolution Compatibility

This package supports both legacy and modern TypeScript module resolution:

### Legacy Module Resolution (`moduleResolution: "node"`)
```typescript
// Default import (uses web build)
import { cofhejs } from 'cofhejs';

// Direct path access (bypasses exports)
import { cofhejs } from 'cofhejs/dist/web';
import { cofhejs } from 'cofhejs/dist/node';
```

### Modern Module Resolution (`moduleResolution: "node16"` or `"nodenext"`)
```typescript
// All import paths work
import { cofhejs } from 'cofhejs'; // Main entry (web)
import { cofhejs } from 'cofhejs/web'; // Web-specific build
import { cofhejs } from 'cofhejs/node'; // Node-specific build
```

**Note:** The web build is the default for legacy compatibility. Use `cofhejs/node` for Node.js-specific features.

## General

fhenix.js allows developers to add support for encrypted data when developing dApps on Fhenix.
Expand Down
1 change: 0 additions & 1 deletion crs.txt

This file was deleted.

14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
"name": "cofhejs",
"version": "0.4.0-alpha.0",
"description": "The JavaScript SDK for Fhenix's CoFHE Service",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./web": {
"types": "./dist/web.d.ts",
"import": "./dist/web.mjs",
Expand Down Expand Up @@ -37,8 +45,6 @@
"lint": "eslint src/",
"_pure-compile": "tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && tsc -p tsconfig.types.json",
"compile": "pnpm _hack-backup-cjs && pnpm _pure-compile && pnpm _hack-restore-cjs",
"build-rollup": "rollup -c",
"dev-rollup": "rollup -c -w",
"test": "VITE_CJS_IGNORE_WARNING=true vitest",
"coverage": "pnpm compile && VITE_CJS_IGNORE_WARNING=true vitest run --coverage",
"test-no-localfhenix": "SKIP_LOCAL_ENV=true VITE_CJS_IGNORE_WARNING=true vitest ",
Expand Down Expand Up @@ -71,9 +77,6 @@
"zustand": "^5.0.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "25.0.8",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-wasm": "6.2.2",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@vitest/coverage-v8": "1.1.0",
"eslint": "8.57.0",
Expand All @@ -82,7 +85,6 @@
"jsdom": "^25.0.0",
"prettier": "3.2.5",
"rimraf": "^6.0.1",
"rollup": "4.18.0",
"shx": "^0.3.4",
"ts-node": "10.9.2",
"tsup": "^8.4.0",
Expand Down
Loading
Loading