From d07db37aef2c037916ada7cbd87730cdffbf6784 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Wed, 19 Oct 2022 13:10:06 +0100 Subject: [PATCH] deps!: update multiformats to 10.x.x and all @ipld/* deps (#425) Updates to new versions of multiformats and `@ipld` deps --- .github/workflows/js-test-and-release.yml | 38 +++++++++---------- README.md | 13 ++++--- lerna.json | 7 +++- package.json | 4 +- packages/ipfs-repo-migrations/README.md | 18 ++++----- .../migrations/migration-9/index.js | 2 +- packages/ipfs-repo-migrations/package.json | 23 ++++------- .../test/migrations/migration-9-test.js | 2 +- packages/ipfs-repo-migrations/test/node.js | 19 ++++------ packages/ipfs-repo/README.md | 20 +++++----- packages/ipfs-repo/package.json | 24 ++++++------ packages/ipfs-repo/src/pin-manager.js | 2 +- 12 files changed, 82 insertions(+), 90 deletions(-) diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml index 70e7ac2b..d155996c 100644 --- a/.github/workflows/js-test-and-release.yml +++ b/.github/workflows/js-test-and-release.yml @@ -12,8 +12,8 @@ jobs: check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -25,12 +25,12 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [windows-latest, ubuntu-latest, macos-latest] node: [16] fail-fast: true steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} - uses: ipfs/aegir/actions/cache-node-modules@master @@ -43,8 +43,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -57,8 +57,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -71,8 +71,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -85,8 +85,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -99,8 +99,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -113,8 +113,8 @@ jobs: needs: check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master @@ -128,10 +128,10 @@ jobs: runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v3 with: node-version: lts/* - uses: ipfs/aegir/actions/cache-node-modules@master diff --git a/README.md b/README.md index a4ff0cc7..5e148152 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # ipfs-repo -[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io) -[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) -[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs) +[![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) [![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-repo.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-repo) [![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-repo/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-repo/actions/workflows/js-test-and-release.yml) @@ -62,8 +61,12 @@ Licensed under either of ## Contribute -Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)! +Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-repo/issues). -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general. + +Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) diff --git a/lerna.json b/lerna.json index d7a23368..fe9f1a3a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,10 +1,13 @@ { - "lerna": "4.0.0", + "lerna": "5.4.0", "useWorkspaces": true, "version": "independent", "command": { "run": { "stream": true } - } + }, + "packages": [ + "packages/*" + ] } diff --git a/package.json b/package.json index 66939809..8fef1576 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "dep-check": "lerna run dep-check", "release": "lerna run --concurrency 1 release -- --" }, - "devDependencies": { - "lerna": "^5.0.0", + "dependencies": { + "lerna": "^6.0.0", "rimraf": "^3.0.2" }, "workspaces": [ diff --git a/packages/ipfs-repo-migrations/README.md b/packages/ipfs-repo-migrations/README.md index 9c44cfb4..02b00dc0 100644 --- a/packages/ipfs-repo-migrations/README.md +++ b/packages/ipfs-repo-migrations/README.md @@ -1,8 +1,7 @@ # ipfs-repo-migrations -[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io) -[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) -[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs) +[![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) [![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-repo.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-repo) [![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-repo/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-repo/actions/workflows/js-test-and-release.yml) @@ -11,7 +10,6 @@ ## Table of contents - [Install](#install) -- [Lead Maintainer ](#lead-maintainer----omit-in-toc---) - [Background](#background) - [Use in Node.js](#use-in-nodejs) - [Use in a browser with browserify, webpack or any other bundler](#use-in-a-browser-with-browserify-webpack-or-any-other-bundler) @@ -50,10 +48,6 @@ $ npm i ipfs-repo-migrations This package is inspired by the [go-ipfs repo migration tool](https://github.com/ipfs/fs-repo-migrations/) -## Lead Maintainer - -[Alex Potsides](http://github.com/achingbrain) - ## Background As js-ipfs evolves and new technologies, algorithms and data structures are incorporated it is necessary to @@ -320,8 +314,12 @@ Licensed under either of ## Contribute -Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)! +Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-repo/issues). -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general. + +Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) diff --git a/packages/ipfs-repo-migrations/migrations/migration-9/index.js b/packages/ipfs-repo-migrations/migrations/migration-9/index.js index f1d332bf..4cee2d7b 100644 --- a/packages/ipfs-repo-migrations/migrations/migration-9/index.js +++ b/packages/ipfs-repo-migrations/migrations/migration-9/index.js @@ -14,7 +14,7 @@ import { base32 } from 'multiformats/bases/base32' * @typedef {import('../../src/types').MigrationProgressCallback} MigrationProgressCallback * @typedef {import('interface-datastore').Datastore} Datastore * @typedef {import('interface-blockstore').Blockstore} Blockstore - * @typedef {import('multiformats/cid').CIDVersion} CIDVersion + * @typedef {import('multiformats/cid').Version} CIDVersion */ /** diff --git a/packages/ipfs-repo-migrations/package.json b/packages/ipfs-repo-migrations/package.json index 35ef1ede..652906d6 100644 --- a/packages/ipfs-repo-migrations/package.json +++ b/packages/ipfs-repo-migrations/package.json @@ -35,19 +35,12 @@ "dist/*", "dist/src/*", "dist/src/*/index" - ], - "migrations/*": [ - "*", - "dist/*", - "dist/migrations/*", - "dist/migrations/*/index" ] } }, "files": [ "src", "dist", - "migrations", "!dist/test", "!**/*.tsbuildinfo" ], @@ -171,7 +164,7 @@ "dep-check": "aegir dep-check -i interface-blockstore -i npm-run-all" }, "dependencies": { - "@ipld/dag-pb": "^2.1.0", + "@ipld/dag-pb": "^3.0.0", "@multiformats/multiaddr": "^11.0.0", "cborg": "^1.3.4", "datastore-core": "^8.0.1", @@ -179,30 +172,28 @@ "fnv1a": "^1.0.1", "interface-blockstore": "^3.0.0", "interface-datastore": "^7.0.0", - "it-length": "^1.0.1", - "multiformats": "^9.0.4", + "it-length": "^2.0.0", + "multiformats": "^10.0.1", "protobufjs": "^7.0.0", - "uint8arrays": "^3.0.0", + "uint8arrays": "^4.0.2", "varint": "^6.0.0" }, "devDependencies": { - "@ipld/car": "^4.1.4", + "@ipld/car": "^5.0.0", "@types/debug": "^4.1.5", - "@types/rimraf": "^3.0.2", "@types/varint": "^6.0.0", "aegir": "^37.5.0", "aws-sdk": "^2.884.0", "blockstore-core": "^2.0.0", - "blockstore-datastore-adapter": "^3.0.1", + "blockstore-datastore-adapter": "^4.0.0", "datastore-fs": "^8.0.0", "datastore-level": "^9.0.0", "datastore-s3": "^10.0.0", - "protobufjs-cli": "^1.0.0", "just-safe-set": "^4.1.1", "level-5": "npm:level@^5.0.0", "level-6": "npm:level@^6.0.0", "npm-run-all": "^4.1.5", - "rimraf": "^3.0.2", + "protobufjs-cli": "^1.0.0", "sinon": "^14.0.0" }, "browser": { diff --git a/packages/ipfs-repo-migrations/test/migrations/migration-9-test.js b/packages/ipfs-repo-migrations/test/migrations/migration-9-test.js index b5f610d9..bed152c4 100644 --- a/packages/ipfs-repo-migrations/test/migrations/migration-9-test.js +++ b/packages/ipfs-repo-migrations/test/migrations/migration-9-test.js @@ -16,7 +16,7 @@ import { base32 } from 'multiformats/bases/base32' * @typedef {import('interface-datastore').Datastore} Datastore * @typedef {import('interface-blockstore').Blockstore} Blockstore * @typedef {import('interface-datastore').Key} Key - * @typedef {import('multiformats/cid').CIDVersion} CIDVersion + * @typedef {import('multiformats/cid').Version} CIDVersion * @typedef {{ car: Uint8Array, root: CID, pins: number }} Pinset */ diff --git a/packages/ipfs-repo-migrations/test/node.js b/packages/ipfs-repo-migrations/test/node.js index fe54bec0..10c1359d 100644 --- a/packages/ipfs-repo-migrations/test/node.js +++ b/packages/ipfs-repo-migrations/test/node.js @@ -1,7 +1,7 @@ /* eslint-env mocha */ import os from 'os' -import rimraf from 'rimraf' +import fs from 'fs/promises' import { FsDatastore } from 'datastore-fs' import { LevelDatastore } from 'datastore-level' import { S3Datastore } from 'datastore-s3' @@ -28,18 +28,13 @@ let s3Instance * @param {string} dir */ async function cleanup (dir) { - /** @type {Promise} */ - const p = new Promise((resolve, reject) => { - rimraf(dir, (err) => { - if (err) { - reject(err) - return - } - - resolve() + try { + await fs.rmdir(dir, { + recursive: true }) - }) - await p + } catch (/** @type {any} **/ err) { + console.info('Could not delete', dir, err.stack) // eslint-disable-line no-console + } } const CONFIGURATIONS = [{ diff --git a/packages/ipfs-repo/README.md b/packages/ipfs-repo/README.md index f3698d78..1b53326c 100644 --- a/packages/ipfs-repo/README.md +++ b/packages/ipfs-repo/README.md @@ -1,8 +1,7 @@ # ipfs-repo -[![ipfs.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io) -[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) -[![Discord](https://img.shields.io/discord/806902334369824788?style=flat-square)](https://discord.gg/ipfs) +[![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) [![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-repo.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-repo) [![CI](https://img.shields.io/github/workflow/status/ipfs/js-ipfs-repo/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/js-ipfs-repo/actions/workflows/js-test-and-release.yml) @@ -68,10 +67,6 @@ $ npm i ipfs-repo This is the implementation of the [IPFS repo spec](https://github.com/ipfs/specs/blob/master/REPO.md) in JavaScript. -## Lead Maintainer - -[Alex Potsides](https://github.com/achingbrain) - ## Background Here is the architectural reasoning for this repo: @@ -408,13 +403,20 @@ Licensed under either of ## Contribute -Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-importer/issues)! +Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-repo/issues). -This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). +Also see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general. + +Please be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md) [CID]: https://github.com/multiformats/js-cid + [Key]: https://github.com/ipfs/interface-datastore#keys + [Block]: https://github.com/ipld/js-ipld-block + [Multiaddr]: https://github.com/multiformats/js-multiaddr diff --git a/packages/ipfs-repo/package.json b/packages/ipfs-repo/package.json index 17efa9e1..88cb9434 100644 --- a/packages/ipfs-repo/package.json +++ b/packages/ipfs-repo/package.json @@ -180,7 +180,7 @@ "dep-check": "aegir dep-check -i interface-blockstore" }, "dependencies": { - "@ipld/dag-pb": "^2.1.0", + "@ipld/dag-pb": "^3.0.0", "bytes": "^3.1.0", "cborg": "^1.3.4", "datastore-core": "^8.0.1", @@ -189,36 +189,36 @@ "interface-blockstore": "^3.0.0", "interface-datastore": "^7.0.0", "ipfs-repo-migrations": "^13.0.0", - "it-drain": "^1.0.1", - "it-filter": "^1.0.2", - "it-first": "^1.0.2", - "it-map": "^1.0.5", - "it-merge": "^1.0.2", - "it-parallel-batch": "^1.0.9", + "it-drain": "^2.0.0", + "it-filter": "^2.0.0", + "it-first": "^2.0.0", + "it-map": "^2.0.0", + "it-merge": "^2.0.0", + "it-parallel-batch": "^2.0.0", "it-pipe": "^2.0.4", "it-pushable": "^3.1.0", "just-safe-get": "^4.1.1", "just-safe-set": "^4.1.1", "merge-options": "^3.0.4", "mortice": "^3.0.0", - "multiformats": "^9.0.4", + "multiformats": "^10.0.1", "p-queue": "^7.3.0", "proper-lockfile": "^4.0.0", "quick-lru": "^6.1.1", "sort-keys": "^5.0.0", - "uint8arrays": "^3.0.0" + "uint8arrays": "^4.0.2" }, "devDependencies": { - "@ipld/dag-cbor": "^7.0.2", + "@ipld/dag-cbor": "^8.0.0", "@types/bytes": "^3.1.0", "@types/debug": "^4.1.5", "@types/proper-lockfile": "^4.1.1", "@types/rimraf": "^3.0.2", "aegir": "^37.5.0", "blockstore-core": "^2.0.0", - "blockstore-datastore-adapter": "^3.0.1", + "blockstore-datastore-adapter": "^4.0.0", "ipfs-utils": "^9.0.7", - "it-all": "^1.0.2", + "it-all": "^2.0.0", "just-range": "^4.1.1", "rimraf": "^3.0.2", "sinon": "^14.0.0" diff --git a/packages/ipfs-repo/src/pin-manager.js b/packages/ipfs-repo/src/pin-manager.js index ff8f8dee..29b56cff 100644 --- a/packages/ipfs-repo/src/pin-manager.js +++ b/packages/ipfs-repo/src/pin-manager.js @@ -27,7 +27,7 @@ import QuickLRU from 'quick-lru' /** * @typedef {object} PinInternal * @property {number} depth - * @property {import('multiformats/cid').CIDVersion} [version] + * @property {import('multiformats/cid').Version} [version] * @property {number} [codec] * @property {Record} [metadata] */