Skip to content

Commit 555e75f

Browse files
deps(dev): bump aegir from 37.12.1 to 42.2.3 (#90)
Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 42.2.3. - [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.3) --- updated-dependencies: - dependency-name: aegir dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alex Potsides <alex@achingbrain.net>
1 parent 0869247 commit 555e75f

16 files changed

+281
-225
lines changed

.github/dependabot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ updates:
55
schedule:
66
interval: daily
77
time: "10:00"
8-
open-pull-requests-limit: 10
8+
open-pull-requests-limit: 20
99
commit-message:
1010
prefix: "deps"
1111
prefix-development: "deps(dev)"

.github/workflows/js-test-and-release.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ on:
99

1010
permissions:
1111
contents: write
12+
id-token: write
1213
packages: write
14+
pull-requests: write
1315

1416
concurrency:
1517
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Semantic PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
uses: pl-strflt/.github/.github/workflows/reusable-semantic-pull-request.yml@v0.3

.github/workflows/stale.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Close and mark stale issue
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
stale:
13+
uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3

.gitignore

+7-39
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
1-
package-lock.json
2-
yarn.lock
3-
4-
# Logs
5-
logs
6-
*.log
7-
npm-debug.log*
8-
9-
# Runtime data
10-
pids
11-
*.pid
12-
*.seed
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
19-
.nyc_output
20-
21-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22-
.grunt
23-
24-
# node-waf configuration
25-
.lock-wscript
26-
27-
# Compiled binary addons (http://nodejs.org/api/addons.html)
28-
build/Release
29-
30-
# Dependency directory
311
node_modules
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
38-
2+
build
393
dist
40-
lib
41-
docs
4+
.docs
5+
.coverage
6+
node_modules
7+
package-lock.json
8+
yarn.lock
9+
.vscode

.npmignore

-1
This file was deleted.

README.md

+19-141
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,18 @@
55

66
> A set of utilities to help identify IPFS resources on the web
77
8-
## Table of contents <!-- omit in toc -->
9-
10-
- [Install](#install)
11-
- [Browser `<script>` tag](#browser-script-tag)
12-
- [Usage](#usage)
13-
- [API](#api)
14-
- [Content Identifiers](#content-identifiers)
15-
- [`isIPFS.multihash(hash)`](#isipfsmultihashhash)
16-
- [`isIPFS.cid(hash)`](#isipfscidhash)
17-
- [`isIPFS.base32cid(hash)`](#isipfsbase32cidhash)
18-
- [URLs](#urls)
19-
- [`isIPFS.url(url)`](#isipfsurlurl)
20-
- [`isIPFS.ipfsUrl(url)`](#isipfsipfsurlurl)
21-
- [`isIPFS.ipnsUrl(url)`](#isipfsipnsurlurl)
22-
- [Paths](#paths)
23-
- [`isIPFS.path(path)`](#isipfspathpath)
24-
- [`isIPFS.urlOrPath(path)`](#isipfsurlorpathpath)
25-
- [`isIPFS.ipfsPath(path)`](#isipfsipfspathpath)
26-
- [`isIPFS.ipnsPath(path)`](#isipfsipnspathpath)
27-
- [`isIPFS.cidPath(path)`](#isipfscidpathpath)
28-
- [Subdomains](#subdomains)
29-
- [`isIPFS.subdomain(url)`](#isipfssubdomainurl)
30-
- [`isIPFS.ipfsSubdomain(url)`](#isipfsipfssubdomainurl)
31-
- [`isIPFS.ipnsSubdomain(url)`](#isipfsipnssubdomainurl)
32-
- [Multiaddrs](#multiaddrs)
33-
- [`isIPFS.multiaddr(addr)`](#isipfsmultiaddraddr)
34-
- [`isIPFS.peerMultiaddr(addr)`](#isipfspeermultiaddraddr)
35-
- [API Docs](#api-docs)
36-
- [License](#license)
37-
- [Contribution](#contribution)
38-
39-
## Install
8+
# About
409

41-
```console
42-
$ npm i is-ipfs
43-
```
44-
45-
### Browser `<script>` tag
10+
A suite of util methods that provides efficient validation.
4611

47-
Loading this module through a script tag will make it's exports available as `IsIpfs` in the global namespace.
12+
Detection of IPFS Paths and identifiers in URLs is a two-stage process:
4813

49-
```html
50-
<script src="https://unpkg.com/is-ipfs/dist/index.min.js"></script>
51-
```
14+
1. `pathPattern`/`pathGatewayPattern`/`subdomainGatewayPattern` regex is applied to quickly identify potential candidates
15+
2. proper CID validation is applied to remove false-positives
5216

53-
## Usage
17+
## Example
5418

55-
```javascript
19+
```TypeScript
5620
import * as isIPFS from 'is-ipfs'
5721

5822
isIPFS.multihash('QmYjtig7VJQ6XsnUjqqJvj7QaMcCAwtrgNdahSiFofrE7o') // true
@@ -134,117 +98,31 @@ isIPFS.peerMultiaddr('/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQ
13498
isIPFS.peerMultiaddr('/ip4/127.0.0.1/udp/1234') // false (key missing)
13599
```
136100

137-
## API
138-
139-
A suite of util methods that provides efficient validation.
140-
141-
Detection of IPFS Paths and identifiers in URLs is a two-stage process:
142-
143-
1. `pathPattern`/`pathGatewayPattern`/`subdomainGatewayPattern` regex is applied to quickly identify potential candidates
144-
2. proper CID validation is applied to remove false-positives
145-
146-
### Content Identifiers
147-
148-
#### `isIPFS.multihash(hash)`
149-
150-
Returns `true` if the provided string or `Uint8Array` is a valid `multihash` or `false` otherwise.
151-
152-
#### `isIPFS.cid(hash)`
153-
154-
Returns `true` if the provided string, `Uint8Array` or [`CID`](https://github.com/multiformats/js-multiformats/#readme) object represents a valid [CID](https://docs.ipfs.io/guides/concepts/cid/) or `false` otherwise.
155-
156-
#### `isIPFS.base32cid(hash)`
157-
158-
Returns `true` if the provided string is a valid `CID` in Base32 encoding or `false` otherwise.
159-
160-
### URLs
161-
162-
#### `isIPFS.url(url)`
163-
164-
Returns `true` if the provided string is a valid IPFS or IPNS url or `false` otherwise.
165-
166-
#### `isIPFS.ipfsUrl(url)`
167-
168-
Returns `true` if the provided string is a valid IPFS url or `false` otherwise.
169-
170-
#### `isIPFS.ipnsUrl(url)`
171-
172-
Returns `true` if the provided string is a valid IPNS url or `false` otherwise.
101+
# Install
173102

174-
### Paths
175-
176-
Standalone validation of IPFS Paths: `/ip(f|n)s/<cid>/..`
177-
178-
#### `isIPFS.path(path)`
179-
180-
Returns `true` if the provided string is a valid IPFS or IPNS path or `false` otherwise.
181-
182-
#### `isIPFS.urlOrPath(path)`
183-
184-
Returns `true` if the provided string is a valid IPFS or IPNS url or path or `false` otherwise.
185-
186-
#### `isIPFS.ipfsPath(path)`
187-
188-
Returns `true` if the provided string is a valid IPFS path or `false` otherwise.
189-
190-
#### `isIPFS.ipnsPath(path)`
191-
192-
Returns `true` if the provided string is a valid IPNS path or `false` otherwise.
193-
194-
#### `isIPFS.cidPath(path)`
195-
196-
Returns `true` if the provided string is a valid "CID path" (IPFS path without `/ipfs/` prefix) or `false` otherwise.
197-
198-
### Subdomains
199-
200-
Validated subdomain convention: `cidv1b32.ip(f|n)s.domain.tld`
201-
202-
#### `isIPFS.subdomain(url)`
203-
204-
Returns `true` if the provided `url` string includes a valid IPFS, looks like IPNS/DNSLink subdomain or `false` otherwise.
205-
206-
#### `isIPFS.ipfsSubdomain(url)`
207-
208-
Returns `true` if the provided `url` string includes a valid IPFS subdomain (case-insensitive CIDv1) or `false` otherwise.
209-
210-
#### `isIPFS.ipnsSubdomain(url)`
211-
212-
Returns `true` if the provided `url` string looks like a valid IPNS subdomain
213-
(CIDv1 with `libp2p-key` multicodec or something that looks like a FQDN, for example `en.wikipedia-on-ipfs.org.ipns.localhost:8080`) or `false`
214-
otherwise.
215-
216-
**Note:** `ipnsSubdomain` method works in offline mode: it does not perform
217-
actual IPNS record lookup over DHT or other content routing method. It may
218-
return false-positives:
219-
220-
- To ensure IPNS record exists, make a call to `/api/v0/name/resolve?arg=<ipnsid>`
221-
- To ensure DNSLink exists, make a call to `/api/v0/dns?arg=<fqdn>`
222-
223-
### Multiaddrs
224-
225-
Below methods provide basic detection of [multiaddr](https://github.com/multiformats/multiaddr)s: composable and future-proof network addresses.
226-
227-
Complex validation of multiaddr can be built using `isIPFS.multiaddr` and [`mafmt`](https://github.com/multiformats/js-mafmt) library.
228-
229-
#### `isIPFS.multiaddr(addr)`
103+
```console
104+
$ npm i is-ipfs
105+
```
230106

231-
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Uint8Array` represents a valid multiaddr or `false` otherwise.
107+
## Browser `<script>` tag
232108

233-
#### `isIPFS.peerMultiaddr(addr)`
109+
Loading this module through a script tag will make it's exports available as `IsIpfs` in the global namespace.
234110

235-
Returns `true` if the provided `string`, [`Multiaddr`](https://github.com/multiformats/js-multiaddr) or `Uint8Array` represents a valid libp2p peer multiaddr (matching [`P2P` format from `mafmt`](https://github.com/multiformats/js-mafmt#api)) or `false` otherwise.
111+
```html
112+
<script src="https://unpkg.com/is-ipfs/dist/index.min.js"></script>
113+
```
236114

237-
## API Docs
115+
# API Docs
238116

239117
- <https://ipfs-shipyard.github.io/is-ipfs>
240118

241-
## License
119+
# License
242120

243121
Licensed under either of
244122

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

248-
## Contribution
126+
# Contribution
249127

250128
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.

package.json

+15-14
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
"bugs": {
1313
"url": "https://github.com/ipfs-shipyard/is-ipfs/issues"
1414
},
15+
"publishConfig": {
16+
"access": "public",
17+
"provenance": true
18+
},
1519
"keywords": [
1620
"dnslink",
1721
"gateway",
1822
"ipfs",
1923
"ipns",
2024
"js-ipfs"
2125
],
22-
"engines": {
23-
"node": ">=16.0.0",
24-
"npm": ">=7.0.0"
25-
},
2626
"type": "module",
2727
"types": "./dist/src/index.d.ts",
2828
"files": [
@@ -40,6 +40,7 @@
4040
"eslintConfig": {
4141
"extends": "ipfs",
4242
"parserOptions": {
43+
"project": true,
4344
"sourceType": "module"
4445
}
4546
},
@@ -129,18 +130,16 @@
129130
]
130131
},
131132
"scripts": {
132-
"clean": "aegir clean",
133-
"lint": "aegir lint",
134-
"dep-check": "aegir dep-check",
135-
"generate": "protons src/pb/peer.proto src/pb/tags.proto",
136133
"build": "aegir build",
137134
"test": "aegir test",
138-
"test:chrome": "aegir test -t browser",
135+
"test:node": "aegir test -t node --cov",
136+
"test:chrome": "aegir test -t browser --cov",
139137
"test:chrome-webworker": "aegir test -t webworker",
140138
"test:firefox": "aegir test -t browser -- --browser firefox",
141139
"test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
142-
"test:node": "aegir test -t node",
143140
"test:electron-main": "aegir test -t electron-main",
141+
"lint": "aegir lint",
142+
"dep-check": "aegir dep-check",
144143
"release": "aegir release",
145144
"docs": "aegir docs"
146145
},
@@ -152,9 +151,11 @@
152151
"uint8arrays": "^4.0.2"
153152
},
154153
"devDependencies": {
155-
"aegir": "^37.10.1"
154+
"aegir": "^42.2.3"
155+
},
156+
"engines": {
157+
"node": ">=16.0.0",
158+
"npm": ">=7.0.0"
156159
},
157-
"browser": {
158-
"fs": false
159-
}
160+
"sideEffects": false
160161
}

0 commit comments

Comments
 (0)