-
Notifications
You must be signed in to change notification settings - Fork 67
fix: integrate with aegir types cmd #159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
678341b
8bf9cae
708292c
4cec873
449065d
7251ac9
9a853c2
a09e829
04e0b48
980973d
df5ab2a
64d1aed
f30a721
f5cb727
26bf0ee
c83f1c1
89966e5
89766b0
50719b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Smartphone (please complete the following information):** | ||
- Device: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- Browser [e.g. stock browser, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,67 @@ | ||||||
name: ci | ||||||
on: | ||||||
push: | ||||||
branches: | ||||||
- master | ||||||
pull_request: | ||||||
branches: | ||||||
- master | ||||||
|
||||||
jobs: | ||||||
check: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- run: yarn | ||||||
- run: yarn lint | ||||||
- run: yarn build | ||||||
- uses: gozala/typescript-error-reporter-action@v1.0.4 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- run: yarn aegir dep-check -- -i aegir | ||||||
- uses: ipfs/aegir/actions/bundle-size@master | ||||||
name: size | ||||||
with: | ||||||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||
test-node: | ||||||
needs: check | ||||||
runs-on: ${{ matrix.os }} | ||||||
strategy: | ||||||
matrix: | ||||||
os: [windows-latest, ubuntu-latest, macos-latest] | ||||||
node: [12, 14] | ||||||
fail-fast: true | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- uses: actions/setup-node@v1 | ||||||
with: | ||||||
node-version: ${{ matrix.node }} | ||||||
- run: yarn | ||||||
- run: npx nyc --reporter=lcov npm run test:node -- --bail | ||||||
- uses: codecov/codecov-action@v1 | ||||||
test-chrome: | ||||||
needs: check | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- run: yarn | ||||||
- run: yarn aegir test -t browser -t webworker | ||||||
test-firefox: | ||||||
needs: check | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- run: yarn | ||||||
- run: yarn aegir test -t browser -t webworker -- --browsers FirefoxHeadless | ||||||
test-electron-main: | ||||||
needs: check | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- run: yarn | ||||||
- run: npx xvfb-maybe yarn aegir test -t electron-main --bail | ||||||
test-electron-renderer: | ||||||
needs: check | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- run: yarn | ||||||
- run: npx xvfb-maybe yarn aegir test -t electron-renderer --bail |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,38 +1,31 @@ | ||||||
js-multiaddr | ||||||
js-multiaddr <!-- omit in toc --> | ||||||
============ | ||||||
|
||||||
[](http://ipn.io) | ||||||
[](https://github.com/multiformats/multiformats) | ||||||
[](https://webchat.freenode.net/?channels=%23ipfs) | ||||||
[](https://david-dm.org/multiformats/js-multiaddr) | ||||||
[](https://github.com/feross/standard) | ||||||
[](https://github.com/RichardLitt/standard-readme) | ||||||
[](https://travis-ci.com/multiformats/js-multiaddr) | ||||||
[](https://protocol.ai) | ||||||
[](https://github.com/multiformats/multiformats) | ||||||
[](https://webchat.freenode.net/?channels=%23ipfs) | ||||||
[](https://codecov.io/gh/multiformats/js-multiaddr) | ||||||
[](https://github.com/multiformats/js-multiaddr/actions?query=branch%3Amaster+workflow%3Aci+) | ||||||
|
||||||
> JavaScript implementation of [multiaddr](https://github.com/multiformats/multiaddr). | ||||||
|
||||||
## Lead Maintainer | ||||||
## Lead Maintainer <!-- omit in toc --> | ||||||
|
||||||
[Jacob Heun](https://github.com/jacobheun) | ||||||
|
||||||
## Table of Contents | ||||||
|
||||||
- [js-multiaddr](#js-multiaddr) | ||||||
- [Lead Maintainer](#lead-maintainer) | ||||||
- [Table of Contents](#table-of-contents) | ||||||
- [Background](#background) | ||||||
- [What is multiaddr?](#what-is-multiaddr) | ||||||
- [Install](#install) | ||||||
- [Setup](#setup) | ||||||
- [Node.js](#nodejs) | ||||||
- [Browser: Browserify, Webpack, other bundlers](#browser-browserify-webpack-other-bundlers) | ||||||
- [Browser: `<script>` Tag](#browser-script-tag) | ||||||
- [Usage](#usage) | ||||||
- [API](#api) | ||||||
- [Resolvers](#resolvers) | ||||||
- [Contribute](#contribute) | ||||||
- [License](#license) | ||||||
## Table of Contents<!-- omit in toc --> | ||||||
|
||||||
- [Background](#background) | ||||||
- [What is multiaddr?](#what-is-multiaddr) | ||||||
- [Migrate to 0.9](#migrate-to-09) | ||||||
- [Install](#install) | ||||||
- [NPM](#npm) | ||||||
- [Browser: `<script>` Tag](#browser-script-tag) | ||||||
- [Usage](#usage) | ||||||
- [API](#api) | ||||||
- [Resolvers](#resolvers) | ||||||
- [Contribute](#contribute) | ||||||
- [License](#license) | ||||||
|
||||||
## Background | ||||||
|
||||||
|
@@ -46,32 +39,57 @@ A standard way to represent addresses that | |||||
- have a nice string representation | ||||||
- encapsulate well | ||||||
|
||||||
## Install | ||||||
## Migrate to 0.9 | ||||||
Before 0.9 `multiaddr` would return an constructor function. | ||||||
```js | ||||||
const multiaddr = require('multiaddr') | ||||||
|
||||||
```sh | ||||||
npm i multiaddr | ||||||
``` | ||||||
const mh1 = multiaddr('/ip4/127.0.0.1/udp/1234') | ||||||
|
||||||
### Setup | ||||||
const mh2 = new multiaddr('/ip4/127.0.0.1/udp/1234') | ||||||
// both mh1 and mh2 were multiaddr instances | ||||||
|
||||||
#### Node.js | ||||||
multiaddr.isName() | ||||||
multiaddr.protocols | ||||||
// etc | ||||||
|
||||||
``` | ||||||
In 0.9 `multiaddr` returns a class. | ||||||
```js | ||||||
const multiaddr = require('multiaddr') | ||||||
const Multiaddr = require('multiaddr') | ||||||
// you need to use `new` to create and instance | ||||||
const mh1 = new Multiaddr('/ip4/127.0.0.1/udp/1234') | ||||||
``` | ||||||
|
||||||
```js | ||||||
// The Multiaddr class has a factory method to help migration | ||||||
const { multiaddr } = require('multiaddr') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would make more sense to have
Suggested change
And if we really want to smooth out transition we could have deprecated alias My argument for discouraging My personal opinion is to reserve constructors for property initializations, all the computation and logic should go into dedicated functions. Edit: Added more details in the contstructor |
||||||
|
||||||
const mh1 = multiaddr('/ip4/127.0.0.1/udp/1234') | ||||||
``` | ||||||
```js | ||||||
// In case you are using the static methods/getters `fromNodeAddress`, `isName` , `isMultiaddr`, `protocols` and `resolvers` | ||||||
// You will need to do a couple more changes | ||||||
const Multiaddr = require('multiaddr') | ||||||
const { multiaddr, isName } = Multiaddr | ||||||
|
||||||
#### Browser: Browserify, Webpack, other bundlers | ||||||
// multiaddr.isName() will not work anymore, only the default export has those methods/getters | ||||||
Multiaddr.isName() // or just `isName()` | ||||||
|
||||||
The code published to npm that gets loaded on require is in fact a ES5 | ||||||
transpiled version with the right shims added. This means that you can require | ||||||
it and use with your favourite bundler without having to adjust asset management | ||||||
process. | ||||||
``` | ||||||
|
||||||
## Install | ||||||
|
||||||
```sh | ||||||
npm i multiaddr | ||||||
``` | ||||||
### NPM | ||||||
|
||||||
```js | ||||||
const multiaddr = require('multiaddr') | ||||||
``` | ||||||
|
||||||
#### Browser: `<script>` Tag | ||||||
### Browser: `<script>` Tag | ||||||
|
||||||
Loading this module through a script tag will make the `Multiaddr` obj available in | ||||||
the global namespace. | ||||||
|
@@ -85,9 +103,9 @@ the global namespace. | |||||
```js | ||||||
$ node | ||||||
|
||||||
> const multiaddr = require('multiaddr') | ||||||
> const Multiaddr = require('multiaddr') | ||||||
|
||||||
> const addr = multiaddr("/ip4/127.0.0.1/udp/1234") | ||||||
> const addr = new Multiaddr("/ip4/127.0.0.1/udp/1234") | ||||||
<Multiaddr /ip4/127.0.0.1/udp/1234> | ||||||
|
||||||
> addr.bytes | ||||||
|
@@ -124,10 +142,10 @@ https://multiformats.github.io/js-multiaddr/ | |||||
To provide multiaddr resolvers you can do: | ||||||
|
||||||
```js | ||||||
const multiaddr = require('multiaddr') | ||||||
const Multiaddr = require('multiaddr') | ||||||
const resolvers = require('multiaddr/src/resolvers') | ||||||
|
||||||
multiaddr.resolvers.set('dnsaddr', resolvers.dnsaddrResolver) | ||||||
Multiaddr.resolvers.set('dnsaddr', resolvers.dnsaddrResolver) | ||||||
``` | ||||||
|
||||||
The available resolvers are: | ||||||
|
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.