diff --git a/.github/workflows/release_github.yml b/.github/workflows/release_github.yml index c0e32cf..8cb08dc 100644 --- a/.github/workflows/release_github.yml +++ b/.github/workflows/release_github.yml @@ -1,6 +1,12 @@ # On each new commit to `main`, create/update a release PR that bumps the # version and updates the changelog from conventional commits. Merging that # PR cuts a GitHub Release, which triggers publish_npmjs.yml. +# +# Release behaviour (package name, release-type, bump-minor-pre-major) lives in +# release-please-config.json, NOT in `with:` here. The v5 action silently +# ignores `package-name` and `bump-minor-pre-major` as inputs -- it warns and +# carries on -- so setting them here has no effect. Current version is tracked +# in .release-please-manifest.json. name: Release Github on: @@ -8,6 +14,10 @@ on: branches: - main +permissions: + contents: write + pull-requests: write + jobs: release-please: runs-on: ubuntu-latest @@ -15,7 +25,4 @@ jobs: - uses: GoogleCloudPlatform/release-please-action@v5 id: release with: - token: ${{ secrets.REPO_GHA_PAT }} - release-type: node - package-name: swarm-core - bump-minor-pre-major: true + token: ${{ secrets.GHA_PAT_BASIC }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..b985ff6 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3755539 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2026, The Swarm Authors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index b57aef0..de6e4d1 100644 --- a/README.md +++ b/README.md @@ -7,20 +7,20 @@ No network I/O — this library only builds and parses Swarm's on-disk/on-wire d ## Install ```sh -npm install @ethersphere/swarm-core +npm install @ethersphere/core-sdk ``` Ships as both ESM and CommonJS, with full TypeScript types. Import from the subpath you need: ```ts -import { Bytes, Reference } from 'swarm-core/bytes' -import { makeContentAddressedChunk } from 'swarm-core/chunk' +import { Bytes, Reference } from '@ethersphere/core-sdk/bytes' +import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk' ``` ## Quick example ```ts -import { makeContentAddressedChunk } from 'swarm-core/chunk' +import { makeContentAddressedChunk } from '@ethersphere/core-sdk/chunk' const chunk = makeContentAddressedChunk('Hello, Swarm!') console.log(chunk.address.toHex()) @@ -30,15 +30,15 @@ console.log(chunk.address.toHex()) | Subpath | Contents | |---|---| -| `swarm-core/bytes` | `Bytes` and typed wrappers (`Reference`, `BatchId`, `EthAddress`, `PrivateKey`, `PublicKey`, `Signature`, `Span`, `Topic`, `Identifier`, `FeedIndex`, `PeerAddress`, `TransactionId`) plus low-level encoding helpers (hex/base32/base64, concat, slice, integer packing) | -| `swarm-core/crypto` | Keccak-256, ECDSA sign/recover/verify, public/private key derivation | -| `swarm-core/chunk` | Content Addressed Chunks (CAC), Single Owner Chunks (SOC/SOC replicas), the BMT chunk hash, and `ChunkSplitter`/`ChunkJoiner` for building and reconstructing chunk trees | -| `swarm-core/mantaray` | `MantarayNode` — the manifest trie used for directory/collection uploads | -| `swarm-core/erasure-coding` | Reed-Solomon parity, redundancy-level tables, and the batching logic used to add parity chunks to a stream | -| `swarm-core/encryption` | Chunk-level stream cipher and XOR helpers | -| `swarm-core/stamper` | Postage stamp signing (`Stamper`, `stamp()`) and effective-capacity math | - -Every subpath is also re-exported from the package root (`swarm-core`), so `import { Bytes } from 'swarm-core'` works too. +| `@ethersphere/core-sdk/bytes` | `Bytes` and typed wrappers (`Reference`, `BatchId`, `EthAddress`, `PrivateKey`, `PublicKey`, `Signature`, `Span`, `Topic`, `Identifier`, `FeedIndex`, `PeerAddress`, `TransactionId`) plus low-level encoding helpers (hex/base32/base64, concat, slice, integer packing) | +| `@ethersphere/core-sdk/crypto` | Keccak-256, ECDSA sign/recover/verify, public/private key derivation | +| `@ethersphere/core-sdk/chunk` | Content Addressed Chunks (CAC), Single Owner Chunks (SOC/SOC replicas), the BMT chunk hash, and `ChunkSplitter`/`ChunkJoiner` for building and reconstructing chunk trees | +| `@ethersphere/core-sdk/mantaray` | `MantarayNode` — the manifest trie used for directory/collection uploads | +| `@ethersphere/core-sdk/erasure-coding` | Reed-Solomon parity, redundancy-level tables, and the batching logic used to add parity chunks to a stream | +| `@ethersphere/core-sdk/encryption` | Chunk-level stream cipher and XOR helpers | +| `@ethersphere/core-sdk/stamper` | Postage stamp signing (`Stamper`, `stamp()`) and effective-capacity math | + +Every subpath is also re-exported from the package root (`@ethersphere/core-sdk`), so `import { Bytes } from '@ethersphere/core-sdk'` works too. ## Development diff --git a/package.json b/package.json index c92db9a..0f370e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,16 @@ { "name": "@ethersphere/core-sdk", "version": "0.0.1", + "description": "Framework-agnostic TypeScript primitives for the Swarm decentralised storage network", + "repository": { + "type": "git", + "url": "https://github.com/ethersphere/core-sdk.git" + }, + "homepage": "https://github.com/ethersphere/core-sdk", + "bugs": { + "url": "https://github.com/ethersphere/core-sdk/issues/" + }, + "license": "BSD-3-Clause", "type": "module", "packageManager": "pnpm@10.29.2", "engines": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..9b68558 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "node", + "package-name": "@ethersphere/core-sdk", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false + } + } +}