Skip to content

Commit

Permalink
chore: add release
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 11, 2024
1 parent 0af908f commit a7abbe5
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 21 deletions.
4 changes: 4 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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:

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.
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
# libp2p-protocol-adventure

A workshop for learning about custom protocol streams in libp2p
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-protocol-adventure.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-protocol-adventure)
[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-protocol-adventure/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/libp2p/js-libp2p-protocol-adventure/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> A workshop for learning about custom protocol streams in libp2p
![protocol-adventure](https://raw.githubusercontent.com/libp2p/js-libp2p-protocol-adventure/master/assets/image.png)

## Requirements

1. Node.js install
1. A working knowledge of [JavaScript](https://www.npmjs.com/package/javascripting), [Node.js](https://www.npmjs.com/package/learnyounode)
1. Some time and a pot of coffee
2. A working knowledge of [JavaScript](https://www.npmjs.com/package/javascripting), [Node.js](https://www.npmjs.com/package/learnyounode)
3. Some time and a pot of coffee

## Installation

Expand Down Expand Up @@ -40,3 +45,14 @@ Yes you can, but due to complications around everyone's preferred TypeScript set
$ tsc my-solution.ts
$ protocol-adventure verify ./build/my-solution.js
```

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/libp2p/js-libp2p-protocol-adventure/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/libp2p/js-libp2p-protocol-adventure/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribution

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.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

'use strict'

const workshopper = require('workshopper-adventure')

const workshop = workshopper({
Expand All @@ -13,6 +15,7 @@ workshop.addAll(require('./exercises/menu.json'))
workshop.execute(process.argv.slice(2))

process.on('unhandledRejection', error => {
// eslint-disable-next-line no-console
console.error(error.stack ? error.stack : error.toString())
throw error
})
133 changes: 117 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,148 @@
"name": "@libp2p/protocol-adventure",
"version": "0.0.1",
"description": "Learn how to develop custom protocols with libp2p",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/libp2p/js-libp2p-protocol-adventure#readme",
"repository": {
"type": "git",
"url": "git://github.com/libp2p/js-libp2p-protocol-adventure"
"url": "git+https://github.com/libp2p/js-libp2p-protocol-adventure.git"
},
"bugs": {
"url": "https://github.com/libp2p/js-libp2p-protocol-adventure/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"license": "ISC",
"bin": {
"protocol-adventure": "./index.js"
},
"files": [
"index.js",
"examples",
"i18n",
"lib",
"patches"
],
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true
}
},
"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"
]
},
"scripts": {
"lint": "standard",
"lint": "aegir lint",
"postinstall": "patch-package",
"test": "mocha test/*.spec.js"
"test": "aegir test -t node",
"test:node": "aegir test -t node",
"release": "aegir release"
},
"dependencies": {
"@chainsafe/libp2p-yamux": "^7.0.1",
"@libp2p/tcp": "^10.0.11",
"@libp2p/tls": "^2.0.10",
"cborg": "^4.2.2",
"chalk": "^5.3.0",
"it-all": "^3.0.6",
"it-byte-stream": "^1.0.12",
"it-filter": "^3.1.1",
"it-length-prefixed-stream": "^1.2.0",
"it-map": "^3.1.1",
"it-pipe": "^3.0.1",
"it-rpc": "^1.0.1",
"libp2p": "^2.2.1",
"patch-package": "^8.0.0",
"shortid": "^2.2.8",
"uint8-varint": "^2.0.4",
"uint8arraylist": "^2.4.8",
"workshopper-adventure": "^7.0.0",
"workshopper-boilerplate": "^1.1.2",
"workshopper-exercise": "^3.0.1",
"workshopper-verify-processor": "0.0.2",
"workshopper-wrappedexec": "^0.1.1"
"workshopper-verify-processor": "0.0.2"
},
"devDependencies": {
"mocha": "^10.8.2",
"pre-commit": "^1.2.2",
"standard": "^17.1.0"
},
"pre-commit": [
"lint"
]
"aegir": "^45.0.1"
}
}
6 changes: 4 additions & 2 deletions test/exercises.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/* eslint-env mocha */
/* eslint-disable no-console,no-loop-func */
'use strict'

const { spawn } = require('node:child_process')
const path = require('node:path')
const os = require('node:os')
const fs = require('node:fs')
const os = require('node:os')
const path = require('node:path')
const menu = require('../exercises/menu.json')

function makeConfigDir () {
Expand Down

0 comments on commit a7abbe5

Please sign in to comment.