Skip to content

Commit

Permalink
deps(dev): bump aegir from 39.0.13 to 41.0.5 (#145)
Browse files Browse the repository at this point in the history
Bumps [aegir](https://github.com/ipfs/aegir) from 39.0.13 to 41.0.5.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v39.0.13...v41.0.5)

---
updated-dependencies:
- dependency-name: aegir
  dependency-type: direct:development
  update-type: version-update:semver-major
...

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <alex@achingbrain.net>
  • Loading branch information
dependabot[bot] and achingbrain authored Feb 5, 2024
1 parent 1b886c6 commit a90dca4
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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)"
2 changes: 2 additions & 0 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:

permissions:
contents: write
id-token: write
packages: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/semantic-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Semantic PR

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
uses: pl-strflt/.github/.github/workflows/reusable-semantic-pull-request.yml@v0.3
13 changes: 13 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Close and mark stale issue

on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

jobs:
stale:
uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3
47 changes: 21 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,13 @@
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-multiaddr-to-uri.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-multiaddr-to-uri)
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-multiaddr-to-uri/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/multiformats/js-multiaddr-to-uri/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)

> Convert a Multiaddr to a URI /dnsaddr/ipfs.io/http -> <http://ipfs.io>
> Convert a Multiaddr to a URI
## Table of contents <!-- omit in toc -->
# About

- [Install](#install)
- [Browser `<script>` tag](#browser-script-tag)
- [Usage](#usage)
- [API Docs](#api-docs)
- [License](#license)
- [Contribution](#contribution)
This module allows easy conversion of Multiaddrs to URLs.

## Install

```console
$ npm i @multiformats/multiaddr-to-uri
```

### Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `MultiformatsMultiaddrToUri` in the global namespace.

```html
<script src="https://unpkg.com/@multiformats/multiaddr-to-uri/dist/index.min.js"></script>
```

## Usage
## Example - Converting multiaddrs to URLs

```js
import { multiaddrToUri } from '@multiformats/multiaddr-to-uri'
Expand All @@ -54,17 +35,31 @@ Note:
- is not a valid multiaddr
- is not supported as a URI e.g. circuit

## API Docs
# Install

```console
$ npm i @multiformats/multiaddr-to-uri
```

## Browser `<script>` tag

Loading this module through a script tag will make it's exports available as `MultiformatsMultiaddrToUri` in the global namespace.

```html
<script src="https://unpkg.com/@multiformats/multiaddr-to-uri/dist/index.min.js"></script>
```

# API Docs

- <https://multiformats.github.io/js-multiaddr-to-uri>

## License
# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

## Contribution
# 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.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@multiformats/multiaddr-to-uri",
"version": "9.0.7",
"description": "Convert a Multiaddr to a URI /dnsaddr/ipfs.io/http -> http://ipfs.io",
"description": "Convert a Multiaddr to a URI",
"author": "Alan Shaw",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/multiformats/js-multiaddr-to-uri#readme",
Expand All @@ -12,15 +12,15 @@
"bugs": {
"url": "https://github.com/multiformats/js-multiaddr-to-uri/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"URL",
"multiaddr",
"toString"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
Expand All @@ -38,6 +38,7 @@
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true,
"sourceType": "module"
}
},
Expand Down Expand Up @@ -146,6 +147,6 @@
"@multiformats/multiaddr": "^12.0.0"
},
"devDependencies": {
"aegir": "^39.0.7"
"aegir": "^42.2.2"
}
}
31 changes: 31 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
/**
* @packageDocumentation
*
* This module allows easy conversion of Multiaddrs to URLs.
*
* @example Converting multiaddrs to URLs
*
* ```js
* import { multiaddrToUri } from '@multiformats/multiaddr-to-uri'
*
* console.log(multiaddrToUri('/dnsaddr/protocol.ai/https'))
* // -> https://protocol.ai
*
* console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080'))
* // -> http://127.0.0.1:8080
*
* console.log(multiaddrToUri('/ip4/127.0.0.1/tcp/8080', { assumeHttp: false }))
* // -> tcp://127.0.0.1:8080
* ```
*
* Note:
*
* - When `/tcp` is the last (terminating) protocol HTTP is assumed by default (implicit `assumeHttp: true`)
* - this means produced URIs will start with `http://` instead of `tcp://`
* - passing `{ assumeHttp: false }` disables this behavior
* - Might be lossy - e.g. a DNSv6 multiaddr
* - Can throw if the passed multiaddr:
* - is not a valid multiaddr
* - is not supported as a URI e.g. circuit
*/

import { multiaddr, protocols } from '@multiformats/multiaddr'
import type { Multiaddr, StringTuple } from '@multiformats/multiaddr'

Expand Down
5 changes: 5 additions & 0 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"entryPoints": [
"./src/index.ts"
]
}

0 comments on commit a90dca4

Please sign in to comment.