From 5db8c3f89fb7bc62d58f450f9878b94e8cadc0bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Jun 2023 11:06:51 +0000 Subject: [PATCH 1/2] deps: bump aegir from 38.1.8 to 39.0.13 Bumps [aegir](https://github.com/ipfs/aegir) from 38.1.8 to 39.0.13. - [Release notes](https://github.com/ipfs/aegir/releases) - [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md) - [Commits](https://github.com/ipfs/aegir/compare/v38.1.8...v39.0.13) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package.json | 2 +- packages/protons-benchmark/package.json | 2 +- packages/protons-runtime/package.json | 2 +- packages/protons/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index d5be1af..6704012 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "release": "aegir run release" }, "dependencies": { - "aegir": "^38.0.0" + "aegir": "^39.0.13" }, "workspaces": [ "packages/*" diff --git a/packages/protons-benchmark/package.json b/packages/protons-benchmark/package.json index 167cd2e..813d272 100644 --- a/packages/protons-benchmark/package.json +++ b/packages/protons-benchmark/package.json @@ -73,7 +73,7 @@ "@protobuf-ts/plugin": "^2.8.1", "@protobuf-ts/runtime": "^2.8.1", "@types/benchmark": "^2.1.1", - "aegir": "^38.0.0", + "aegir": "^39.0.13", "benchmark": "^2.1.4", "pbjs": "^0.0.14", "protobufjs": "^7.0.0", diff --git a/packages/protons-runtime/package.json b/packages/protons-runtime/package.json index 16513bd..f4f0558 100644 --- a/packages/protons-runtime/package.json +++ b/packages/protons-runtime/package.json @@ -152,7 +152,7 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^38.0.0" + "aegir": "^39.0.13" }, "peerDependencies": { "uint8arraylist": "^2.3.2" diff --git a/packages/protons/package.json b/packages/protons/package.json index ebb0a4b..a8bb507 100644 --- a/packages/protons/package.json +++ b/packages/protons/package.json @@ -157,7 +157,7 @@ "protobufjs-cli": "^1.0.0" }, "devDependencies": { - "aegir": "^38.0.0", + "aegir": "^39.0.13", "long": "^5.2.0", "pbjs": "^0.0.14", "protobufjs": "^7.0.0", From 1eaf8ea1b59cc63999b286e75ee9fa30cbbacd38 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 30 Jun 2023 16:17:17 +0200 Subject: [PATCH 2/2] chore: fix linting --- .gitignore | 14 ++++------- package.json | 4 ---- packages/protons-benchmark/package.json | 24 ------------------- packages/protons-benchmark/src/decode.ts | 1 - packages/protons-benchmark/src/encode.ts | 1 - packages/protons-benchmark/src/index.ts | 2 -- packages/protons-benchmark/src/rpc.ts | 4 +--- packages/protons-runtime/package.json | 24 ------------------- .../protons-runtime/src/codecs/message.ts | 3 +-- packages/protons-runtime/src/decode.ts | 5 ++-- packages/protons-runtime/src/encode.ts | 2 +- packages/protons-runtime/src/utils.ts | 1 - packages/protons/bin/protons.ts | 1 - packages/protons/package.json | 24 ------------------- packages/protons/src/index.ts | 1 - packages/protons/test/compatibility.spec.ts | 9 +++---- packages/protons/test/maps.spec.ts | 4 +--- packages/protons/test/unsupported.spec.ts | 1 - 18 files changed, 13 insertions(+), 112 deletions(-) diff --git a/.gitignore b/.gitignore index 3d255fa..7ad9e67 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,9 @@ -# Coverage directory used by tools like istanbul -.nyc_output - +node_modules build dist -docs - -# Dependency directory -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git +.docs +.coverage node_modules -# Lock files package-lock.json yarn.lock -.clinic -coverage +.vscode diff --git a/package.json b/package.json index 6704012..1137aee 100644 --- a/package.json +++ b/package.json @@ -15,10 +15,6 @@ "interface", "libp2p" ], - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "private": true, "scripts": { "reset": "aegir run clean && aegir clean ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist", diff --git a/packages/protons-benchmark/package.json b/packages/protons-benchmark/package.json index 813d272..cfe2302 100644 --- a/packages/protons-benchmark/package.json +++ b/packages/protons-benchmark/package.json @@ -11,28 +11,8 @@ "bugs": { "url": "https://github.com/ipfs/protons/issues" }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "type": "module", "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, "files": [ "src", "dist", @@ -43,10 +23,6 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" - }, - "./status": { - "types": "./dist/src/status.d.ts", - "import": "./dist/src/status.js" } }, "eslintConfig": { diff --git a/packages/protons-benchmark/src/decode.ts b/packages/protons-benchmark/src/decode.ts index cdd798d..1506b7b 100644 --- a/packages/protons-benchmark/src/decode.ts +++ b/packages/protons-benchmark/src/decode.ts @@ -6,7 +6,6 @@ $ npx playwright-test dist/src/index.js --runner benchmark */ import Benchmark from 'benchmark' - import { decodeTest as pbjsDecodeTest } from './pbjs/bench.js' import { Test as ProtobufjsTest } from './protobufjs/bench.js' import { Test as ProtonsTest } from './protons/bench.js' diff --git a/packages/protons-benchmark/src/encode.ts b/packages/protons-benchmark/src/encode.ts index 119a01a..6218836 100644 --- a/packages/protons-benchmark/src/encode.ts +++ b/packages/protons-benchmark/src/encode.ts @@ -6,7 +6,6 @@ $ npx playwright-test dist/src/index.js --runner benchmark */ import Benchmark from 'benchmark' - import { encodeTest as pbjsEncodeTest } from './pbjs/bench.js' import { Test as ProtobufjsTest } from './protobufjs/bench.js' import { Test as ProtonsTest } from './protons/bench.js' diff --git a/packages/protons-benchmark/src/index.ts b/packages/protons-benchmark/src/index.ts index 760d892..540fd9e 100644 --- a/packages/protons-benchmark/src/index.ts +++ b/packages/protons-benchmark/src/index.ts @@ -6,9 +6,7 @@ $ npx playwright-test dist/src/index.js --runner benchmark */ import { expect } from 'aegir/chai' - import Benchmark from 'benchmark' - import { encodeTest as pbjsEncodeTest, decodeTest as pbjsDecodeTest } from './pbjs/bench.js' import { Test as ProtobufTsTest } from './protobuf-ts/bench.js' import { Test as ProtobufjsTest } from './protobufjs/bench.js' diff --git a/packages/protons-benchmark/src/rpc.ts b/packages/protons-benchmark/src/rpc.ts index fa9dc5e..c5af0f3 100644 --- a/packages/protons-benchmark/src/rpc.ts +++ b/packages/protons-benchmark/src/rpc.ts @@ -5,10 +5,8 @@ $ node dist/src/index.js $ npx playwright-test dist/src/index.js --runner benchmark */ -import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' - import Benchmark from 'benchmark' - +import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string' import { RPC as ProtobufjsRPC } from './protobufjs/rpc.js' import { RPC as ProtonsRPC } from './protons/rpc.js' diff --git a/packages/protons-runtime/package.json b/packages/protons-runtime/package.json index f4f0558..449eb6c 100644 --- a/packages/protons-runtime/package.json +++ b/packages/protons-runtime/package.json @@ -11,28 +11,8 @@ "bugs": { "url": "https://github.com/ipfs/protons/issues" }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "type": "module", "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, "files": [ "src", "dist", @@ -43,10 +23,6 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" - }, - "./status": { - "types": "./dist/src/status.d.ts", - "import": "./dist/src/status.js" } }, "eslintConfig": { diff --git a/packages/protons-runtime/src/codecs/message.ts b/packages/protons-runtime/src/codecs/message.ts index eca5171..a96f8e7 100644 --- a/packages/protons-runtime/src/codecs/message.ts +++ b/packages/protons-runtime/src/codecs/message.ts @@ -1,5 +1,4 @@ -import { createCodec, CODEC_TYPES, EncodeOptions } from '../codec.js' -import type { Codec } from '../codec.js' +import { createCodec, CODEC_TYPES, type EncodeOptions, type Codec } from '../codec.js' import type { Reader, Writer } from '../index.js' export interface Factory { diff --git a/packages/protons-runtime/src/decode.ts b/packages/protons-runtime/src/decode.ts index bd395ac..aa80e88 100644 --- a/packages/protons-runtime/src/decode.ts +++ b/packages/protons-runtime/src/decode.ts @@ -1,7 +1,6 @@ -import type { Uint8ArrayList } from 'uint8arraylist' - -import type { Codec } from './codec.js' import { reader } from './utils.js' +import type { Codec } from './codec.js' +import type { Uint8ArrayList } from 'uint8arraylist' export function decodeMessage (buf: Uint8Array | Uint8ArrayList, codec: Codec): T { const r = reader(buf instanceof Uint8Array ? buf : buf.subarray()) diff --git a/packages/protons-runtime/src/encode.ts b/packages/protons-runtime/src/encode.ts index 7a8b8b5..3a6822e 100644 --- a/packages/protons-runtime/src/encode.ts +++ b/packages/protons-runtime/src/encode.ts @@ -1,5 +1,5 @@ -import type { Codec } from './codec.js' import { writer } from './utils.js' +import type { Codec } from './codec.js' export function encodeMessage (message: T, codec: Codec): Uint8Array { const w = writer() diff --git a/packages/protons-runtime/src/utils.ts b/packages/protons-runtime/src/utils.ts index d125d64..7a746c6 100644 --- a/packages/protons-runtime/src/utils.ts +++ b/packages/protons-runtime/src/utils.ts @@ -8,7 +8,6 @@ import util from 'protobufjs/src/util/minimal.js' import WriterClass from 'protobufjs/src/writer.js' // @ts-expect-error no types import WriterBufferClass from 'protobufjs/src/writer_buffer.js' - import type { Reader, Writer } from './index.js' function configure (): void { diff --git a/packages/protons/bin/protons.ts b/packages/protons/bin/protons.ts index 55e6615..23ceee2 100644 --- a/packages/protons/bin/protons.ts +++ b/packages/protons/bin/protons.ts @@ -1,7 +1,6 @@ #! /usr/bin/env node import meow from 'meow' - import { generate } from '../src/index.js' async function main (): Promise { diff --git a/packages/protons/package.json b/packages/protons/package.json index a8bb507..1cc8a15 100644 --- a/packages/protons/package.json +++ b/packages/protons/package.json @@ -11,31 +11,11 @@ "bugs": { "url": "https://github.com/ipfs/protons/issues" }, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - }, "bin": { "protons": "./dist/bin/protons.js" }, "type": "module", "types": "./dist/src/index.d.ts", - "typesVersions": { - "*": { - "*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ], - "src/*": [ - "*", - "dist/*", - "dist/src/*", - "dist/src/*/index" - ] - } - }, "files": [ "src", "dist", @@ -46,10 +26,6 @@ ".": { "types": "./dist/src/index.d.ts", "import": "./dist/src/index.js" - }, - "./status": { - "types": "./dist/src/status.d.ts", - "import": "./dist/src/status.js" } }, "eslintConfig": { diff --git a/packages/protons/src/index.ts b/packages/protons/src/index.ts index ecb5481..e64c3ba 100644 --- a/packages/protons/src/index.ts +++ b/packages/protons/src/index.ts @@ -3,7 +3,6 @@ import fs from 'fs/promises' import path from 'path' import { promisify } from 'util' - import { main as pbjs } from 'protobufjs-cli/pbjs.js' export enum CODEC_TYPES { diff --git a/packages/protons/test/compatibility.spec.ts b/packages/protons/test/compatibility.spec.ts index de7e36c..0eb68e9 100644 --- a/packages/protons/test/compatibility.spec.ts +++ b/packages/protons/test/compatibility.spec.ts @@ -1,20 +1,17 @@ /* eslint-env mocha */ import fs from 'fs' - import { expect } from 'aegir/chai' - import Long from 'long' import pbjs from 'pbjs' -import protobufjs, { Type as PBType } from 'protobufjs' - +import protobufjs, { type Type as PBType } from 'protobufjs' import { Basic, Empty } from './fixtures/basic.js' +import { Message as Bitswap } from './fixtures/bitswap.js' import { CircuitRelay } from './fixtures/circuit.js' import { Optional, OptionalEnum } from './fixtures/optional.js' import { Peer } from './fixtures/peer.js' import { Singular, SingularEnum } from './fixtures/singular.js' import { AllTheTypes, AnEnum } from './fixtures/test.js' -import { Message as Bitswap } from './fixtures/bitswap.js' function longifyBigInts (obj: any): any { const output = { @@ -280,7 +277,7 @@ describe('encode', () => { } const root = protobufjs.loadSync('./test/fixtures/circuit.proto') - // @ts-expect-error + // @ts-expect-error root.nested is possibly undefined const PbCircuitRelay = root.nested.CircuitRelay as PBType const protobufJsBuf = PbCircuitRelay.encode(PbCircuitRelay.fromObject(message)).finish() diff --git a/packages/protons/test/maps.spec.ts b/packages/protons/test/maps.spec.ts index c73eb77..b8c1181 100644 --- a/packages/protons/test/maps.spec.ts +++ b/packages/protons/test/maps.spec.ts @@ -1,11 +1,9 @@ /* eslint-env mocha */ import { expect } from 'aegir/chai' - import Long from 'long' import protobufjs from 'protobufjs' - -import { MapTypes, SubMessage } from './fixtures/maps.js' +import { MapTypes, type SubMessage } from './fixtures/maps.js' function longifyBigInts (obj: any): any { const output = { diff --git a/packages/protons/test/unsupported.spec.ts b/packages/protons/test/unsupported.spec.ts index 216198e..7f29154 100644 --- a/packages/protons/test/unsupported.spec.ts +++ b/packages/protons/test/unsupported.spec.ts @@ -1,7 +1,6 @@ /* eslint-env mocha */ import { expect } from 'aegir/chai' - import { generate } from '../src/index.js' describe('unsupported', () => {