From c635c06450521b36808f0e41267621120d0fb1af Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 28 Jan 2022 09:42:52 +0000 Subject: [PATCH 1/3] fix: update examples to run with latest js-ipfs Updates all examples to the latest deps --- .../browser-add-readable-stream/package.json | 2 +- examples/browser-angular/package.json | 32 +++++++-------- examples/browser-browserify/package.json | 2 +- .../browser-create-react-app/package.json | 6 +-- .../src/hooks/use-ipfs.js | 4 +- examples/browser-exchange-files/package.json | 8 ++-- examples/browser-ipns-publish/index.html | 1 + examples/browser-ipns-publish/package.json | 8 ++-- examples/browser-ipns-publish/src/index.js | 40 ++++++++++++++----- examples/browser-ipns-publish/src/util.js | 2 - examples/browser-ipns-publish/tests/test.js | 2 + examples/browser-lit/package.json | 2 +- examples/browser-mfs/package.json | 2 +- examples/browser-nextjs/package.json | 6 +-- examples/browser-parceljs/package.json | 2 +- examples/browser-readablestream/package.json | 2 +- examples/browser-service-worker/package.json | 9 ++--- .../package.json | 6 +-- examples/browser-video-streaming/package.json | 2 +- examples/browser-vue/package.json | 4 +- examples/browser-webpack/package.json | 2 +- examples/circuit-relaying/package.json | 4 +- examples/circuit-relaying/src/helpers.js | 2 +- examples/custom-ipfs-repo/package.json | 8 ++-- examples/custom-ipld-formats/daemon-node.js | 2 +- .../custom-ipld-formats/in-process-node.js | 2 +- examples/custom-ipld-formats/package.json | 6 +-- examples/custom-libp2p/package.json | 6 +-- .../http-client-browser-pubsub/package.json | 6 +-- .../http-client-bundle-webpack/package.json | 4 +- examples/http-client-name-api/package.json | 4 +- examples/http-client-upload-file/package.json | 4 +- examples/ipfs-101/package.json | 2 +- examples/ipfs-client-add-files/package.json | 4 +- examples/run-in-electron/package.json | 2 +- examples/running-multiple-nodes/package.json | 2 +- .../get-path-accross-formats.js | 4 +- examples/traverse-ipld-graphs/package.json | 2 +- examples/traverse-ipld-graphs/tests/test.js | 2 +- examples/types-use-ipfs-from-ts/package.json | 4 +- .../types-use-ipfs-from-typed-js/package.json | 6 +-- 41 files changed, 121 insertions(+), 99 deletions(-) diff --git a/examples/browser-add-readable-stream/package.json b/examples/browser-add-readable-stream/package.json index 86ce17f0..052fea89 100644 --- a/examples/browser-add-readable-stream/package.json +++ b/examples/browser-add-readable-stream/package.json @@ -14,7 +14,7 @@ }, "browserslist": "last 1 Chrome version", "dependencies": { - "ipfs-core": "^0.12.2" + "ipfs-core": "^0.14.0" }, "devDependencies": { "@babel/core": "^7.14.8", diff --git a/examples/browser-angular/package.json b/examples/browser-angular/package.json index ad5d368c..de6639bd 100644 --- a/examples/browser-angular/package.json +++ b/examples/browser-angular/package.json @@ -12,26 +12,26 @@ "test": "npm run build && playwright test tests" }, "dependencies": { - "@angular/animations": "~12.2.0", - "@angular/common": "~12.2.0", - "@angular/compiler": "~12.2.0", - "@angular/core": "~12.2.0", - "@angular/forms": "~12.2.0", - "@angular/platform-browser": "~12.2.0", - "@angular/platform-browser-dynamic": "~12.2.0", - "@angular/router": "~12.2.0", + "@angular/animations": "^13.2.0", + "@angular/common": "^13.2.0", + "@angular/compiler": "^13.2.0", + "@angular/core": "^13.2.0", + "@angular/forms": "^13.2.0", + "@angular/platform-browser": "^13.2.0", + "@angular/platform-browser-dynamic": "^13.2.0", + "@angular/router": "^13.2.0", "global": "^4.4.0", - "ipfs-core": "^0.12.2", - "ipfs-core-types": "^0.8.0", - "rxjs": "~7.4.0", + "ipfs-core": "^0.14.0", + "ipfs-core-types": "^0.10.0", + "rxjs": "^7.5.2", "tslib": "^2.3.0", "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-builders/custom-webpack": "^12.1.0", - "@angular-devkit/build-angular": "~12.2.2", - "@angular/cli": "~12.2.2", - "@angular/compiler-cli": "~12.2.0", + "@angular-builders/custom-webpack": "^13.0.0", + "@angular-devkit/build-angular": "^13.2.0", + "@angular/cli": "^13.2.0", + "@angular/compiler-cli": "^13.2.0", "@playwright/test": "^1.12.3", "@types/jasmine": "~3.10.2", "@types/node": "^16.6.2", @@ -45,6 +45,6 @@ "playwright": "^1.12.3", "rimraf": "^3.0.2", "test-util-ipfs-example": "^1.0.2", - "typescript": "~4.3.5" + "typescript": "^4.5.5" } } diff --git a/examples/browser-browserify/package.json b/examples/browser-browserify/package.json index 68b00061..88570621 100644 --- a/examples/browser-browserify/package.json +++ b/examples/browser-browserify/package.json @@ -13,7 +13,7 @@ "test": "npm run build && playwright test tests" }, "dependencies": { - "ipfs-core": "^0.12.2" + "ipfs-core": "^0.14.0" }, "devDependencies": { "@playwright/test": "^1.12.3", diff --git a/examples/browser-create-react-app/package.json b/examples/browser-create-react-app/package.json index c8666026..20b8ed0e 100644 --- a/examples/browser-create-react-app/package.json +++ b/examples/browser-create-react-app/package.json @@ -36,12 +36,12 @@ "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.1.2", "@testing-library/user-event": "^13.5.0", - "dot-prop": "^6.0.1", - "ipfs-core": "^0.12.2", + "dot-prop": "^7.1.1", + "ipfs-core": "^0.14.0", "ipfs-css": "^1.3.0", "react": "^17.0.2", "react-dom": "^17.0.2", - "react-scripts": "4.0.3", + "react-scripts": "5.0.0", "tachyons": "^4.12.0", "web-vitals": "^2.1.2" }, diff --git a/examples/browser-create-react-app/src/hooks/use-ipfs.js b/examples/browser-create-react-app/src/hooks/use-ipfs.js index dc8ea76a..3052213c 100644 --- a/examples/browser-create-react-app/src/hooks/use-ipfs.js +++ b/examples/browser-create-react-app/src/hooks/use-ipfs.js @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react' -import dotProp from 'dot-prop' +import { getProperty } from 'dot-prop' // dot-prop: used to obtain a property of an object when the name of property is a string // here we get ipfs.id when calling dotProp.get(ipfs, cmd), with cmd = 'id' // and we get ipfs.hash when calling with cmd = 'hash' etc. @@ -22,7 +22,7 @@ export default function useIpfs (ipfs, cmd, opts) { async function callIpfs (ipfs, cmd, setRes, ...opts) { if (!ipfs) return null console.log(`Call ipfs.${cmd}`) - const ipfsCmd = dotProp.get(ipfs, cmd) + const ipfsCmd = getProperty(ipfs, cmd) const res = await ipfsCmd(...opts) console.log(`Result ipfs.${cmd}`, res) setRes(res) diff --git a/examples/browser-exchange-files/package.json b/examples/browser-exchange-files/package.json index b48a9543..ba077e92 100644 --- a/examples/browser-exchange-files/package.json +++ b/examples/browser-exchange-files/package.json @@ -12,7 +12,7 @@ }, "browserslist": "last 1 Chrome version", "dependencies": { - "ipfs-core": "^0.12.2", + "ipfs-core": "^0.14.0", "it-all": "^1.0.4", "libp2p-websockets": "^0.16.1", "uint8arrays": "^3.0.0" @@ -20,9 +20,9 @@ "devDependencies": { "@babel/core": "^7.14.8", "@playwright/test": "^1.12.3", - "ipfs": "^0.60.2", - "ipfs-core-types": "^0.8.0", - "ipfs-http-client": "^54.0.2", + "ipfs": "^0.62.0", + "ipfs-core-types": "^0.10.0", + "ipfs-http-client": "^56.0.0", "libp2p-webrtc-star-signalling-server": "^0.1.0", "parcel": "latest", "playwright": "^1.12.3", diff --git a/examples/browser-ipns-publish/index.html b/examples/browser-ipns-publish/index.html index ab774848..3c0b4cb3 100644 --- a/examples/browser-ipns-publish/index.html +++ b/examples/browser-ipns-publish/index.html @@ -198,6 +198,7 @@