From c214930ed17e871e7db7d60c32dc5be0737ccb5c Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 17 Jan 2024 14:02:44 +0100 Subject: [PATCH] chore: rename @helia/core to @helia/utils Utils is probably a better name as it has a strong implication that it's not to be used on it's own whereas `@helia/core` is too close to `ipfs-core` which we did want people to use on it's own. --- .release-please.json | 4 ++-- packages/car/package.json | 4 ++-- packages/core/src/version.ts | 2 -- packages/dag-cbor/package.json | 2 +- packages/helia/package.json | 4 ++-- packages/helia/src/helia-p2p.ts | 2 +- packages/helia/src/index.ts | 2 +- packages/helia/tsconfig.json | 6 +++--- packages/http/package.json | 2 +- packages/http/src/index.ts | 2 +- packages/http/tsconfig.json | 6 +++--- packages/interface/README.md | 14 ++++++++++++++ packages/interop/package.json | 2 +- packages/ipns/package.json | 6 +++--- packages/mfs/package.json | 4 ++-- packages/unixfs/README.md | 2 +- packages/unixfs/package.json | 4 ++-- packages/{core => utils}/CHANGELOG.md | 0 packages/{core => utils}/LICENSE | 0 packages/{core => utils}/LICENSE-APACHE | 0 packages/{core => utils}/LICENSE-MIT | 0 packages/{core => utils}/README.md | 10 +++++----- packages/{core => utils}/package.json | 6 +++--- packages/{core => utils}/src/index.ts | 2 +- packages/{core => utils}/src/pins.ts | 0 packages/{core => utils}/src/routing.ts | 0 packages/{core => utils}/src/storage.ts | 0 packages/{core => utils}/src/utils/dag-walkers.ts | 0 .../{core => utils}/src/utils/datastore-version.ts | 0 .../{core => utils}/src/utils/default-hashers.ts | 0 .../{core => utils}/src/utils/networked-storage.ts | 0 packages/{core => utils}/test/block-broker.spec.ts | 0 .../{core => utils}/test/fixtures/create-block.ts | 0 .../{core => utils}/test/fixtures/create-dag.ts | 0 .../{core => utils}/test/fixtures/create-helia.ts | 0 .../{core => utils}/test/fixtures/dag-walker.ts | 0 packages/{core => utils}/test/gc.spec.ts | 0 packages/{core => utils}/test/index.spec.ts | 0 .../test/pins.depth-limited.spec.ts | 0 .../{core => utils}/test/pins.recursive.spec.ts | 0 packages/{core => utils}/test/pins.spec.ts | 0 packages/{core => utils}/test/storage.spec.ts | 0 .../test/utils/networked-storage.spec.ts | 0 packages/{core => utils}/tsconfig.json | 0 packages/{core => utils}/typedoc.json | 0 45 files changed, 49 insertions(+), 37 deletions(-) delete mode 100644 packages/core/src/version.ts rename packages/{core => utils}/CHANGELOG.md (100%) rename packages/{core => utils}/LICENSE (100%) rename packages/{core => utils}/LICENSE-APACHE (100%) rename packages/{core => utils}/LICENSE-MIT (100%) rename packages/{core => utils}/README.md (90%) rename packages/{core => utils}/package.json (96%) rename packages/{core => utils}/src/index.ts (99%) rename packages/{core => utils}/src/pins.ts (100%) rename packages/{core => utils}/src/routing.ts (100%) rename packages/{core => utils}/src/storage.ts (100%) rename packages/{core => utils}/src/utils/dag-walkers.ts (100%) rename packages/{core => utils}/src/utils/datastore-version.ts (100%) rename packages/{core => utils}/src/utils/default-hashers.ts (100%) rename packages/{core => utils}/src/utils/networked-storage.ts (100%) rename packages/{core => utils}/test/block-broker.spec.ts (100%) rename packages/{core => utils}/test/fixtures/create-block.ts (100%) rename packages/{core => utils}/test/fixtures/create-dag.ts (100%) rename packages/{core => utils}/test/fixtures/create-helia.ts (100%) rename packages/{core => utils}/test/fixtures/dag-walker.ts (100%) rename packages/{core => utils}/test/gc.spec.ts (100%) rename packages/{core => utils}/test/index.spec.ts (100%) rename packages/{core => utils}/test/pins.depth-limited.spec.ts (100%) rename packages/{core => utils}/test/pins.recursive.spec.ts (100%) rename packages/{core => utils}/test/pins.spec.ts (100%) rename packages/{core => utils}/test/storage.spec.ts (100%) rename packages/{core => utils}/test/utils/networked-storage.spec.ts (100%) rename packages/{core => utils}/tsconfig.json (100%) rename packages/{core => utils}/typedoc.json (100%) diff --git a/.release-please.json b/.release-please.json index d77f5a32..f583b918 100644 --- a/.release-please.json +++ b/.release-please.json @@ -4,7 +4,6 @@ "packages": { "packages/block-brokers": {}, "packages/car": {}, - "packages/core": {}, "packages/dag-cbor": {}, "packages/dag-json": {}, "packages/helia": {}, @@ -16,6 +15,7 @@ "packages/mfs": {}, "packages/routers": {}, "packages/strings": {}, - "packages/unixfs": {} + "packages/unixfs": {}, + "packages/utils": {} } } diff --git a/packages/car/package.json b/packages/car/package.json index 6a91ff7f..14c51ea2 100644 --- a/packages/car/package.json +++ b/packages/car/package.json @@ -140,10 +140,10 @@ }, "dependencies": { "@helia/interface": "^3.0.1", - "@ipld/car": "^5.1.1", + "@ipld/car": "^5.2.5", "@libp2p/interfaces": "^3.3.1", "it-drain": "^3.0.5", - "it-map": "^3.0.3", + "it-map": "^3.0.5", "multiformats": "^13.0.0", "p-defer": "^4.0.0", "p-queue": "^8.0.1", diff --git a/packages/core/src/version.ts b/packages/core/src/version.ts deleted file mode 100644 index 4224ec2f..00000000 --- a/packages/core/src/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const version = '2.0.0' -export const name = 'helia' diff --git a/packages/dag-cbor/package.json b/packages/dag-cbor/package.json index 44f9fdd0..7f0f46a0 100644 --- a/packages/dag-cbor/package.json +++ b/packages/dag-cbor/package.json @@ -141,7 +141,7 @@ }, "dependencies": { "@helia/interface": "^3.0.1", - "@ipld/dag-cbor": "^9.0.6", + "@ipld/dag-cbor": "^9.0.7", "@libp2p/interfaces": "^3.3.1", "multiformats": "^13.0.0", "progress-events": "^1.0.0" diff --git a/packages/helia/package.json b/packages/helia/package.json index ffcf7033..18ada688 100644 --- a/packages/helia/package.json +++ b/packages/helia/package.json @@ -58,10 +58,10 @@ "@chainsafe/libp2p-noise": "^14.0.0", "@chainsafe/libp2p-yamux": "^6.0.1", "@helia/block-brokers": "^1.0.0", - "@helia/core": "^0.0.0", "@helia/delegated-routing-v1-http-api-client": "^2.0.2", "@helia/interface": "^3.0.1", "@helia/routers": "^0.0.0", + "@helia/utils": "^0.0.0", "@libp2p/autonat": "^1.0.1", "@libp2p/bootstrap": "^10.0.2", "@libp2p/circuit-relay-v2": "^1.0.2", @@ -77,7 +77,7 @@ "@libp2p/tcp": "^9.0.2", "@libp2p/upnp-nat": "^1.0.1", "@libp2p/webrtc": "^4.0.3", - "@libp2p/websockets": "^8.0.2", + "@libp2p/websockets": "^8.0.10", "@libp2p/webtransport": "^4.0.3", "blockstore-core": "^4.3.8", "datastore-core": "^9.2.6", diff --git a/packages/helia/src/helia-p2p.ts b/packages/helia/src/helia-p2p.ts index 65eb227c..ed2fd9b8 100644 --- a/packages/helia/src/helia-p2p.ts +++ b/packages/helia/src/helia-p2p.ts @@ -1,4 +1,4 @@ -import { Helia, type HeliaInit } from '@helia/core' +import { Helia, type HeliaInit } from '@helia/utils' import type { BlockBroker } from './index.js' import type { Libp2p } from '@libp2p/interface' import type { Blockstore } from 'interface-blockstore' diff --git a/packages/helia/src/index.ts b/packages/helia/src/index.ts index f977b1b7..ae867722 100644 --- a/packages/helia/src/index.ts +++ b/packages/helia/src/index.ts @@ -27,7 +27,7 @@ import { HeliaP2P } from './helia-p2p.js' import { libp2pDefaults } from './utils/libp2p-defaults.js' import { createLibp2p } from './utils/libp2p.js' import type { DefaultLibp2pServices } from './utils/libp2p-defaults.js' -import type { Helia } from '@helia/core' +import type { Helia } from '@helia/interface' import type { BlockBroker } from '@helia/interface/blocks' import type { ComponentLogger, Libp2p } from '@libp2p/interface' import type { KeychainInit } from '@libp2p/keychain' diff --git a/packages/helia/tsconfig.json b/packages/helia/tsconfig.json index 976a4ebf..dcf164a8 100644 --- a/packages/helia/tsconfig.json +++ b/packages/helia/tsconfig.json @@ -11,14 +11,14 @@ { "path": "../block-brokers" }, - { - "path": "../core" - }, { "path": "../interface" }, { "path": "../routers" + }, + { + "path": "../utils" } ] } diff --git a/packages/http/package.json b/packages/http/package.json index 4d55b3b9..c34b80a8 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -54,9 +54,9 @@ }, "dependencies": { "@helia/block-brokers": "^1.0.0", - "@helia/core": "^0.0.0", "@helia/interface": "^3.0.1", "@helia/routers": "^0.0.0", + "@helia/utils": "^0.0.0", "blockstore-core": "^4.3.8", "datastore-core": "^9.2.6" }, diff --git a/packages/http/src/index.ts b/packages/http/src/index.ts index 7fa44e3b..1e6ad884 100644 --- a/packages/http/src/index.ts +++ b/packages/http/src/index.ts @@ -44,8 +44,8 @@ */ import { trustlessGateway } from '@helia/block-brokers' -import { Helia as HeliaClass, type HeliaInit } from '@helia/core' import { delegatedHTTPRouting } from '@helia/routers' +import { Helia as HeliaClass, type HeliaInit } from '@helia/utils' import { MemoryBlockstore } from 'blockstore-core' import { MemoryDatastore } from 'datastore-core' import type { Helia } from '@helia/interface' diff --git a/packages/http/tsconfig.json b/packages/http/tsconfig.json index 976a4ebf..dcf164a8 100644 --- a/packages/http/tsconfig.json +++ b/packages/http/tsconfig.json @@ -11,14 +11,14 @@ { "path": "../block-brokers" }, - { - "path": "../core" - }, { "path": "../interface" }, { "path": "../routers" + }, + { + "path": "../utils" } ] } diff --git a/packages/interface/README.md b/packages/interface/README.md index 895b1ecc..e50862db 100644 --- a/packages/interface/README.md +++ b/packages/interface/README.md @@ -11,6 +11,20 @@ > The Helia API +# About + +The API defined by a Helia node + +## Example + +```typescript +import type { Helia } from '@helia/interface' + +export function doSomething(helia: Helia) { + // use helia node functions here +} +``` + # Install ```console diff --git a/packages/interop/package.json b/packages/interop/package.json index 699a8248..abe687b4 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -69,7 +69,7 @@ "@ipld/dag-cbor": "^9.0.7", "@libp2p/interface": "^1.1.1", "@libp2p/kad-dht": "^12.0.2", - "@libp2p/peer-id": "^4.0.3", + "@libp2p/peer-id": "^4.0.5", "@libp2p/peer-id-factory": "^4.0.3", "@libp2p/websockets": "^8.0.10", "@multiformats/sha3": "^3.0.0", diff --git a/packages/ipns/package.json b/packages/ipns/package.json index bafa48d1..4c9b5ee9 100644 --- a/packages/ipns/package.json +++ b/packages/ipns/package.json @@ -168,12 +168,12 @@ "@libp2p/interface": "^1.1.1", "@libp2p/kad-dht": "^12.0.2", "@libp2p/logger": "^4.0.4", - "@libp2p/peer-id": "^4.0.4", + "@libp2p/peer-id": "^4.0.5", "dns-over-http-resolver": "^3.0.0", "dns-packet": "^5.6.0", "hashlru": "^2.3.0", "interface-datastore": "^8.2.9", - "ipns": "^8.0.0", + "ipns": "^8.0.3", "is-ipfs": "^8.0.1", "multiformats": "^13.0.0", "p-queue": "^8.0.1", @@ -181,7 +181,7 @@ "uint8arrays": "^5.0.1" }, "devDependencies": { - "@libp2p/peer-id-factory": "^4.0.3", + "@libp2p/peer-id-factory": "^4.0.5", "@types/dns-packet": "^5.6.4", "aegir": "^42.1.0", "datastore-core": "^9.2.7", diff --git a/packages/mfs/package.json b/packages/mfs/package.json index 4d6f456e..6b4ab922 100644 --- a/packages/mfs/package.json +++ b/packages/mfs/package.json @@ -146,11 +146,11 @@ "interface-datastore": "^8.2.9", "ipfs-unixfs": "^11.0.0", "ipfs-unixfs-exporter": "^13.1.0", - "ipfs-unixfs-importer": "^15.1.0", + "ipfs-unixfs-importer": "^15.2.3", "multiformats": "^13.0.0" }, "devDependencies": { - "@ipld/dag-pb": "^4.0.7", + "@ipld/dag-pb": "^4.0.8", "aegir": "^42.1.0", "blockstore-core": "^4.3.10", "datastore-core": "^9.2.7", diff --git a/packages/unixfs/README.md b/packages/unixfs/README.md index b549e106..7a446ad0 100644 --- a/packages/unixfs/README.md +++ b/packages/unixfs/README.md @@ -17,7 +17,7 @@ `@helia/unixfs` is an implementation of a filesystem compatible with Helia. -See the interface for all available operations. +See the [API docs](https://ipfs.github.io/helia/modules/_helia_unixfs.html) for all available operations. ## Example - Creating files and directories diff --git a/packages/unixfs/package.json b/packages/unixfs/package.json index 1edfd93b..43e75dbe 100644 --- a/packages/unixfs/package.json +++ b/packages/unixfs/package.json @@ -167,9 +167,9 @@ "hamt-sharding": "^3.0.2", "ipfs-unixfs": "^11.0.0", "ipfs-unixfs-exporter": "^13.1.0", - "ipfs-unixfs-importer": "^15.1.0", + "ipfs-unixfs-importer": "^15.2.3", "it-glob": "^2.0.4", - "it-last": "^3.0.1", + "it-last": "^3.0.4", "it-pipe": "^3.0.1", "merge-options": "^3.0.4", "multiformats": "^13.0.0", diff --git a/packages/core/CHANGELOG.md b/packages/utils/CHANGELOG.md similarity index 100% rename from packages/core/CHANGELOG.md rename to packages/utils/CHANGELOG.md diff --git a/packages/core/LICENSE b/packages/utils/LICENSE similarity index 100% rename from packages/core/LICENSE rename to packages/utils/LICENSE diff --git a/packages/core/LICENSE-APACHE b/packages/utils/LICENSE-APACHE similarity index 100% rename from packages/core/LICENSE-APACHE rename to packages/utils/LICENSE-APACHE diff --git a/packages/core/LICENSE-MIT b/packages/utils/LICENSE-MIT similarity index 100% rename from packages/core/LICENSE-MIT rename to packages/utils/LICENSE-MIT diff --git a/packages/core/README.md b/packages/utils/README.md similarity index 90% rename from packages/core/README.md rename to packages/utils/README.md index 50941102..d6da7a93 100644 --- a/packages/core/README.md +++ b/packages/utils/README.md @@ -21,7 +21,7 @@ pre-configure Helia for certain use-cases (p2p or pure-HTTP). ## Example ```typescript -import { Helia } from '@helia/core' +import { Helia } from '@helia/utils' const node = new Helia({ // ...options @@ -31,20 +31,20 @@ const node = new Helia({ # Install ```console -$ npm i @helia/core +$ npm i @helia/utils ``` ## Browser ` + ``` # API Docs -- +- # License diff --git a/packages/core/package.json b/packages/utils/package.json similarity index 96% rename from packages/core/package.json rename to packages/utils/package.json index 87726770..eca40e8f 100644 --- a/packages/core/package.json +++ b/packages/utils/package.json @@ -1,9 +1,9 @@ { - "name": "@helia/core", + "name": "@helia/utils", "version": "0.0.0", "description": "Shared code that implements the Helia API", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/helia/tree/main/packages/core#readme", + "homepage": "https://github.com/ipfs/helia/tree/main/packages/utils#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/helia.git" @@ -54,7 +54,7 @@ }, "dependencies": { "@helia/interface": "^3.0.1", - "@ipld/dag-cbor": "^9.0.6", + "@ipld/dag-cbor": "^9.0.7", "@ipld/dag-json": "^10.1.5", "@ipld/dag-pb": "^4.0.6", "@libp2p/interface": "^1.1.1", diff --git a/packages/core/src/index.ts b/packages/utils/src/index.ts similarity index 99% rename from packages/core/src/index.ts rename to packages/utils/src/index.ts index c2911e7a..7890f879 100644 --- a/packages/core/src/index.ts +++ b/packages/utils/src/index.ts @@ -9,7 +9,7 @@ * @example * * ```typescript - * import { Helia } from '@helia/core' + * import { Helia } from '@helia/utils' * * const node = new Helia({ * // ...options diff --git a/packages/core/src/pins.ts b/packages/utils/src/pins.ts similarity index 100% rename from packages/core/src/pins.ts rename to packages/utils/src/pins.ts diff --git a/packages/core/src/routing.ts b/packages/utils/src/routing.ts similarity index 100% rename from packages/core/src/routing.ts rename to packages/utils/src/routing.ts diff --git a/packages/core/src/storage.ts b/packages/utils/src/storage.ts similarity index 100% rename from packages/core/src/storage.ts rename to packages/utils/src/storage.ts diff --git a/packages/core/src/utils/dag-walkers.ts b/packages/utils/src/utils/dag-walkers.ts similarity index 100% rename from packages/core/src/utils/dag-walkers.ts rename to packages/utils/src/utils/dag-walkers.ts diff --git a/packages/core/src/utils/datastore-version.ts b/packages/utils/src/utils/datastore-version.ts similarity index 100% rename from packages/core/src/utils/datastore-version.ts rename to packages/utils/src/utils/datastore-version.ts diff --git a/packages/core/src/utils/default-hashers.ts b/packages/utils/src/utils/default-hashers.ts similarity index 100% rename from packages/core/src/utils/default-hashers.ts rename to packages/utils/src/utils/default-hashers.ts diff --git a/packages/core/src/utils/networked-storage.ts b/packages/utils/src/utils/networked-storage.ts similarity index 100% rename from packages/core/src/utils/networked-storage.ts rename to packages/utils/src/utils/networked-storage.ts diff --git a/packages/core/test/block-broker.spec.ts b/packages/utils/test/block-broker.spec.ts similarity index 100% rename from packages/core/test/block-broker.spec.ts rename to packages/utils/test/block-broker.spec.ts diff --git a/packages/core/test/fixtures/create-block.ts b/packages/utils/test/fixtures/create-block.ts similarity index 100% rename from packages/core/test/fixtures/create-block.ts rename to packages/utils/test/fixtures/create-block.ts diff --git a/packages/core/test/fixtures/create-dag.ts b/packages/utils/test/fixtures/create-dag.ts similarity index 100% rename from packages/core/test/fixtures/create-dag.ts rename to packages/utils/test/fixtures/create-dag.ts diff --git a/packages/core/test/fixtures/create-helia.ts b/packages/utils/test/fixtures/create-helia.ts similarity index 100% rename from packages/core/test/fixtures/create-helia.ts rename to packages/utils/test/fixtures/create-helia.ts diff --git a/packages/core/test/fixtures/dag-walker.ts b/packages/utils/test/fixtures/dag-walker.ts similarity index 100% rename from packages/core/test/fixtures/dag-walker.ts rename to packages/utils/test/fixtures/dag-walker.ts diff --git a/packages/core/test/gc.spec.ts b/packages/utils/test/gc.spec.ts similarity index 100% rename from packages/core/test/gc.spec.ts rename to packages/utils/test/gc.spec.ts diff --git a/packages/core/test/index.spec.ts b/packages/utils/test/index.spec.ts similarity index 100% rename from packages/core/test/index.spec.ts rename to packages/utils/test/index.spec.ts diff --git a/packages/core/test/pins.depth-limited.spec.ts b/packages/utils/test/pins.depth-limited.spec.ts similarity index 100% rename from packages/core/test/pins.depth-limited.spec.ts rename to packages/utils/test/pins.depth-limited.spec.ts diff --git a/packages/core/test/pins.recursive.spec.ts b/packages/utils/test/pins.recursive.spec.ts similarity index 100% rename from packages/core/test/pins.recursive.spec.ts rename to packages/utils/test/pins.recursive.spec.ts diff --git a/packages/core/test/pins.spec.ts b/packages/utils/test/pins.spec.ts similarity index 100% rename from packages/core/test/pins.spec.ts rename to packages/utils/test/pins.spec.ts diff --git a/packages/core/test/storage.spec.ts b/packages/utils/test/storage.spec.ts similarity index 100% rename from packages/core/test/storage.spec.ts rename to packages/utils/test/storage.spec.ts diff --git a/packages/core/test/utils/networked-storage.spec.ts b/packages/utils/test/utils/networked-storage.spec.ts similarity index 100% rename from packages/core/test/utils/networked-storage.spec.ts rename to packages/utils/test/utils/networked-storage.spec.ts diff --git a/packages/core/tsconfig.json b/packages/utils/tsconfig.json similarity index 100% rename from packages/core/tsconfig.json rename to packages/utils/tsconfig.json diff --git a/packages/core/typedoc.json b/packages/utils/typedoc.json similarity index 100% rename from packages/core/typedoc.json rename to packages/utils/typedoc.json