Removes the barrel export pattern in favor of explicit subpath imports
for better tree-shaking and clearer dependencies.
## Breaking Changes
- Removed `src/helpers.ts` barrel export
- Removed `./helpers` from package.json exports
- Root `kraiken-lib` import now raises build errors
- Consumers MUST use explicit subpaths:
- `kraiken-lib/abis` - Contract ABIs
- `kraiken-lib/staking` - Staking helpers
- `kraiken-lib/snatch` - Snatch selection
- `kraiken-lib/ids` - Position ID utilities
- `kraiken-lib/subgraph` - Byte conversion utilities
- `kraiken-lib/taxRates` - Tax rate constants
- `kraiken-lib/version` - Version validation
## Changes
- kraiken-lib:
- Bumped version to 1.0.0 (breaking change)
- Updated src/index.ts to raise build errors
- Added backward-compatible ABI aliases (KraikenAbi, StakeAbi)
- Updated all test files to use .js extensions and new imports
- Updated documentation (README, AGENTS.md)
- Consumer updates:
- services/ponder: Updated ponder.config.ts to use kraiken-lib/abis
- web-app: Updated all imports to use subpaths
- composables/usePositions.ts: kraiken-lib/subgraph
- contracts/harb.ts: kraiken-lib/abis
- contracts/stake.ts: kraiken-lib/abis
## Migration Guide
```typescript
// OLD
import { getSnatchList } from 'kraiken-lib/helpers';
import { KraikenAbi } from 'kraiken-lib';
// NEW
import { getSnatchList } from 'kraiken-lib/snatch';
import { KraikenAbi } from 'kraiken-lib/abis';
```
Fixes #86
Co-authored-by: openhands <openhands@all-hands.dev>
Reviewed-on: https://codeberg.org/johba/harb/pulls/89
92 lines
2.4 KiB
JSON
92 lines
2.4 KiB
JSON
{
|
|
"name": "kraiken-lib",
|
|
"version": "1.0.0",
|
|
"description": "helper functions and snatch selection",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"types": "dist/index.d.ts",
|
|
"exports": {
|
|
".": {
|
|
"types": "./dist/index.d.ts",
|
|
"require": "./dist/index.js",
|
|
"import": "./dist/index.js"
|
|
},
|
|
"./ids": {
|
|
"types": "./dist/ids.d.ts",
|
|
"require": "./dist/ids.js",
|
|
"import": "./dist/ids.js"
|
|
},
|
|
"./taxRates": {
|
|
"types": "./dist/taxRates.d.ts",
|
|
"require": "./dist/taxRates.js",
|
|
"import": "./dist/taxRates.js"
|
|
},
|
|
"./snatch": {
|
|
"types": "./dist/snatch.d.ts",
|
|
"require": "./dist/snatch.js",
|
|
"import": "./dist/snatch.js"
|
|
},
|
|
"./staking": {
|
|
"types": "./dist/staking.d.ts",
|
|
"require": "./dist/staking.js",
|
|
"import": "./dist/staking.js"
|
|
},
|
|
"./subgraph": {
|
|
"types": "./dist/subgraph.d.ts",
|
|
"require": "./dist/subgraph.js",
|
|
"import": "./dist/subgraph.js"
|
|
},
|
|
"./abis": {
|
|
"types": "./dist/abis.d.ts",
|
|
"require": "./dist/abis.js",
|
|
"import": "./dist/abis.js"
|
|
},
|
|
"./version": {
|
|
"types": "./dist/version.d.ts",
|
|
"require": "./dist/version.js",
|
|
"import": "./dist/version.js"
|
|
}
|
|
},
|
|
"files": [
|
|
"/dist"
|
|
],
|
|
"scripts": {
|
|
"test": "jest",
|
|
"compile": "graphql-codegen",
|
|
"watch": "graphql-codegen -w",
|
|
"lint": "eslint 'src/**/*.ts'",
|
|
"lint:fix": "eslint 'src/**/*.ts' --fix",
|
|
"format": "prettier --write 'src/**/*.ts'",
|
|
"format:check": "prettier --check 'src/**/*.ts'",
|
|
"prepare": "husky install || true"
|
|
},
|
|
"lint-staged": {
|
|
"src/**/*.ts": [
|
|
"eslint --fix",
|
|
"prettier --write"
|
|
]
|
|
},
|
|
"dependencies": {
|
|
"@apollo/client": "^3.9.10",
|
|
"graphql": "^16.8.1",
|
|
"graphql-tag": "^2.12.6"
|
|
},
|
|
"devDependencies": {
|
|
"@graphql-codegen/cli": "^5.0.2",
|
|
"@graphql-codegen/client-preset": "^4.2.5",
|
|
"@graphql-codegen/typescript": "^4.0.6",
|
|
"@graphql-codegen/typescript-operations": "^4.2.0",
|
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
"@types/jest": "^29.5.12",
|
|
"@types/node": "^24.6.0",
|
|
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
|
"@typescript-eslint/parser": "^8.45.0",
|
|
"eslint": "^9.36.0",
|
|
"husky": "^9.1.7",
|
|
"jest": "^29.7.0",
|
|
"lint-staged": "^16.2.3",
|
|
"prettier": "^3.6.2",
|
|
"ts-jest": "^29.1.2",
|
|
"typescript": "^5.4.3"
|
|
}
|
|
}
|