diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0bc3b42d..d401a774 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 a15c3791..1d7ff79c 100644 --- a/.github/workflows/js-test-and-release.yml +++ b/.github/workflows/js-test-and-release.yml @@ -1,182 +1,27 @@ name: test & maybe release + on: push: branches: - main pull_request: + workflow_dispatch: -jobs: - - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present lint - - run: npm run --if-present dep-check - - run: npm run --if-present doc-check - - test-node: - needs: check - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest, macos-latest] - node: [lts/*] - fail-fast: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node }} - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:node - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: node - - test-chrome: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:chrome - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: chrome - - test-chrome-webworker: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:chrome-webworker - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: chrome-webworker +permissions: + contents: write + id-token: write + packages: write + pull-requests: write - test-firefox: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:firefox - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: firefox +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} + cancel-in-progress: true - test-firefox-webworker: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:firefox-webworker - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: firefox-webworker - - test-webkit: - needs: check - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - node: [lts/*] - fail-fast: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:webkit - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: webkit - - test-webkit-webworker: - needs: check - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - node: [lts/*] - fail-fast: true - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npm run --if-present test:webkit-webworker - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: webkit-webworker - - test-electron-main: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npx xvfb-maybe npm run --if-present test:electron-main - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: electron-main - - test-electron-renderer: - needs: check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - run: npx xvfb-maybe npm run --if-present test:electron-renderer - - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1 - with: - flags: electron-renderer - - release: - needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-webkit, test-webkit-webworker, test-electron-main, test-electron-renderer] - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: actions/setup-node@v3 - with: - node-version: lts/* - - uses: ipfs/aegir/actions/cache-node-modules@master - - uses: ipfs/aegir/actions/docker-login@master - with: - docker-token: ${{ secrets.DOCKER_TOKEN }} - docker-username: ${{ secrets.DOCKER_USERNAME }} - - run: npm run --if-present release - env: - GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN || github.token }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} +jobs: + js-test-and-release: + uses: pl-strflt/uci/.github/workflows/js-test-and-release.yml@v0.0 + secrets: + DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }} + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 00000000..bd00f090 --- /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/README.md b/README.md index dc2a35b2..d5d7e7ae 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-# @helia/json +# @helia/json [![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,30 +13,23 @@ > Add/get IPLD blocks containing json with your Helia node -## Table of contents - -- [Structure](#structure) -- [API Docs](#api-docs) -- [License](#license) -- [Contribute](#contribute) - -## Structure +# Packages - [`/packages/interop`](./packages/interop) Interop tests for @helia/json - [`/packages/json`](./packages/json) Add/get IPLD blocks containing json with your Helia node -## 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-json/issues). diff --git a/package.json b/package.json index 510cb429..74138c5d 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-json/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/interop/README.md b/packages/interop/README.md index 29719cd9..50cae693 100644 --- a/packages/interop/README.md +++ b/packages/interop/README.md @@ -4,7 +4,7 @@

-# @helia/json-interop +# @helia/json-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/json -## 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-json/issues). diff --git a/packages/interop/package.json b/packages/interop/package.json index 8def232a..993e4d8f 100644 --- a/packages/interop/package.json +++ b/packages/interop/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "description": "Interop tests for @helia/json", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/helia-json/tree/master/packages/interop#readme", + "homepage": "https://github.com/ipfs/helia-json/tree/main/packages/interop#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/helia-json.git" @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-json/issues" }, + "publishConfig": { + "access": "public", + "provenance": true + }, "keywords": [ "IPFS" ], @@ -49,17 +53,17 @@ "test:electron-main": "aegir test -t electron-main" }, "devDependencies": { - "@helia/interface": "^2.0.0", + "@helia/interface": "^3.0.0", "@helia/json": "^1.0.0", - "@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-core-types": "^0.14.0", "ipfsd-ctl": "^13.0.0", "kubo-rpc-client": "^3.0.0", "merge-options": "^3.0.4", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "wherearewe": "^2.0.1" }, "browser": { diff --git a/packages/interop/test/json.spec.ts b/packages/interop/test/json.spec.ts index 6dbd7983..55cc9107 100644 --- a/packages/interop/test/json.spec.ts +++ b/packages/interop/test/json.spec.ts @@ -2,6 +2,7 @@ import { json, type JSON, type AddOptions } from '@helia/json' import { expect } from 'aegir/chai' +import { CID } from 'multiformats/cid' import * as jsonCodec from 'multiformats/codecs/json' import { createHeliaNode } from './fixtures/create-helia.js' import { createKuboNode } from './fixtures/create-kubo.js' @@ -57,7 +58,7 @@ describe('json interop', () => { it('should add to kubo and fetch from helia', async () => { const input = { hello: 'world' } const cid = await kubo.api.block.put(jsonCodec.encode(input)) - const output = await j.get(cid) + const output = await j.get(CID.parse(cid.toString())) expect(output).to.deep.equal(input) }) diff --git a/packages/json/README.md b/packages/json/README.md index 98fa3fb8..b05a5f0d 100644 --- a/packages/json/README.md +++ b/packages/json/README.md @@ -4,7 +4,7 @@

-# @helia/json +# @helia/json [![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,36 @@ > Add/get IPLD blocks containing json with your Helia node -## 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-json/issues). diff --git a/packages/json/package.json b/packages/json/package.json index 208945c5..f442a6df 100644 --- a/packages/json/package.json +++ b/packages/json/package.json @@ -3,7 +3,7 @@ "version": "1.0.3", "description": "Add/get IPLD blocks containing json with your Helia node", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/helia-json/tree/master/packages/json#readme", + "homepage": "https://github.com/ipfs/helia-json/tree/main/packages/json#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/helia-json.git" @@ -11,6 +11,10 @@ "bugs": { "url": "https://github.com/ipfs/helia-json/issues" }, + "publishConfig": { + "access": "public", + "provenance": true + }, "keywords": [ "IPFS" ], @@ -135,14 +139,14 @@ "release": "aegir release" }, "dependencies": { - "@helia/interface": "^2.0.0", + "@helia/interface": "^3.0.0", "@libp2p/interfaces": "^3.3.1", - "interface-blockstore": "^5.0.0", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "progress-events": "^1.0.0" }, "devDependencies": { - "aegir": "^41.0.0", - "blockstore-core": "^4.0.1" + "aegir": "^42.0.1", + "blockstore-core": "^4.0.1", + "interface-blockstore": "^5.0.0" } }