diff --git a/package.json b/package.json index cd3d79a..b0bc528 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "docs": "aegir docs" }, "dependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.4" }, "workspaces": [ "packages/*" diff --git a/packages/protons-benchmark/README.md b/packages/protons-benchmark/README.md index 5f50673..e9ba641 100644 --- a/packages/protons-benchmark/README.md +++ b/packages/protons-benchmark/README.md @@ -11,6 +11,7 @@ - [Install](#install) - [Usage](#usage) +- [API Docs](#api-docs) - [License](#license) - [Contribute](#contribute) @@ -70,6 +71,10 @@ protobuf.js x 18,937 ops/sec ±0.55% (65 runs sampled) Fastest is pbjs,protobuf.js ``` +## API Docs + +- + ## License Licensed under either of diff --git a/packages/protons-benchmark/package.json b/packages/protons-benchmark/package.json index e18312e..925ca33 100644 --- a/packages/protons-benchmark/package.json +++ b/packages/protons-benchmark/package.json @@ -28,6 +28,7 @@ "eslintConfig": { "extends": "ipfs", "parserOptions": { + "project": true, "sourceType": "module" }, "ignorePatterns": [ @@ -49,7 +50,7 @@ "@protobuf-ts/plugin": "^2.8.1", "@protobuf-ts/runtime": "^2.8.1", "@types/benchmark": "^2.1.1", - "aegir": "^40.0.8", + "aegir": "^41.0.4", "benchmark": "^2.1.4", "pbjs": "^0.0.14", "protobufjs": "^7.0.0", diff --git a/packages/protons-runtime/README.md b/packages/protons-runtime/README.md index 0c8a23f..1d11b22 100644 --- a/packages/protons-runtime/README.md +++ b/packages/protons-runtime/README.md @@ -10,6 +10,7 @@ ## Table of contents - [Install](#install) +- [API Docs](#api-docs) - [License](#license) - [Contribute](#contribute) @@ -21,6 +22,10 @@ $ npm i protons-runtime Contains shared code to reduce code duplication between modules transpiled by protons. +## API Docs + +- + ## License Licensed under either of diff --git a/packages/protons-runtime/package.json b/packages/protons-runtime/package.json index 1235369..4eecebb 100644 --- a/packages/protons-runtime/package.json +++ b/packages/protons-runtime/package.json @@ -28,6 +28,7 @@ "eslintConfig": { "extends": "ipfs", "parserOptions": { + "project": true, "sourceType": "module" } }, @@ -128,7 +129,7 @@ "uint8arraylist": "^2.4.3" }, "devDependencies": { - "aegir": "^40.0.8" + "aegir": "^41.0.4" }, "peerDependencies": { "uint8arraylist": "^2.3.2" diff --git a/packages/protons-runtime/src/index.ts b/packages/protons-runtime/src/index.ts index 64155c8..2b4b823 100644 --- a/packages/protons-runtime/src/index.ts +++ b/packages/protons-runtime/src/index.ts @@ -30,98 +30,98 @@ export interface Writer { /** * Writes an unsigned 32 bit value as a varint */ - uint32: (value: number) => Writer + uint32(value: number): Writer /** * Writes a signed 32 bit value as a varint` */ - int32: (value: number) => Writer + int32(value: number): Writer /** * Writes a 32 bit value as a varint, zig-zag encoded */ - sint32: (value: number) => Writer + sint32(value: number): Writer /** * Writes an unsigned 64 bit value as a varint */ - uint64: (value: bigint) => Writer + uint64(value: bigint): Writer /** * Writes a signed 64 bit value as a varint */ - int64: (value: bigint) => Writer + int64(value: bigint): Writer /** * Writes a signed 64 bit value as a varint, zig-zag encoded */ - sint64: (value: bigint) => Writer + sint64(value: bigint): Writer /** * Writes a boolish value as a varint */ - bool: (value: boolean) => Writer + bool(value: boolean): Writer /** * Writes an unsigned 32 bit value as fixed 32 bits */ - fixed32: (value: number) => Writer + fixed32(value: number): Writer /** * Writes a signed 32 bit value as fixed 32 bits */ - sfixed32: (value: number) => Writer + sfixed32(value: number): Writer /** * Writes an unsigned 64 bit value as fixed 64 bits */ - fixed64: (value: bigint) => Writer + fixed64(value: bigint): Writer /** * Writes a signed 64 bit value as fixed 64 bits */ - sfixed64: (value: bigint) => Writer + sfixed64(value: bigint): Writer /** * Writes a float (32 bit) */ - float: (value: number) => Writer + float(value: number): Writer /** * Writes a double (64 bit float) */ - double: (value: number) => Writer + double(value: number): Writer /** * Writes a sequence of bytes */ - bytes: (value: Uint8Array) => Writer + bytes(value: Uint8Array): Writer /** * Writes a string */ - string: (value: string) => Writer + string(value: string): Writer /** * Forks this writer's state by pushing it to a stack. * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state. */ - fork: () => Writer + fork(): Writer /** * Resets this instance to the last state. */ - reset: () => Writer + reset(): Writer /** * Resets to the last state and appends the fork state's current write length as a varint followed by its operations. */ - ldelim: () => Writer + ldelim(): Writer /** * Finishes the write operation */ - finish: () => Uint8Array + finish(): Uint8Array } export interface Reader { @@ -143,85 +143,85 @@ export interface Reader { /** * Reads a varint as an unsigned 32 bit value */ - uint32: () => number + uint32(): number /** * Reads a varint as a signed 32 bit value */ - int32: () => number + int32(): number /** * Reads a zig-zag encoded varint as a signed 32 bit value */ - sint32: () => number + sint32(): number /** * Reads a varint as a boolean */ - bool: () => boolean + bool(): boolean /** * Reads fixed 32 bits as an unsigned 32 bit integer */ - fixed32: () => number + fixed32(): number /** * Reads fixed 32 bits as a signed 32 bit integer */ - sfixed32: () => number + sfixed32(): number /** * Reads a float (32 bit) as a number */ - float: () => number + float(): number /** * Reads a double (64 bit float) as a number */ - double: () => number + double(): number /** * Reads a sequence of bytes preceded by its length as a varint */ - bytes: () => Uint8Array + bytes(): Uint8Array /** * Reads a string preceded by its byte length as a varint */ - string: () => string + string(): string /** * Skips the specified number of bytes if specified, otherwise skips a varints` */ - skip: (length?: number) => void + skip(length?: number): void /** * Skips the next element of the specified wire type */ - skipType: (wireType: number) => void + skipType(wireType: number): void /** * Reads a varint as a signed 64 bit value */ - int64: () => bigint + int64(): bigint /** * Reads a varint as an unsigned 64 bit value */ - uint64: () => bigint + uint64(): bigint /** * Reads a zig-zag encoded varint as a signed 64 bit value */ - sint64: () => bigint + sint64(): bigint /** * Reads fixed 64 bits */ - fixed64: () => bigint + fixed64(): bigint /** * Reads zig-zag encoded fixed 64 bits */ - sfixed64: () => bigint + sfixed64(): bigint } diff --git a/packages/protons/README.md b/packages/protons/README.md index ea435bb..a0780ae 100644 --- a/packages/protons/README.md +++ b/packages/protons/README.md @@ -13,6 +13,7 @@ - [Usage](#usage) - [Differences from protobuf.js](#differences-from-protobufjs) - [Missing features](#missing-features) +- [API Docs](#api-docs) - [License](#license) - [Contribute](#contribute) @@ -76,6 +77,10 @@ It does have one or two differences: Some features are missing `OneOf`s, etc due to them not being needed so far in ipfs/libp2p. If these features are important to you, please open PRs implementing them along with tests comparing the generated bytes to `protobuf.js` and `pbjs`. +## API Docs + +- + ## License Licensed under either of diff --git a/packages/protons/bin/protons.ts b/packages/protons/bin/protons.ts index 0ca88a0..d624696 100644 --- a/packages/protons/bin/protons.ts +++ b/packages/protons/bin/protons.ts @@ -14,6 +14,7 @@ async function main (): Promise { Examples $ protons ./path/to/file.proto ./path/to/other/file.proto `, { + // @ts-expect-error wrong version is hoisted?! importMeta: import.meta, flags: { output: { diff --git a/packages/protons/package.json b/packages/protons/package.json index ed957ca..5ea0075 100644 --- a/packages/protons/package.json +++ b/packages/protons/package.json @@ -31,6 +31,7 @@ "eslintConfig": { "extends": "ipfs", "parserOptions": { + "project": true, "sourceType": "module" } }, @@ -133,7 +134,7 @@ "protobufjs-cli": "^1.0.0" }, "devDependencies": { - "aegir": "^40.0.8", + "aegir": "^41.0.4", "long": "^5.2.0", "pbjs": "^0.0.14", "protobufjs": "^7.0.0",