From bfe10c673f8d707d8ffddd622218af88f80b2d29 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 24 Mar 2026 16:01:26 +0100 Subject: [PATCH 1/2] fix: update project config Updates to latest project config --- .github/dependabot.yml | 10 +- .github/workflows/semantic-pull-request.yml | 12 ++ .gitignore | 2 + README.md | 16 +- package.json | 95 +-------- packages/protons-benchmark/package.json | 50 +---- packages/protons-runtime/CODE_OF_CONDUCT.md | 3 + packages/protons-runtime/LICENSE | 4 - packages/protons-runtime/LICENSE-APACHE | 202 +++++++++++++++++++- packages/protons-runtime/README.md | 8 +- packages/protons-runtime/package.json | 109 +++++++++-- packages/protons-runtime/typedoc.json | 1 + packages/protons/CODE_OF_CONDUCT.md | 3 + packages/protons/LICENSE | 4 - packages/protons/LICENSE-APACHE | 202 +++++++++++++++++++- packages/protons/README.md | 6 +- packages/protons/package.json | 112 +++++++++-- packages/protons/typedoc.json | 1 + typedoc.json | 10 +- 19 files changed, 658 insertions(+), 192 deletions(-) create mode 100644 .github/workflows/semantic-pull-request.yml create mode 100644 packages/protons-runtime/CODE_OF_CONDUCT.md delete mode 100644 packages/protons-runtime/LICENSE create mode 100644 packages/protons/CODE_OF_CONDUCT.md delete mode 100644 packages/protons/LICENSE diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 0bc3b42..66475ef 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,13 @@ 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)" + prefix-development: "chore" +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: chore diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 0000000..8c0b9ea --- /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: ipdxco/unified-github-workflows/.github/workflows/reusable-semantic-pull-request.yml@v1 diff --git a/.gitignore b/.gitignore index 7ad9e67..f115d26 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ node_modules package-lock.json yarn.lock .vscode +.tmp-compiled-docs +tsconfig-doc-check.aegir.json diff --git a/README.md b/README.md index e52a0cb..3a54310 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# protons +# protons [![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) @@ -7,13 +7,13 @@ > Protobuf to ts transpiler -`protons` is a high performance implementation of [Protocol Buffers v3](https://protobuf.dev/programming-guides/proto3/). - # Packages -- [`/packages/protons`](./packages/protons) The transpiler -- [`/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 +- [`packages/protons`](https://github.com/ipfs/protons/tree/main/packages/protons) Protobuf to ts transpiler +- [`packages/protons-benchmark`](https://github.com/ipfs/protons/tree/main/packages/protons-benchmark) Protobuf to ts transpiler +- [`packages/protons-runtime`](https://github.com/ipfs/protons/tree/main/packages/protons-runtime) Shared code to make your bundle smaller when running protons in your app + +`protons` is a high performance implementation of [Protocol Buffers v3](https://protobuf.dev/programming-guides/proto3/). # API Docs @@ -23,8 +23,8 @@ Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/protons/blob/main/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/protons/blob/main/LICENSE-MIT) / ) # Contribute diff --git a/package.json b/package.json index 3ee14d5..48ec891 100644 --- a/package.json +++ b/package.json @@ -32,101 +32,18 @@ "lint": "aegir run lint", "dep-check": "aegir run dep-check", "doc-check": "aegir run doc-check", + "spell-check": "aegir spell-check", "release": "run-s build docs:no-publish npm:release docs", - "npm:release": "aegir run release", + "npm:release": "aegir run release --concurrency 1", "docs": "aegir docs", "docs:no-publish": "aegir docs --publish false" }, - "dependencies": { - "aegir": "^47.0.5", + "devDependencies": { + "aegir": "^47.0.24", "npm-run-all": "^4.1.5" }, + "type": "module", "workspaces": [ "packages/*" - ], - "release": { - "branches": [ - "main" - ], - "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": "docs", - "release": "patch" - }, - { - "type": "test", - "release": "patch" - }, - { - "type": "deps", - "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": "Documentation" - }, - { - "type": "deps", - "section": "Dependencies" - }, - { - "type": "test", - "section": "Tests" - } - ] - } - } - ], - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/github", - "@semantic-release/git" - ] - } + ] } diff --git a/packages/protons-benchmark/package.json b/packages/protons-benchmark/package.json index 79ef69d..c600f31 100644 --- a/packages/protons-benchmark/package.json +++ b/packages/protons-benchmark/package.json @@ -3,41 +3,7 @@ "version": "0.0.0", "description": "Protobuf to ts transpiler", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/protons/tree/master/packages/protons-benchmark#readme", - "repository": { - "type": "git", - "url": "git+https://github.com/ipfs/protons.git" - }, - "bugs": { - "url": "https://github.com/ipfs/protons/issues" - }, "type": "module", - "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], - "exports": { - ".": { - "types": "./dist/src/index.d.ts", - "import": "./dist/src/index.js" - } - }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - }, - "ignorePatterns": [ - "src/implementations/pbjs/*", - "src/implementations/protobuf-es/*", - "src/implementations/protobuf-ts/*", - "src/implementations/protobufjs/*" - ] - }, "scripts": { "clean": "aegir clean", "lint": "aegir lint", @@ -50,18 +16,18 @@ "start:browser": "npx playwright-test dist/src/implementations/index.js --runner benchmark" }, "dependencies": { - "@bufbuild/protobuf": "^2.0.0", - "@bufbuild/protoc-gen-es": "^2.0.0", - "@protobuf-ts/plugin": "^2.8.1", - "@protobuf-ts/runtime": "^2.8.1", - "@types/benchmark": "^2.1.1", - "aegir": "^47.0.5", + "@bufbuild/protobuf": "^2.11.0", + "@bufbuild/protoc-gen-es": "^2.11.0", + "@protobuf-ts/plugin": "^2.11.1", + "@protobuf-ts/runtime": "^2.11.1", + "@types/benchmark": "^2.1.5", + "aegir": "^47.0.26", "benchmark": "^2.1.4", "pbjs": "^0.0.14", - "protobufjs": "^7.0.0", + "protobufjs": "^7.5.4", "protons": "^7.0.0", "protons-runtime": "^5.0.0", - "uint8arraylist": "^2.4.3" + "uint8arraylist": "^2.4.8" }, "private": true } diff --git a/packages/protons-runtime/CODE_OF_CONDUCT.md b/packages/protons-runtime/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6b0fa54 --- /dev/null +++ b/packages/protons-runtime/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Contributor Code of Conduct + +This project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) diff --git a/packages/protons-runtime/LICENSE b/packages/protons-runtime/LICENSE deleted file mode 100644 index 20ce483..0000000 --- a/packages/protons-runtime/LICENSE +++ /dev/null @@ -1,4 +0,0 @@ -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/packages/protons-runtime/LICENSE-APACHE b/packages/protons-runtime/LICENSE-APACHE index 14478a3..b09cd78 100644 --- a/packages/protons-runtime/LICENSE-APACHE +++ b/packages/protons-runtime/LICENSE-APACHE @@ -1,5 +1,201 @@ -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 +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -http://www.apache.org/licenses/LICENSE-2.0 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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. + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + 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/packages/protons-runtime/README.md b/packages/protons-runtime/README.md index 470d2ba..3dfd88e 100644 --- a/packages/protons-runtime/README.md +++ b/packages/protons-runtime/README.md @@ -1,4 +1,4 @@ -# protons-runtime +# protons-runtime [![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) @@ -38,8 +38,6 @@ npm i protons-runtime $ npm i protons-runtime ``` -Contains shared code to reduce code duplication between modules transpiled by protons. - # API Docs - @@ -48,8 +46,8 @@ Contains shared code to reduce code duplication between modules transpiled by pr Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/protons/blob/main/packages/protons-runtime/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/protons/blob/main/packages/protons-runtime/LICENSE-MIT) / ) # Contribute diff --git a/packages/protons-runtime/package.json b/packages/protons-runtime/package.json index c8cdf41..91305ce 100644 --- a/packages/protons-runtime/package.json +++ b/packages/protons-runtime/package.json @@ -3,7 +3,7 @@ "version": "5.4.0", "description": "Shared code to make your bundle smaller when running protons in your app", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/protons/tree/master/packages/protons-runtime#readme", + "homepage": "https://github.com/ipfs/protons/tree/main/packages/protons-runtime#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/protons.git" @@ -18,7 +18,6 @@ "type": "module", "types": "./dist/src/index.d.ts", "files": [ - "protons.proto", "src", "dist", "!dist/test", @@ -30,12 +29,98 @@ "import": "./dist/src/index.js" } }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - } + "release": { + "branches": [ + "main" + ], + "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": "docs", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "deps", + "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": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "package.json" + ] + } + ] + ] }, "scripts": { "clean": "aegir clean", @@ -46,11 +131,11 @@ "release": "aegir release" }, "dependencies": { - "uint8-varint": "^2.0.2", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^5.0.1" + "uint8-varint": "^2.0.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" }, "devDependencies": { - "aegir": "^47.0.5" + "aegir": "^47.0.26" } } diff --git a/packages/protons-runtime/typedoc.json b/packages/protons-runtime/typedoc.json index f599dc7..db0b074 100644 --- a/packages/protons-runtime/typedoc.json +++ b/packages/protons-runtime/typedoc.json @@ -1,4 +1,5 @@ { + "readme": "none", "entryPoints": [ "./src/index.ts" ] diff --git a/packages/protons/CODE_OF_CONDUCT.md b/packages/protons/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..6b0fa54 --- /dev/null +++ b/packages/protons/CODE_OF_CONDUCT.md @@ -0,0 +1,3 @@ +# Contributor Code of Conduct + +This project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md) diff --git a/packages/protons/LICENSE b/packages/protons/LICENSE deleted file mode 100644 index 20ce483..0000000 --- a/packages/protons/LICENSE +++ /dev/null @@ -1,4 +0,0 @@ -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/packages/protons/LICENSE-APACHE b/packages/protons/LICENSE-APACHE index 14478a3..b09cd78 100644 --- a/packages/protons/LICENSE-APACHE +++ b/packages/protons/LICENSE-APACHE @@ -1,5 +1,201 @@ -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 +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -http://www.apache.org/licenses/LICENSE-2.0 + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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. + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + 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/packages/protons/README.md b/packages/protons/README.md index 32dd657..b7a4208 100644 --- a/packages/protons/README.md +++ b/packages/protons/README.md @@ -1,4 +1,4 @@ -# protons +# protons [![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) @@ -227,8 +227,8 @@ $ npm i protons Licensed under either of -- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / ) -- MIT ([LICENSE-MIT](LICENSE-MIT) / ) +- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/protons/blob/main/packages/protons/LICENSE-APACHE) / ) +- MIT ([LICENSE-MIT](https://github.com/ipfs/protons/blob/main/packages/protons/LICENSE-MIT) / ) # Contribute diff --git a/packages/protons/package.json b/packages/protons/package.json index 2ab64fe..402e74b 100644 --- a/packages/protons/package.json +++ b/packages/protons/package.json @@ -3,7 +3,7 @@ "version": "7.5.0", "description": "Protobuf to ts transpiler", "license": "Apache-2.0 OR MIT", - "homepage": "https://github.com/ipfs/protons/tree/master/packages/protons#readme", + "homepage": "https://github.com/ipfs/protons/tree/main/packages/protons#readme", "repository": { "type": "git", "url": "git+https://github.com/ipfs/protons.git" @@ -32,12 +32,98 @@ "import": "./dist/src/index.js" } }, - "eslintConfig": { - "extends": "ipfs", - "parserOptions": { - "project": true, - "sourceType": "module" - } + "release": { + "branches": [ + "main" + ], + "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": "docs", + "release": "patch" + }, + { + "type": "test", + "release": "patch" + }, + { + "type": "deps", + "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": "Documentation" + }, + { + "type": "deps", + "section": "Dependencies" + }, + { + "type": "test", + "section": "Tests" + } + ] + } + } + ], + "@semantic-release/changelog", + "@semantic-release/npm", + "@semantic-release/github", + [ + "@semantic-release/git", + { + "assets": [ + "CHANGELOG.md", + "package.json" + ] + } + ] + ] }, "scripts": { "clean": "aegir clean", @@ -51,16 +137,16 @@ }, "dependencies": { "meow": "^14.1.0", - "protobufjs-cli": "^1.0.0", + "protobufjs-cli": "^1.2.0", "protons-runtime": "^5.0.0" }, "devDependencies": { - "aegir": "^47.0.5", + "aegir": "^47.0.26", "it-all": "^3.0.9", - "long": "^5.2.0", + "long": "^5.3.2", "pbjs": "^0.0.14", - "protobufjs": "^7.0.0", - "uint8arraylist": "^2.4.3", - "uint8arrays": "^5.0.1" + "protobufjs": "^7.5.4", + "uint8arraylist": "^2.4.8", + "uint8arrays": "^5.1.0" } } diff --git a/packages/protons/typedoc.json b/packages/protons/typedoc.json index f599dc7..db0b074 100644 --- a/packages/protons/typedoc.json +++ b/packages/protons/typedoc.json @@ -1,4 +1,5 @@ { + "readme": "none", "entryPoints": [ "./src/index.ts" ] diff --git a/typedoc.json b/typedoc.json index 79f1bd7..b418d23 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,7 +1,9 @@ { "$schema": "https://typedoc.org/schema.json", - "name": "Protons", - "exclude": [ - "packages/protons-benchmark" - ] + "name": "protons", + "readme": "./README.md", + "headings": { + "readme": false, + "document": false + } } From d9d9f87ca801401c55cf90a86f8df0b1c3b26df3 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Tue, 24 Mar 2026 16:21:05 +0100 Subject: [PATCH 2/2] chore: fix spelling --- .cspell.json | 11 +++++++++++ .github/dictionary.txt | 21 +++++++++++++++++++++ packages/protons/README.md | 2 +- packages/protons/src/index.ts | 2 +- packages/protons/test/compatibility.spec.ts | 4 ++-- packages/protons/test/maps.spec.ts | 4 ++-- packages/protons/test/oneof.spec.ts | 4 ++-- 7 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 .cspell.json create mode 100644 .github/dictionary.txt diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..ce02f35 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,11 @@ +{ + "import": [ + "./node_modules/aegir/cspell.json" + ], + "dictionaries": ["project"], + "dictionaryDefinitions": [{ + "name": "project", + "path": "./.github/dictionary.txt", + "addWords": true + }] +} diff --git a/.github/dictionary.txt b/.github/dictionary.txt new file mode 100644 index 0000000..7b2a1d2 --- /dev/null +++ b/.github/dictionary.txt @@ -0,0 +1,21 @@ +prestart +pbjs +sdkljfoee +protoc +boolish +sfixed +varints +longbits +deopt +transpiles +ints +jstype +oneofs +arraylist +bigintify +longify +arrayify +protonbufjs +dont +connmanager +peerstore diff --git a/packages/protons/README.md b/packages/protons/README.md index b7a4208..80ddfc2 100644 --- a/packages/protons/README.md +++ b/packages/protons/README.md @@ -69,7 +69,7 @@ console.info(decoded.message) ## Differences from protobuf.js -This module uses the internal reader/writer from `protobuf.js` as it is highly optimised and there's no point reinventing the wheel. +This module uses the internal reader/writer from `protobuf.js` as it is highly optimized and there's no point reinventing the wheel. It does have one or two differences: diff --git a/packages/protons/src/index.ts b/packages/protons/src/index.ts index 4e12751..fd87d21 100644 --- a/packages/protons/src/index.ts +++ b/packages/protons/src/index.ts @@ -46,7 +46,7 @@ * * ## Differences from protobuf.js * - * This module uses the internal reader/writer from `protobuf.js` as it is highly optimised and there's no point reinventing the wheel. + * This module uses the internal reader/writer from `protobuf.js` as it is highly optimized and there's no point reinventing the wheel. * * It does have one or two differences: * diff --git a/packages/protons/test/compatibility.spec.ts b/packages/protons/test/compatibility.spec.ts index f501924..f5277fb 100644 --- a/packages/protons/test/compatibility.spec.ts +++ b/packages/protons/test/compatibility.spec.ts @@ -84,14 +84,14 @@ function normalizeProtonbufjs (obj: any, target: any): any { output = uint8ArrayifyBytes(output) for (const key of Object.keys(output)) { - // protobujs sets unset message fields to `null`, protons does not set the field at all + // protobufjs sets unset message fields to `null`, protons does not set the field at all if (output[key] === null && target[key] == null) { delete output[key] } } for (const key of Object.keys(target)) { - // protobujs uses plain objects instead of maps + // protobufjs uses plain objects instead of maps if (target[key] instanceof Map) { output[key] = new Map(Object.entries(output[key])) } diff --git a/packages/protons/test/maps.spec.ts b/packages/protons/test/maps.spec.ts index 73214af..418e217 100644 --- a/packages/protons/test/maps.spec.ts +++ b/packages/protons/test/maps.spec.ts @@ -75,14 +75,14 @@ function normalizeProtonbufjs (obj: any, target: any): any { output = uint8ArrayifyBytes(output) for (const key of Object.keys(output)) { - // protobujs sets unset message fields to `null`, protons does not set the field at all + // protobufjs sets unset message fields to `null`, protons does not set the field at all if (output[key] === null && target[key] == null) { delete output[key] } } for (const key of Object.keys(target)) { - // protobujs uses plain objects instead of maps + // protobufjs uses plain objects instead of maps if (target[key] instanceof Map) { output[key] = new Map(Object.entries(output[key] ?? {})) } diff --git a/packages/protons/test/oneof.spec.ts b/packages/protons/test/oneof.spec.ts index c1f0c7e..2700dd0 100644 --- a/packages/protons/test/oneof.spec.ts +++ b/packages/protons/test/oneof.spec.ts @@ -74,14 +74,14 @@ function normalizeProtonbufjs (obj: any, target: any): any { output = uint8ArrayifyBytes(output) for (const key of Object.keys(output)) { - // protobujs sets unset message fields to `null`, protons does not set the field at all + // protobufjs sets unset message fields to `null`, protons does not set the field at all if (output[key] === null && target[key] == null) { delete output[key] } } for (const key of Object.keys(target)) { - // protobujs uses plain objects instead of maps + // protobufjs uses plain objects instead of maps if (target[key] instanceof Map) { output[key] = new Map(Object.entries(output[key] ?? {})) }