Skip to content

Commit

Permalink
deps: remove lerna, update aegir (#76)
Browse files Browse the repository at this point in the history
Removes lerna now that aegir has run and exec commands, updates aegir
to the latest version and fixes all linting errors.
  • Loading branch information
achingbrain committed Jan 12, 2023
1 parent 33775d4 commit 83a24f2
Show file tree
Hide file tree
Showing 21 changed files with 103 additions and 148 deletions.
26 changes: 10 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
# protons <!-- omit in toc -->

[![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/protons.svg?style=flat-square)](https://codecov.io/gh/ipfs/protons)
[![CI](https://img.shields.io/github/workflow/status/ipfs/protons/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/protons/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Protobuf to ts transpiler
## Table of contents <!-- omit in toc -->

- [Structure](#structure)
- [Packages](#packages)
- [Contribute](#contribute)
- [License](#license)
- [Contribute](#contribute-1)
- [Contribute](#contribute)

## Structure

Expand All @@ -30,14 +28,6 @@ Transpiles `.proto` files to `.ts` - uses `Uint8Array` for `byte` fields and `Bi
- [`/packages/protons-benchmark`](./packages/protons-benchmark) A benchmark suite
- [`/packages/protons-runtime`](./packages/protons-runtime) Shared components that turn values to bytes and back again

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/protons/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)

## License

Licensed under either of
Expand All @@ -47,8 +37,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/protons/issues).

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).

This repository falls under 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)
10 changes: 0 additions & 10 deletions lerna.json

This file was deleted.

31 changes: 15 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,23 @@
},
"private": true,
"scripts": {
"reset": "lerna run clean && rimraf ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
"test": "lerna run --concurrency 1 test -- --",
"test:node": "lerna run --concurrency 1 test:node -- --",
"test:chrome": "lerna run --concurrency 1 test:chrome -- --",
"test:chrome-webworker": "lerna --concurrency 1 run test:chrome-webworker -- --",
"test:firefox": "lerna run --concurrency 1 test:firefox -- --",
"test:firefox-webworker": "lerna run --concurrency 1 test:firefox-webworker -- --",
"test:electron-main": "lerna run --concurrency 1 test:electron-main -- --",
"test:electron-renderer": "lerna run --concurrency 1 test:electron-renderer -- --",
"clean": "lerna run clean",
"build": "lerna run build",
"lint": "lerna run lint",
"dep-check": "lerna run dep-check",
"release": "lerna run release --concurrency 1 -- --"
"reset": "aegir run clean && aegir clean ./node_modules ./package-lock.json packages/*/node_modules packages/*/package-lock.json packages/*/dist",
"test": "aegir run test",
"test:node": "aegir run test:node",
"test:chrome": "aegir run test:chrome",
"test:chrome-webworker": "aegir run test:chrome-webworker",
"test:firefox": "aegir run test:firefox",
"test:firefox-webworker": "aegir run test:firefox-webworker",
"test:electron-main": "aegir run test:electron-main",
"test:electron-renderer": "aegir run test:electron-renderer",
"clean": "aegir run clean",
"build": "aegir run build",
"lint": "aegir run lint",
"dep-check": "aegir run dep-check",
"release": "aegir run release"
},
"dependencies": {
"lerna": "^6.0.0",
"rimraf": "^3.0.2"
"aegir": "^38.0.0"
},
"workspaces": [
"packages/*"
Expand Down
15 changes: 9 additions & 6 deletions packages/protons-benchmark/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# protons-benchmark <!-- omit in toc -->

[![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/protons.svg?style=flat-square)](https://codecov.io/gh/ipfs/protons)
[![CI](https://img.shields.io/github/workflow/status/ipfs/protons/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/protons/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Protobuf to ts transpiler
Expand Down Expand Up @@ -80,8 +79,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/protons/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)
7 changes: 4 additions & 3 deletions packages/protons-benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -63,7 +63,7 @@
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"dep-check": "aegir dep-check",
"dep-check": "aegir dep-check --ignore @protobuf-ts/plugin pbjs protons",
"build": "aegir build --no-bundle && cp -R src/protobufjs dist/src/protobufjs",
"prestart": "npm run build",
"start": "node dist/src/index.js",
Expand All @@ -73,12 +73,13 @@
"@protobuf-ts/plugin": "^2.8.1",
"@protobuf-ts/runtime": "^2.8.1",
"@types/benchmark": "^2.1.1",
"aegir": "^37.0.5",
"aegir": "^38.0.0",
"benchmark": "^2.1.4",
"pbjs": "^0.0.14",
"protobufjs": "^7.0.0",
"protons": "^6.0.0",
"protons-runtime": "^4.0.0",
"uint8arraylist": "^2.4.3",
"uint8arrays": "^4.0.2"
},
"private": true
Expand Down
2 changes: 1 addition & 1 deletion packages/protons-benchmark/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const message = {
payload: Uint8Array.from([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
}

function expectDecodedCorrectly (result: any) {
function expectDecodedCorrectly (result: any): void {
expect(result).to.have.nested.property('meh.lol', message.meh.lol)
expect(result).to.have.nested.property('meh.b.tmp.baz', message.meh.b.tmp.baz)
expect(result).to.have.property('hello', message.hello)
Expand Down
37 changes: 8 additions & 29 deletions packages/protons-benchmark/src/protons/bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */

import { encodeMessage, decodeMessage, message, writer, enumeration } from 'protons-runtime'
import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'
import type { Codec } from 'protons-runtime'

Expand Down Expand Up @@ -78,17 +78,10 @@ export namespace Bar {
}

if (obj.tmp != null) {
const mw = writer()
Foo.codec().encode(obj.tmp, mw, {
lengthDelimited: false,
w.uint32(10)
Foo.codec().encode(obj.tmp, w, {
writeDefaults: false
})
const buf = mw.finish()

if (buf.byteLength > 0) {
w.uint32(10)
w.bytes(buf)
}
}

if (opts.lengthDelimited !== false) {
Expand Down Expand Up @@ -141,7 +134,7 @@ enum __FOOValues {
}

export namespace FOO {
export const codec = () => {
export const codec = (): Codec<FOO> => {
return enumeration<FOO>(__FOOValues)
}
}
Expand Down Expand Up @@ -226,17 +219,10 @@ export namespace Lol {
}

if (obj.b != null) {
const mw = writer()
Bar.codec().encode(obj.b, mw, {
lengthDelimited: false,
w.uint32(18)
Bar.codec().encode(obj.b, w, {
writeDefaults: false
})
const buf = mw.finish()

if (buf.byteLength > 0) {
w.uint32(18)
w.bytes(buf)
}
}

if (opts.lengthDelimited !== false) {
Expand Down Expand Up @@ -297,17 +283,10 @@ export namespace Test {
}

if (obj.meh != null) {
const mw = writer()
Lol.codec().encode(obj.meh, mw, {
lengthDelimited: false,
w.uint32(50)
Lol.codec().encode(obj.meh, w, {
writeDefaults: false
})
const buf = mw.finish()

if (buf.byteLength > 0) {
w.uint32(50)
w.bytes(buf)
}
}

if (obj.hello != null) {
Expand Down
26 changes: 10 additions & 16 deletions packages/protons-runtime/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# protons-runtime <!-- omit in toc -->

[![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/protons.svg?style=flat-square)](https://codecov.io/gh/ipfs/protons)
[![CI](https://img.shields.io/github/workflow/status/ipfs/protons/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/protons/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/ipfs/protons/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Shared code to make your bundle smaller when running protons in your app
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Contribute](#contribute)
- [License](#license)
- [Contribute](#contribute-1)
- [Contribute](#contribute)

## Install

Expand All @@ -23,14 +21,6 @@ $ npm i protons-runtime

Contains shared code to reduce code duplication between modules transpiled by protons.

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/protons/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md)

## License

Licensed under either of
Expand All @@ -40,8 +30,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/protons/issues).

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).

This repository falls under 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)
10 changes: 5 additions & 5 deletions packages/protons-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand Down Expand Up @@ -149,12 +149,12 @@
},
"dependencies": {
"protobufjs": "^7.0.0",
"uint8arraylist": "^2.3.2"
"uint8arraylist": "^2.4.3"
},
"devDependencies": {
"aegir": "^38.0.0"
},
"peerDependencies": {
"uint8arraylist": "^2.3.2"
},
"devDependencies": {
"aegir": "^37.0.5"
}
}
2 changes: 1 addition & 1 deletion packages/protons-runtime/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import WriterBufferClass from 'protobufjs/src/writer_buffer.js'
import util from 'protobufjs/src/util/minimal.js'
import type { Reader, Writer } from './index.js'

function configure () {
function configure (): void {
util._configure()
ReaderClass._configure(ReaderBufferClass)
WriterClass._configure(WriterBufferClass)
Expand Down
Loading

0 comments on commit 83a24f2

Please sign in to comment.