Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

chore: upgrade deps with new typedefs #3550

Merged
merged 12 commits into from
Mar 31, 2021
  •  
  •  
  •  
15 changes: 11 additions & 4 deletions .github/workflows/bundlesize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@ jobs:
runs-on: ubuntu-latest # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md
strategy:
matrix:
node-version: [15.x]
project:
- packages/ipfs-core-utils
- packages/ipfs
- packages/ipfs-core
- packages/ipfs-client
- packages/ipfs-grpc-client
- packages/ipfs-http-client
- packages/ipfs
- packages/ipfs-message-port-client
steps:
- uses: actions/checkout@v2
- run: npm install
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: actions/checkout@v2
- run: npm install -g @mapbox/node-pre-gyp && npm install
- name: Bundlesize ${{ matrix.project }}
uses: ipfs/aegir/actions/bundle-size@v31.0.4
uses: ipfs/aegir/actions/bundle-size@v32.1.0
with:
project: ${{ matrix.project }}
github_token: ${{ secrets.GITHUB_TOKEN }}
17 changes: 12 additions & 5 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ jobs:
matrix:
node-version: [14.x]
project:
- packages/ipfs-core-utils
- packages/ipfs-core
- packages/ipfs-http-client
- packages/ipfs
- packages/ipfs-cli
- packages/ipfs-http-server
- packages/ipfs-client
- packages/ipfs-core
- packages/ipfs-core-types
- packages/ipfs-core-utils
- packages/ipfs-daemon
- packages/ipfs-grpc-client
- packages/ipfs-grpc-server
- packages/ipfs-http-client
- packages/ipfs-http-gateway
- packages/ipfs-http-server
- packages/ipfs-message-port-client
- packages/ipfs-message-port-protocol
- packages/ipfs-message-port-server
- packages/ipfs-message-port-client
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -29,6 +34,8 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build types
run: npm run build
- name: Typecheck ${{ matrix.project }}
uses: gozala/typescript-error-reporter-action@v1.0.8
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ coverage
tests_output
cache
.cache
.parcel-cache

# Dependency directory
node_modules
Expand All @@ -19,6 +20,8 @@ node_modules
dist
build
bundle.js
tsconfig-types.aegir.json
.tsbuildinfo

# Deployment files
.npmrc
Expand Down
54 changes: 29 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: node_js
dist: bionic

cache:
# https://travis-ci.community/t/npm-cache-on-windows-supplies-incorrect-dependency-versions/11335
npm: false

services:
- xvfb

Expand Down Expand Up @@ -32,27 +36,27 @@ env:
addons:
apt:
packages:
# These are required to run webkit
- libwoff1
- libopus0
- libwebp6
- libwebpdemux2
- libenchant1c2a
- libgudev-1.0-0
- libsecret-1-0
- libhyphen0
- libgdk-pixbuf2.0-0
- libegl1
- libgles2
- libevent-2.1-6
- libnotify4
- libxslt1.1
- libvpx5
# gstreamer and plugins to support video playback in WebKit.
- gstreamer1.0-gl
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good
- gstreamer1.0-plugins-bad
# # These are required to run webkit
# - libwoff1
# - libopus0
# - libwebp6
# - libwebpdemux2
# - libenchant1c2a
# - libgudev-1.0-0
# - libsecret-1-0
# - libhyphen0
# - libgdk-pixbuf2.0-0
# - libegl1
# - libgles2
# - libevent-2.1-6
# - libnotify4
# - libxslt1.1
# - libvpx5
# # gstreamer and plugins to support video playback in WebKit.
# - gstreamer1.0-gl
# - gstreamer1.0-plugins-base
# - gstreamer1.0-plugins-good
# - gstreamer1.0-plugins-bad
# This is required to run chromium
- libgbm1
chrome: stable
Expand Down Expand Up @@ -165,10 +169,10 @@ jobs:
script:
- npm run test:interface:core -- $RUN_SINCE -- -- --bail -t browser -- --browser firefox

- stage: test
name: js-ipfs interface tests - firefox webworker
script:
- npm run test:interface:core -- $RUN_SINCE -- -- --bail -t webworker --timeout 60000 -- --browser firefox
#- stage: test
# name: js-ipfs interface tests - firefox webworker
# script:
# - npm run test:interface:core -- $RUN_SINCE -- -- --bail -t webworker --timeout 60000 -- --browser firefox

- stage: test
name: js-ipfs interface tests - electron main
Expand Down
14 changes: 7 additions & 7 deletions docs/core-api/BITSWAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ The returned object contains the following keys:
- `provideBufLen` is an integer.
- `wantlist` (array of [CID][cid]s)
- `peers` (array of peer IDs represented by CIDs)
- `blocksReceived` is a [BigNumber Int][1]
- `dataReceived` is a [BigNumber Int][1]
- `blocksSent` is a [BigNumber Int][1]
- `dataSent` is a [BigNumber Int][1]
- `dupBlksReceived` is a [BigNumber Int][1]
- `dupDataReceived` is a [BigNumber Int][1]
- `blocksReceived` is a [BigInt][1]
- `dataReceived` is a [BigInt][1]
- `blocksSent` is a [BigInt][1]
- `dataSent` is a [BigInt][1]
- `dupBlksReceived` is a [BigInt][1]
- `dupDataReceived` is a [BigInt][1]

### Example

Expand All @@ -190,7 +190,7 @@ console.log(stats)

A great source of [examples][] can be found in the tests for this API.

[1]: https://github.com/MikeMcl/bignumber.js/
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
[examples]: https://github.com/ipfs/js-ipfs/blob/master/packages/interface-ipfs-core/src/bitswap
[cid]: https://www.npmjs.com/package/cids
[peerid]: https://www.npmjs.com/package/peer-id
Expand Down
10 changes: 5 additions & 5 deletions docs/core-api/FILES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ _Explore the Mutable File System through interactive coding challenges in our [P
- [Options](#options-9)
- [Returns](#returns-9)
- [Example](#example-9)
- [`ipfs.files.rm(...paths, [options])`](#ipfsfilesrmpaths-options)
- [`ipfs.files.rm(path, [options])`](#ipfsfilesrmpath-options)
- [Parameters](#parameters-10)
- [Options](#options-10)
- [Returns](#returns-10)
Expand Down Expand Up @@ -637,7 +637,7 @@ await ipfs.files.cp('/src-file', '/dst-file')
await ipfs.files.cp('/src-dir', '/dst-dir')

// To copy multiple files to a directory
await ipfs.files.cp('/src-file1', '/src-file2', '/dst-dir')
await ipfs.files.cp(['/src-file1', '/src-file2'], '/dst-dir')
```

#### Notes
Expand Down Expand Up @@ -784,7 +784,7 @@ await ipfs.files.touch('/path/to/file.txt', {
})
```

### `ipfs.files.rm(...paths, [options])`
### `ipfs.files.rm(path, [options])`

> Remove a file or directory.

Expand Down Expand Up @@ -820,7 +820,7 @@ An optional object which may have the following keys:
await ipfs.files.rm('/my/beautiful/file.txt')

// To remove multiple files
await ipfs.files.rm('/my/beautiful/file.txt', '/my/other/file.txt')
await ipfs.files.rm(['/my/beautiful/file.txt', '/my/other/file.txt'])

// To remove a directory
await ipfs.files.rm('/my/beautiful/directory', { recursive: true })
Expand Down Expand Up @@ -946,7 +946,7 @@ await ipfs.files.mv('/src-file', '/dst-file')

await ipfs.files.mv('/src-dir', '/dst-dir')

await ipfs.files.mv('/src-file1', '/src-file2', '/dst-dir')
await ipfs.files.mv(['/src-file1', '/src-file2'], '/dst-dir')
```

#### Notes
Expand Down
8 changes: 4 additions & 4 deletions docs/core-api/REPO.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ An optional object which may have the following keys:

the returned object has the following keys:

- `numObjects` is a [BigNumber Int][1].
- `repoSize` is a [BigNumber Int][1], in bytes.
- `numObjects` is a [BigInt][1].
- `repoSize` is a [BigInt][1], in bytes.
- `repoPath` is a string.
- `version` is a string.
- `storageMax` is a [BigNumber Int][1].
- `storageMax` is a [BigInt][1].

### Example

Expand Down Expand Up @@ -135,6 +135,6 @@ console.log(version)
// "6"
```

[1]: https://github.com/MikeMcl/bignumber.js/
[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
[cid]: https://www.npmjs.com/package/cids
[AbortSignal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
18 changes: 9 additions & 9 deletions docs/core-api/STATS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,26 @@ An optional object which may have the following keys:

Each yielded object contains the following keys:

- `totalIn` - is a [BigNumber Int][bigNumber], in bytes.
- `totalOut` - is a [BigNumber Int][bigNumber], in bytes.
- `rateIn` - is a [BigNumber Int][bigNumber], in bytes.
- `rateOut` - is a [BigNumber Int][bigNumber], in bytes.
- `totalIn` - is a [BigInt][bigNumber], in bytes.
- `totalOut` - is a [BigInt][bigNumber], in bytes.
- `rateIn` - is a [BigInt][bigNumber], in bytes.
- `rateOut` - is a [BigInt][bigNumber], in bytes.

### Example

```JavaScript
for await (const stats of ipfs.stats.bw()) {
console.log(stats)
}
// { totalIn: BigNumber {...},
// totalOut: BigNumber {...},
// rateIn: BigNumber {...},
// rateOut: BigNumber {...} }
// { totalIn: BigInt {...},
// totalOut: BigInt {...},
// rateIn: BigInt {...},
// rateOut: BigInt {...} }
```

A great source of [examples][] can be found in the tests for this API.

[bigNumber]: https://github.com/MikeMcl/bignumber.js/
[bigNumber]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt
[examples]: https://github.com/ipfs/js-ipfs/blob/master/packages/interface-ipfs-core/src/stats
[AbortSignal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
[cid]: https://www.npmjs.com/package/cids
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-browserify/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ document.addEventListener('DOMContentLoaded', async () => {
async function display (cid) {
for await (const data of node.cat(cid)) {
document.getElementById('cid').innerText = cid
document.getElementById('content').innerText = data
document.getElementById('content').innerText = new TextDecoder().decode(data)
document.getElementById('output').setAttribute('style', 'display: block')
}
}
Expand Down
7 changes: 2 additions & 5 deletions examples/browser-create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ipfs-css": "^0.13.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "^3.2.0",
"react-scripts": "^4.0.3",
"tachyons": "^4.11.1"
},
"devDependencies": {
Expand All @@ -26,9 +26,6 @@
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
"last 2 versions and not dead and > 2%"
]
}
4 changes: 2 additions & 2 deletions examples/browser-http-client-upload-file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"scripts": {
"clean": "rimraf ./dist",
"build": "parcel build index.html --public-url '.'",
"build": "parcel build index.html --no-scope-hoist",
"start": "parcel index.html",
"test": "test-ipfs-example"
},
Expand All @@ -19,7 +19,7 @@
},
"devDependencies": {
"ipfs": "^0.54.4",
"parcel-bundler": "^1.12.4",
"parcel": "next",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/browser-http-client-upload-file/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict'

const React = require('react')
const ipfsClient = require('ipfs-http-client')
const { create: ipfsClient } = require('ipfs-http-client')

class App extends React.Component {
constructor () {
Expand Down
10 changes: 5 additions & 5 deletions examples/browser-ipns-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"main": "index.js",
"scripts": {
"build": "parcel build index.html --public-url ./",
"build": "parcel build index.html --no-scope-hoist",
"start": "parcel index.html",
"test": "test-ipfs-example"
},
Expand All @@ -15,8 +15,8 @@
"human-crypto-keys": "^0.1.4",
"ipfs": "^0.54.4",
"ipfs-http-client": "^49.0.4",
"ipfs-utils": "^6.0.1",
"ipns": "^0.8.0",
"ipfs-utils": "^6.0.4",
"ipns": "^0.10.0",
"it-last": "^1.0.4",
"p-retry": "^4.2.0",
"uint8arrays": "^2.1.3"
Expand All @@ -27,9 +27,9 @@
"devDependencies": {
"delay": "^4.4.0",
"execa": "^5.0.0",
"ipfsd-ctl": "^7.2.0",
"ipfsd-ctl": "^8.0.0",
"go-ipfs": "0.8.0",
"parcel-bundler": "^1.12.4",
"parcel": "next",
"path": "^0.12.7",
"test-ipfs-example": "^3.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions examples/browser-mfs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"author": "",
"license": "ISC",
"devDependencies": {
"html-webpack-plugin": "^3.2.0",
"html-webpack-plugin": "^5.3.1",
"http-server": "^0.12.3",
"node-polyfill-webpack-plugin": "^1.0.3",
"rimraf": "^3.0.2",
"terser-webpack-plugin": "^1.2.1",
"test-ipfs-example": "^3.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
"webpack": "^5.28.0",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"ipfs": "^0.54.4",
Expand Down
Loading