From 6405c3487879614dc4dd7308b15c946d644e0488 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Mon, 8 Jan 2024 10:20:59 +0100 Subject: [PATCH] feat!: update helia to v3 and multiformats to v13 (#52) Updates all deps and fixes linting errors. BREAKING CHANGE: uses multiformats v13 and helia v3 --- .github/dependabot.yml | 2 +- .github/workflows/js-test-and-release.yml | 2 + .github/workflows/semantic-pull-request.yml | 12 ++++ .github/workflows/stale.yml | 25 ++----- README.md | 15 ++--- package.json | 6 +- packages/car/README.md | 74 +++++++++++++++++---- packages/car/package.json | 24 +++---- packages/car/src/index.ts | 4 +- packages/car/typedoc.json | 3 +- packages/interop/README.md | 32 +-------- packages/interop/package.json | 18 +++-- packages/interop/test/index.spec.ts | 3 +- 13 files changed, 123 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/semantic-pull-request.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0bc3b42de..d401a7746 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ updates: schedule: interval: daily time: "10:00" - open-pull-requests-limit: 10 + open-pull-requests-limit: 20 commit-message: prefix: "deps" prefix-development: "deps(dev)" diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml index 35d87d10b..1d7ff79c8 100644 --- a/.github/workflows/js-test-and-release.yml +++ b/.github/workflows/js-test-and-release.yml @@ -9,7 +9,9 @@ on: permissions: contents: write + id-token: write packages: write + pull-requests: write concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 000000000..bd00f090c --- /dev/null +++ b/.github/workflows/semantic-pull-request.yml @@ -0,0 +1,12 @@ +name: Semantic PR + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + uses: pl-strflt/.github/.github/workflows/reusable-semantic-pull-request.yml@v0.3 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 6f6d895d1..16d65d721 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,25 +2,12 @@ name: Close and mark stale issue on: schedule: - - cron: '0 0 * * *' + - cron: '0 0 * * *' + +permissions: + issues: write + pull-requests: write jobs: stale: - - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.' - close-issue-message: 'This issue was closed because it is missing author input.' - stale-issue-label: 'kind/stale' - any-of-labels: 'need/author-input' - exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive' - days-before-issue-stale: 6 - days-before-issue-close: 7 - enable-statistics: true + uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3 diff --git a/README.md b/README.md index 3386fefe5..daa190680 100644 --- a/README.md +++ b/README.md @@ -13,30 +13,23 @@ > Import/export car files from Helia -## Table of contents - -- [Structure](#structure) -- [API Docs](#api-docs) -- [License](#license) -- [Contribute](#contribute) - -## Structure +# Packages - [`/packages/car`](./packages/car) Import/export car files from Helia - [`/packages/interop`](./packages/interop) Interop tests for @helia/car -## API Docs +# API Docs - -## License +# License Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +# Contribute Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-car/issues). diff --git a/package.json b/package.json index c54a5ef01..259ea39cb 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-car/issues" }, + "publishConfig": { + "access": "public", + "provenance": true + }, "keywords": [ "ipfs" ], @@ -36,7 +40,7 @@ "docs:no-publish": "NODE_OPTIONS=--max_old_space_size=8192 aegir docs --publish false -- --exclude packages/interop" }, "devDependencies": { - "aegir": "^41.0.0", + "aegir": "^42.0.1", "npm-run-all": "^4.1.5" }, "type": "module", diff --git a/packages/car/README.md b/packages/car/README.md index 72de958ea..96119adb6 100644 --- a/packages/car/README.md +++ b/packages/car/README.md @@ -4,7 +4,7 @@

-# @helia/car +# @helia/car [![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech) [![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech) @@ -13,21 +13,71 @@ > Import/export car files from Helia -## Table of contents +# About -- [Install](#install) - - [Browser ` ``` -## API Docs +# API Docs - -## License +# License Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +# Contribute Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-car/issues). diff --git a/packages/car/package.json b/packages/car/package.json index 2ef8852d1..c22d25177 100644 --- a/packages/car/package.json +++ b/packages/car/package.json @@ -3,7 +3,7 @@ "version": "1.0.4", "description": "Import/export car files from Helia", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/helia-car/tree/master/packages/car#readme", + "homepage": "https://github.com/ipfs/helia-car/tree/main/packages/car#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/helia-car.git" @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-car/issues" }, + "publishConfig": { + "access": "public", + "provenance": true + }, "keywords": [ "IPFS" ], @@ -42,10 +46,6 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" - }, - "./errors": { - "types": "./dist/src/errors.d.ts", - "import": "./dist/src/errors.js" } }, "eslintConfig": { @@ -155,24 +155,24 @@ "release": "aegir release" }, "dependencies": { - "@helia/interface": "^2.0.0", + "@helia/interface": "^3.0.0", "@ipld/car": "^5.1.1", "@ipld/dag-pb": "^4.0.0", "@libp2p/interfaces": "^3.3.1", "cborg": "^4.0.3", - "interface-blockstore": "^5.0.0", + "it-drain": "^3.0.5", "it-map": "^3.0.3", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "p-defer": "^4.0.0", - "p-queue": "^7.3.4", + "p-queue": "^8.0.1", "progress-events": "^1.0.0" }, "devDependencies": { - "@helia/unixfs": "^1.2.2", - "aegir": "^41.0.0", + "@helia/unixfs": "^2.0.0", + "aegir": "^42.0.1", "blockstore-core": "^4.0.1", + "interface-blockstore": "^5.2.9", "ipfs-unixfs-importer": "^15.1.0", - "it-drain": "^3.0.1", "it-to-buffer": "^4.0.2" } } diff --git a/packages/car/src/index.ts b/packages/car/src/index.ts index 7813a2ac5..a699fa326 100644 --- a/packages/car/src/index.ts +++ b/packages/car/src/index.ts @@ -7,7 +7,7 @@ * * By default it supports `dag-pb`, `dag-cbor`, `dag-json` and `raw` CIDs, more esoteric DAG walkers can be passed as an init option. * - * @example + * @example Exporting a DAG as a CAR file * * ```typescript * import { createHelia } from 'helia' @@ -36,7 +36,7 @@ * await c.export(cid, writer) * ``` * - * @example + * @example Importing all blocks from a CAR file * * ```typescript * import { createHelia } from 'helia' diff --git a/packages/car/typedoc.json b/packages/car/typedoc.json index d63e8ce52..f599dc728 100644 --- a/packages/car/typedoc.json +++ b/packages/car/typedoc.json @@ -1,6 +1,5 @@ { "entryPoints": [ - "./src/index.ts", - "./src/errors.ts" + "./src/index.ts" ] } diff --git a/packages/interop/README.md b/packages/interop/README.md index 254d35eed..af227b18a 100644 --- a/packages/interop/README.md +++ b/packages/interop/README.md @@ -4,7 +4,7 @@

-# @helia/car-interop +# @helia/car-interop [![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech) [![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech) @@ -13,40 +13,14 @@ > Interop tests for @helia/car -## Table of contents - -- [Install](#install) - - [Browser ` -``` - -## API Docs - -- - -## License +# License Licensed under either of - Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) - MIT ([LICENSE-MIT](LICENSE-MIT) / ) -## Contribute +# Contribute Contributions welcome! Please check out [the issues](https://github.com/ipfs/helia-car/issues). diff --git a/packages/interop/package.json b/packages/interop/package.json index 485965a8e..9a177419c 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "description": "Interop tests for @helia/car", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/helia-car/tree/master/packages/interop#readme", + "homepage": "https://github.com/ipfs/helia-car/tree/main/packages/interop#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/helia-car.git" @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-car/issues" }, + "publishConfig": { + "access": "public", + "provenance": true + }, "keywords": [ "IPFS" ], @@ -50,19 +54,19 @@ }, "devDependencies": { "@helia/car": "^1.0.0", - "@helia/interface": "^2.0.0", - "@helia/unixfs": "^1.2.2", + "@helia/interface": "^3.0.0", + "@helia/unixfs": "^2.0.0", "@ipld/car": "^5.1.1", - "@libp2p/websockets": "^7.0.5", - "aegir": "^41.0.0", + "@libp2p/websockets": "^8.0.10", + "aegir": "^42.0.1", "go-ipfs": "^0.22.0", - "helia": "^2.0.1", + "helia": "^3.0.0", "ipfs-unixfs-importer": "^15.1.0", "ipfsd-ctl": "^13.0.0", "it-to-buffer": "^4.0.2", "kubo-rpc-client": "^3.0.0", "merge-options": "^3.0.4", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "p-defer": "^4.0.0", "wherearewe": "^2.0.1" }, diff --git a/packages/interop/test/index.spec.ts b/packages/interop/test/index.spec.ts index ca992bf7d..41b8992c5 100644 --- a/packages/interop/test/index.spec.ts +++ b/packages/interop/test/index.spec.ts @@ -5,6 +5,7 @@ import { type UnixFS, unixfs } from '@helia/unixfs' import { CarReader } from '@ipld/car' import { expect } from 'aegir/chai' import toBuffer from 'it-to-buffer' +import { CID } from 'multiformats/cid' import { createHeliaNode } from './fixtures/create-helia.js' import { createKuboNode } from './fixtures/create-kubo.js' import { memoryCarWriter } from './fixtures/memory-car.js' @@ -91,6 +92,6 @@ describe('car interop', () => { await c.import(reader) - expect(await toBuffer(u.cat(cid))).to.equalBytes(toBuffer(input)) + expect(await toBuffer(u.cat(CID.parse(cid.toString())))).to.equalBytes(toBuffer(input)) }) })