diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f468993..0bc3b42 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,16 +1,11 @@ version: 2 updates: - - package-ecosystem: 'github-actions' - directory: '/' - schedule: - interval: 'daily' - commit-message: - prefix: 'chore' - include: 'scope' - - package-ecosystem: 'npm' - directory: '/' - schedule: - interval: 'daily' - commit-message: - prefix: 'chore' - include: 'scope' +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: "10:00" + open-pull-requests-limit: 10 + commit-message: + prefix: "deps" + prefix-development: "deps(dev)" diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 0000000..d57c2a0 --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,8 @@ +name: Automerge +on: [ pull_request ] + +jobs: + automerge: + uses: protocol/.github/.github/workflows/automerge.yml@master + with: + job: 'automerge' diff --git a/.github/workflows/js-test-and-release.yml b/.github/workflows/js-test-and-release.yml new file mode 100644 index 0000000..d155996 --- /dev/null +++ b/.github/workflows/js-test-and-release.yml @@ -0,0 +1,145 @@ +name: test & maybe release +on: + push: + branches: + - master # with #262 - ${{{ github.default_branch }}} + pull_request: + branches: + - master # with #262 - ${{{ github.default_branch }}} + +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 + + test-node: + needs: check + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + node: [16] + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + with: + flags: chrome-webworker + + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + with: + flags: firefox + + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + with: + flags: firefox-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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + 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@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0 + with: + flags: electron-renderer + + release: + needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer] + 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@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.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml deleted file mode 100644 index 636846f..0000000 --- a/.github/workflows/test-and-release.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Test & Maybe Release -on: [push, pull_request] -jobs: - test: - strategy: - fail-fast: false - matrix: - node: [14.x, 16.x] - os: [macos-latest, ubuntu-latest, windows-latest] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node }} - uses: actions/setup-node@v3.5.1 - with: - node-version: ${{ matrix.node }} - - name: Install Dependencies - run: | - npm install --no-progress - - name: Run tests - run: | - npm config set script-shell bash - npm run test:ci - - name: Typecheck - uses: gozala/typescript-error-reporter-action@v1.0.8 - release: - name: Release - needs: test - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup Node.js - uses: actions/setup-node@v3.5.1 - with: - node-version: 14 - - name: Install dependencies - run: | - npm install --no-progress --no-package-lock --no-save - - name: Build - run: | - npm run build - - name: Install plugins - run: | - npm install \ - @semantic-release/commit-analyzer \ - conventional-changelog-conventionalcommits \ - @semantic-release/release-notes-generator \ - @semantic-release/npm \ - @semantic-release/github \ - @semantic-release/git \ - @semantic-release/changelog \ - --no-progress --no-package-lock --no-save - - name: Release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npx semantic-release - diff --git a/.gitignore b/.gitignore index 7b31cc0..2963214 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules package-lock.json .nyc_output coverage +.coverage dist diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 40cae74..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.github -dist/test diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..20ce483 --- /dev/null +++ b/LICENSE @@ -0,0 +1,4 @@ +This project is dual licensed under MIT and Apache-2.0. + +MIT: https://www.opensource.org/licenses/mit +Apache-2.0: https://www.apache.org/licenses/license-2.0 diff --git a/LICENSE-APACHE b/LICENSE-APACHE index d7bb443..14478a3 100644 --- a/LICENSE-APACHE +++ b/LICENSE-APACHE @@ -1,13 +1,5 @@ -Copyright 2016-2020 Protocol Labs +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at +http://www.apache.org/licenses/LICENSE-2.0 - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. diff --git a/LICENSE-MIT b/LICENSE-MIT index 37057c4..72dc60d 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,7 +1,19 @@ -Copyright 2016-2020 Protocol Labs +The MIT License (MIT) -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md index 09f2536..1a9acc0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,23 @@ -# @ipld/dag-json +# @ipld/dag-json -An implementation of the [DAG-JSON spec](https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-json.md) ("Directed Acyclic Graph for IPLD") for JavaScript designed for use with [multiformats](https://github.com/multiformats/js-multiformats) or via the higher-level `Block` abstraction in [@ipld/block](https://github.com/ipld/js-block). +[![codecov](https://img.shields.io/codecov/c/github/ipld/js-dag-json.svg?style=flat-square)](https://codecov.io/gh/ipld/js-dag-json) +[![CI](https://img.shields.io/github/workflow/status/ipld/js-dag-json/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipld/js-dag-json/actions/workflows/js-test-and-release.yml) + +> JS implementation of DAG-JSON + +## Table of contents + +- [Install](#install) +- [Example](#example) +- [Usage](#usage) +- [License](#license) +- [Contribute](#contribute) + +## Install + +```console +$ npm i @ipld/dag-json +``` ## Example @@ -33,9 +50,9 @@ CID.asCID(decoded.z.a) // cid instance Licensed under either of - * Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0) - * MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT) +- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](LICENSE-MIT) / ) -### Contribution +## Contribute 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. diff --git a/package.json b/package.json index 9bac2de..d9f8106 100644 --- a/package.json +++ b/package.json @@ -2,57 +2,9 @@ "name": "@ipld/dag-json", "version": "0.0.0-dev", "description": "JS implementation of DAG-JSON", - "main": "index.js", - "types": "./types/index.d.ts", - "type": "module", - "scripts": { - "lint": "standard *.js test/*.js", - "build": "npm run build:js && npm run build:types", - "build:js": "ipjs build --tests --main && npm run build:copy", - "build:copy": "cp -a tsconfig.json index.js dist/ && mkdir -p dist/test && cp test/*.js dist/test/", - "build:types": "npm run build:copy && cd dist && tsc --build", - "test:cjs": "npm run build:js && mocha dist/cjs/node-test/test-*.js && npm run test:cjs:browser", - "test:esm": "npm run build:js && mocha dist/esm/node-test/test-*.js && npm run test:esm:browser", - "test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js", - "test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/browser-test/test-*.js", - "test:esm:browser": "polendina --page --worker --serviceworker --cleanup dist/esm/browser-test/test-*.js", - "test:ts": "npm run build:types && npm run test --prefix test/ts-use", - "test": "npm run lint && npm run test:node && npm run test:esm && npm run test:ts", - "test:ci": "npm run lint && npm run test:node && npm run test:esm && npm run test:cjs && npm run test:ts", - "coverage": "c8 --reporter=html mocha test/test-*.js && npm_config_yes=true npx st -d coverage -p 8080" - }, - "keywords": [ - "ipfs", - "ipld", - "multiformats" - ], "author": "Rod (http://r.va.gg/)", - "license": "(Apache-2.0 AND MIT)", - "exports": { - "import": "./index.js" - }, - "dependencies": { - "cborg": "^1.5.4", - "multiformats": "^9.5.4" - }, - "devDependencies": { - "c8": "^7.10.0", - "chai": "^4.3.4", - "ipjs": "^5.2.0", - "ipld-garbage": "^5.0.0", - "mocha": "^10.0.0", - "polendina": "~3.1.0", - "standard": "^17.0.0", - "typescript": "~4.8.2" - }, - "standard": { - "ignore": [ - "dist" - ] - }, - "directories": { - "test": "test" - }, + "license": "Apache-2.0 OR MIT", + "homepage": "https://github.com/ipld/js-dag-json#readme", "repository": { "type": "git", "url": "git+https://github.com/ipld/js-dag-json.git" @@ -60,101 +12,75 @@ "bugs": { "url": "https://github.com/ipld/js-dag-json/issues" }, - "homepage": "https://github.com/ipld/js-dag-json#readme", + "keywords": [ + "ipfs", + "ipld", + "multiformats" + ], + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" + }, + "type": "module", + "types": "./dist/src/index.d.ts", "typesVersions": { "*": { "*": [ - "types/*" + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" ], - "types/*": [ - "types/*" + "src/*": [ + "*", + "dist/*", + "dist/src/*", + "dist/src/*/index" ] } }, - "release": { - "branches": [ - "master" - ], - "plugins": [ - [ - "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", - "releaseRules": [ - { - "breaking": true, - "release": "major" - }, - { - "revert": true, - "release": "patch" - }, - { - "type": "feat", - "release": "minor" - }, - { - "type": "fix", - "release": "patch" - }, - { - "type": "chore", - "release": "patch" - }, - { - "type": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "scope": "no-release", - "release": false - } - ] - } - ], - [ - "@semantic-release/release-notes-generator", - { - "preset": "conventionalcommits", - "presetConfig": { - "types": [ - { - "type": "feat", - "section": "Features" - }, - { - "type": "fix", - "section": "Bug Fixes" - }, - { - "type": "chore", - "section": "Trivial Changes" - }, - { - "type": "docs", - "section": "Trivial Changes" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - [ - "@semantic-release/npm", - { - "pkgRoot": "dist" - } - ], - "@semantic-release/github", - "@semantic-release/git" + "files": [ + "src", + "dist", + "!dist/test", + "!**/*.tsbuildinfo" + ], + "exports": { + ".": { + "types": "./dist/src/index.d.ts", + "import": "./src/index.js" + } + }, + "eslintConfig": { + "extends": "ipfs", + "parserOptions": { + "sourceType": "module" + }, + "ignorePatterns": [ + "test/ts-use" ] + }, + "scripts": { + "clean": "aegir clean", + "lint": "aegir lint", + "build": "aegir build", + "release": "aegir release", + "test": "npm run lint && aegir test", + "test:ts": "npm run test --prefix test/ts-use", + "test:node": "aegir test -t node --cov", + "test:chrome": "aegir test -t browser --cov", + "test:chrome-webworker": "aegir test -t webworker", + "test:firefox": "aegir test -t browser -- --browser firefox", + "test:firefox-webworker": "aegir test -t webworker -- --browser firefox", + "test:electron-main": "aegir test -t electron-main", + "dep-check": "aegir dep-check" + }, + "dependencies": { + "cborg": "^1.5.4", + "multiformats": "^10.0.2" + }, + "devDependencies": { + "@ipld/garbage": "^6.0.0", + "aegir": "^37.5.6" } } diff --git a/index.js b/src/index.js similarity index 97% rename from index.js rename to src/index.js index b217d46..f1adc36 100644 --- a/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +/* eslint max-depth: ["error", 7] */ import { CID } from 'multiformats' import { base64 } from 'multiformats/bases/base64' import { Token, Type } from 'cborg' @@ -21,7 +22,7 @@ import * as cborgJson from 'cborg/json' * @returns {Token[]|null} */ function cidEncoder (obj) { - if (obj.asCID !== obj) { + if (obj['/'] == null || obj['/'] !== obj.bytes) { return null // any other kind of object } const cid = CID.asCID(obj) @@ -61,6 +62,7 @@ function bytesEncoder (bytes) { ] } +// eslint-disable-next-line jsdoc/require-returns-check /** * Intercept all `undefined` values from an object walk and reject the entire * object if we find one. diff --git a/test/test-basics.js b/test/test-basics.spec.js similarity index 90% rename from test/test-basics.js rename to test/test-basics.spec.js index b3c1ebe..5fe30d9 100644 --- a/test/test-basics.js +++ b/test/test-basics.spec.js @@ -1,26 +1,24 @@ -'use strict' /* eslint-env mocha */ -import { garbage } from 'ipld-garbage' -import chai from 'chai' -import { encode, decode } from '@ipld/dag-json' +import { garbage } from '@ipld/garbage' +import { assert } from 'aegir/chai' +import { encode, decode } from '../src/index.js' import { bytes, CID } from 'multiformats' -const { assert } = chai const same = assert.deepStrictEqual const test = it -const recode = byts => encode(decode(byts)) +const recode = (/** @type {Uint8Array} */ byts) => encode(decode(byts)) const link = CID.parse('bafyreifepiu23okq5zuyvyhsoiazv2icw2van3s7ko6d3ixl5jx2yj2yhu') describe('basic dag-json', () => { test('encode decode', () => { - let byts = encode({ hello: 'world' }) + const byts = encode({ hello: 'world' }) same(JSON.parse(bytes.toString(recode(byts))), { hello: 'world' }) const o = { link, byts: bytes.fromString('asdf'), n: null, o: {} } - byts = encode(o) - same(decode(byts), o) - same(bytes.isBinary(decode(byts).byts), true) + const byts2 = encode(o) + same(decode(byts2), o) + same(bytes.isBinary(decode(byts2).byts), true) }) test('encode decode 2', () => { @@ -59,7 +57,7 @@ describe('basic dag-json', () => { }) test('native types', () => { - const flip = obj => decode(encode(obj)) + const flip = (/** @type {any} */ obj) => decode(encode(obj)) same(flip('test'), 'test') same(flip(null), null) same(flip(12), 12) @@ -81,7 +79,7 @@ describe('basic dag-json', () => { }) test('bigints', () => { - const verify = (inp) => { + const verify = (/** @type {number | bigint} **/ inp) => { assert.strictEqual(decode(new TextEncoder().encode(String(inp))), inp) } @@ -133,6 +131,7 @@ describe('basic dag-json', () => { test('fuzz serialize and deserialize with garbage', function () { // filter out fuzz garbage for objects that are disqualified by DAG-JSON rules + /** @type {(obj: any) => boolean} */ const checkObj = (obj) => { if (Array.isArray(obj)) { return obj.every(checkObj) @@ -161,14 +160,9 @@ describe('basic dag-json', () => { if (!checkObj(original)) { continue } - try { - const encoded = encode(original) - const decoded = decode(encoded) - same(decoded, original) - } catch (err) { - console.log('Failed on fuzz object:', original) - throw err - } + const encoded = encode(original) + const decoded = decode(encoded) + same(decoded, original) } }) }) diff --git a/tsconfig.json b/tsconfig.json index 58e8c8d..4805fbc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,37 +1,14 @@ { + "extends": "aegir/src/config/tsconfig.aegir.json", "compilerOptions": { - "allowJs": true, - "checkJs": true, - "forceConsistentCasingInFileNames": true, - "noImplicitReturns": false, - "noImplicitAny": true, - "noImplicitThis": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "strictFunctionTypes": false, - "strictNullChecks": true, - "strictPropertyInitialization": true, - "strictBindCallApply": true, - "strict": true, - "alwaysStrict": true, - "esModuleInterop": true, - "target": "ES2018", - "moduleResolution": "node", - "declaration": true, - "declarationMap": true, - "outDir": "types", - "skipLibCheck": true, - "stripInternal": true, - "resolveJsonModule": true, - "baseUrl": ".", + "outDir": "dist", "emitDeclarationOnly": true }, "include": [ - "index.js" + "src", + "test" ], "exclude": [ - "node_modules" - ], - "compileOnSave": false + "test/ts-use" + ] }