Skip to content

Commit

Permalink
deps(dev): bump aegir from 37.12.1 to 42.2.5 (#44)
Browse files Browse the repository at this point in the history
Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 42.2.5.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v37.12.1...v42.2.5)

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

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <[email protected]>
  • Loading branch information
dependabot[bot] and achingbrain authored Mar 1, 2024
1 parent 648eb10 commit e59c2d8
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 32 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)"
4 changes: 3 additions & 1 deletion .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: test & maybe release
on:
push:
branches:
- master
- main
pull_request:
workflow_dispatch:

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/[email protected]
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/[email protected]
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
node_modules
coverage
.nyc_output
package-lock.json
build
dist
.docs
.coverage
node_modules
package-lock.json
yarn.lock
.vscode
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# @multiformats/uri-to-multiaddr <!-- omit in toc -->
# @multiformats/uri-to-multiaddr

[![multiformats.io](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://multiformats.io)
[![codecov](https://img.shields.io/codecov/c/github/multiformats/js-uri-to-multiaddr.svg?style=flat-square)](https://codecov.io/gh/multiformats/js-uri-to-multiaddr)
[![CI](https://img.shields.io/github/workflow/status/multiformats/js-uri-to-multiaddr/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/multiformats/js-uri-to-multiaddr/actions/workflows/js-test-and-release.yml)
[![CI](https://img.shields.io/github/actions/workflow/status/multiformats/js-uri-to-multiaddr/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/multiformats/js-uri-to-multiaddr/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> Convert a URI to a Multiaddr: <https://multiformats.io> -> /dns4/multiformats.io/tcp/443/https
> Convert a URI to a Multiaddr
## Table of contents <!-- omit in toc -->
# About

- [Install](#install)
- [Usage](#usage)
- [Related](#related)
- [Contribute](#contribute)
- [License](#license)
- [Contribute](#contribute-1)
<!--
## Install
!IMPORTANT!
```console
$ npm i @multiformats/uri-to-multiaddr
```
Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.
To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts
## Usage
To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.
-->

```js
const toMultiaddr = require('uri-to-multiaddr')
Expand Down Expand Up @@ -58,17 +58,31 @@ See [test.js](./test.js) for the currently supported conversions.

- [multiaddr-to-uri](https://github.com/multiformats/js-multiaddr-to-uri) - convert it back again

## Contribute
# Install

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

## Browser `<script>` tag

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

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

# API Docs

Feel free to dive in! [Open an issue](https://github.com/multiformats/js-uri-to-multiaddr/issues/new) or submit PRs.
- <https://multiformats.github.io/js-uri-to-multiaddr>

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

## Contribute
# 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.
17 changes: 10 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@multiformats/uri-to-multiaddr",
"version": "7.0.0",
"description": "Convert a URI to a Multiaddr: https://multiformats.io -> /dns4/multiformats.io/tcp/443/https",
"description": "Convert a URI to a Multiaddr",
"author": "olizilla",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/multiformats/js-uri-to-multiaddr#readme",
Expand All @@ -12,15 +12,15 @@
"bugs": {
"url": "https://github.com/multiformats/js-uri-to-multiaddr/issues"
},
"engines": {
"node": ">=16.0.0",
"npm": ">=7.0.0"
"publishConfig": {
"access": "public",
"provenance": true
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist/src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
Expand All @@ -33,12 +33,13 @@
"eslintConfig": {
"extends": "ipfs",
"parserOptions": {
"project": true,
"sourceType": "module"
}
},
"release": {
"branches": [
"master"
"main"
],
"plugins": [
[
Expand Down Expand Up @@ -124,7 +125,9 @@
"scripts": {
"clean": "aegir clean",
"lint": "aegir lint",
"docs": "aegir docs",
"dep-check": "aegir dep-check",
"doc-check": "aegir doc-check",
"generate": "protons src/pb/peer.proto src/pb/tags.proto",
"build": "aegir build",
"test": "aegir test",
Expand All @@ -141,6 +144,6 @@
"is-ip": "^5.0.0"
},
"devDependencies": {
"aegir": "^37.5.3"
"aegir": "^42.2.5"
}
}
41 changes: 40 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
import { isIPv4, isIPv6 } from 'is-ip'
/**
* @packageDocumentation
*
* ```js
* const toMultiaddr = require('uri-to-multiaddr')
*
* console.log(toMultiaddr('https://protocol.ai'))
* // -> /dns4/protocol.ai/tcp/443/https
* ```
*
* Domain names can represent one of
*
* - `/dns4` - domain resolves to an ipv4 address (**default**)
* - `/dns6` - domain resolves to an ipv6 address
* - `/dnsaddr` - domain has a [DNSLink](https://docs.ipfs.io/guides/concepts/dnslink/) TXT record pointing to an IPFS CID
*
* This library assumes `/dns4` when it finds a domain name in the input string.
* It makes no attempt query DNS. To override the default assumption, you can pass
* in an options object as the second parameter to override it:
*
* ```js
* const toMultiaddr = require('uri-to-multiaddr')
*
* console.log(toMultiaddr('https://protocol.ai'), { defaultDnsType: 'dns6' })
* // -> /dns6/protocol.ai/tcp/443/https
* ```
*
* See [test.js](./test.js) for the currently supported conversions.
*
* **Note**: `uri-to-multiaddr` will throw if the passed URI:
*
* - is not a valid, according the WHATWG URL spec implementation used.
* - is not supported yet
*
* ## Related
*
* - [multiaddr-to-uri](https://github.com/multiformats/js-multiaddr-to-uri) - convert it back again
*/

import { multiaddr } from '@multiformats/multiaddr'
import { isIPv4, isIPv6 } from 'is-ip'
import type { Multiaddr } from '@multiformats/multiaddr'

const portFor: Record<string, string> = {
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 e59c2d8

Please sign in to comment.