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

Commit 1e9f277

Browse files
chore: update examples dependencies (#8)
1 parent a55696e commit 1e9f277

File tree

33 files changed

+349
-447
lines changed

33 files changed

+349
-447
lines changed
Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,28 @@
11
{
22
"name": "example-browser-add-readable-stream",
3-
"description": "How to add readable streams in the browser",
43
"version": "1.0.0",
5-
"main": "dist/index.html",
64
"private": true,
7-
"targets": {
8-
"main": {
9-
"engines": {
10-
"browsers": [
11-
"last 1 Chrome version"
12-
]
13-
}
14-
}
15-
},
5+
"description": "How to add readable streams in the browser",
6+
"keywords": [],
7+
"license": "MIT",
8+
"main": "dist/index.html",
169
"scripts": {
1710
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
1811
"build": "parcel build index.html --no-scope-hoist",
1912
"serve": "parcel serve index.html --open -p 8888",
2013
"start": "npm run serve",
2114
"test:example": "npm run build && playwright test tests"
2215
},
23-
"keywords": [],
24-
"license": "MIT",
16+
"browserslist": "last 1 Chrome version",
2517
"dependencies": {
26-
"ipfs": "^0.55.4"
18+
"ipfs": "^0.56.0"
2719
},
2820
"devDependencies": {
29-
"parcel": "latest",
30-
"rimraf": "^3.0.2",
21+
"@babel/core": "^7.14.8",
3122
"@playwright/test": "^1.12.3",
23+
"parcel": "latest",
3224
"playwright": "^1.12.3",
25+
"rimraf": "^3.0.2",
3326
"test-util-ipfs-example": "^1.0.2"
3427
}
3528
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
{
22
"name": "example-browser-browserify",
3-
"description": "Bundle js-ipfs with Browserify",
43
"version": "1.0.0",
5-
"main": "dist/index.html",
64
"private": true,
5+
"description": "Bundle js-ipfs with Browserify",
6+
"keywords": [],
7+
"license": "MIT",
8+
"main": "dist/index.html",
79
"scripts": {
810
"clean": "rimraf ./dist",
911
"build": "copyfiles -u 1 -a './public/**/*' './dist' && browserify ./src/index.js > ./dist/bundle.js",
1012
"serve": "http-server dist -a 127.0.0.1 -p 8888",
1113
"start": "npm run build && npm run serve",
1214
"test:example": "npm run build && playwright test tests"
1315
},
14-
"keywords": [],
15-
"license": "MIT",
16+
"dependencies": {
17+
"ipfs": "^0.56.0"
18+
},
1619
"devDependencies": {
1720
"@playwright/test": "^1.12.3",
1821
"browserify": "^17.0.0",
@@ -23,8 +26,5 @@
2326
"playwright": "^1.12.3",
2427
"rimraf": "^3.0.2",
2528
"test-util-ipfs-example": "^1.0.2"
26-
},
27-
"dependencies": {
28-
"ipfs": "^0.55.4"
2929
}
3030
}

examples/browser-create-react-app/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,19 @@ But with modern hosting services like Heroku, Netlity or Fleek, you can skip the
9595

9696
## Usage
9797

98-
A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.
98+
This is a minimal demonstration of how to use `js-ipfs` in a `create-react-app` generated app.
99+
100+
It boots up a `js-ipfs` instance (an IPFS node) via a custom React hook in `./src/hooks/use-ipfs-factory.js`, which is called from `./src/App.js`. Once the IPFS node is set up, `./src/App.js` displays the [PeerId](https://docs.libp2p.io/concepts/peer-id/) of this node and the version number of `js-ipfs` used to spawn it.
99101

100102
All React applications store their main logic in `App.js`:
101103

102-
- `App.js` renders the cosmetics of the demo and call `useIpfs` to retrieve the `id` of the node
104+
- `App.js` renders the cosmetics of the demo and calls `useIpfs` to retrieve the `id` of the node
103105
- `useIpfsFactory.js` initialises and closes the IPFS local node
104106
- `useIpfs.js` does the actual calls to IPFS to retrieve the property specified in argument (here the retrieved property is `id`, requested from `App.js`)
105107

106108
Once the IPFS node is set up, `App.js` displays its ident and its version number.
107109

108-
> _Remember that a Peer ID of an IPFS node is [the multihash of the public key of this node](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#peer-ids), and the public-private key pair of a node is generated by typing `ipfs init`._
110+
> _Side note: The PeerId of the IPFS node is [the multihash of the public key of this node](https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#peer-ids). The public-private key pair of a node is generated by typing `ipfs init`._
109111
110112
![Screen shot of the js ipfs node id info](./images/screenshot.png)
111113

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
11
{
22
"name": "example-browser-create-react-app",
3-
"description": "A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.",
43
"version": "1.0.0",
54
"private": true,
6-
"dependencies": {
7-
"@testing-library/jest-dom": "^5.14.1",
8-
"@testing-library/react": "^11.2.7",
9-
"@testing-library/user-event": "^12.8.3",
10-
"dot-prop": "^6.0.1",
11-
"ipfs": "^0.55.4",
12-
"ipfs-css": "^1.3.0",
13-
"react": "^17.0.2",
14-
"react-dom": "^17.0.2",
15-
"react-scripts": "4.0.3",
16-
"tachyons": "^4.12.0",
17-
"web-vitals": "^1.1.2"
18-
},
5+
"description": "A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.",
6+
"license": "MIT",
197
"scripts": {
208
"clean": "rimraf ./build",
219
"build": "react-scripts build",
@@ -24,12 +12,6 @@
2412
"test": "react-scripts test",
2513
"test:example": "npm run build && playwright test tests"
2614
},
27-
"eslintConfig": {
28-
"extends": [
29-
"react-app",
30-
"react-app/jest"
31-
]
32-
},
3315
"browserslist": {
3416
"production": [
3517
">0.2%",
@@ -42,11 +24,29 @@
4224
"last 1 safari version"
4325
]
4426
},
27+
"eslintConfig": {
28+
"extends": [
29+
"react-app",
30+
"react-app/jest"
31+
]
32+
},
33+
"dependencies": {
34+
"@testing-library/jest-dom": "^5.14.1",
35+
"@testing-library/react": "^11.2.7",
36+
"@testing-library/user-event": "^12.8.3",
37+
"dot-prop": "^6.0.1",
38+
"ipfs": "^0.56.0",
39+
"ipfs-css": "^1.3.0",
40+
"react": "^17.0.2",
41+
"react-dom": "^17.0.2",
42+
"react-scripts": "4.0.3",
43+
"tachyons": "^4.12.0",
44+
"web-vitals": "^1.1.2"
45+
},
4546
"devDependencies": {
46-
"rimraf": "^3.0.2",
4747
"@playwright/test": "^1.12.3",
4848
"playwright": "^1.12.3",
49+
"rimraf": "^3.0.2",
4950
"test-util-ipfs-example": "^1.0.2"
50-
},
51-
"license": "MIT"
51+
}
5252
}
Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
{
22
"name": "example-exchange-files-in-browser",
33
"version": "1.0.0",
4-
"main": "dist/index.html",
54
"private": true,
6-
"targets": {
7-
"main": {
8-
"engines": {
9-
"browsers": [
10-
"last 1 Chrome version"
11-
]
12-
}
13-
}
14-
},
5+
"license": "MIT",
6+
"main": "dist/index.html",
157
"scripts": {
168
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
179
"build": "parcel build index.html --no-scope-hoist",
@@ -20,19 +12,20 @@
2012
"test": "playwright test",
2113
"test:example": "npm run build && playwright test tests"
2214
},
23-
"license": "MIT",
15+
"browserslist": "last 1 Chrome version",
16+
"dependencies": {
17+
"ipfs": "^0.56.0",
18+
"it-all": "^1.0.4",
19+
"libp2p-websockets": "^0.16.1",
20+
"uint8arrays": "^2.1.6"
21+
},
2422
"devDependencies": {
25-
"ipfs-http-client": "^50.1.2",
26-
"parcel": "latest",
23+
"@babel/core": "^7.14.8",
2724
"@playwright/test": "^1.12.3",
25+
"ipfs-http-client": "^51.0.0",
26+
"parcel": "latest",
2827
"playwright": "^1.12.3",
2928
"rimraf": "^3.0.2",
3029
"test-util-ipfs-example": "^1.0.2"
31-
},
32-
"dependencies": {
33-
"uint8arrays": "^2.1.6",
34-
"ipfs": "^0.55.4",
35-
"it-all": "^1.0.4",
36-
"libp2p-websockets": "^0.16.1"
3730
}
3831
}
Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,46 @@
11
{
22
"name": "example-browser-ipns-publish",
3-
"description": "An example demonstrating publishing to IPNS in the browser",
43
"version": "1.0.0",
5-
"main": "dist/index.html",
64
"private": true,
7-
"targets": {
8-
"main": {
9-
"engines": {
10-
"browsers": [
11-
"last 1 Chrome version"
12-
]
13-
}
14-
}
5+
"description": "An example demonstrating publishing to IPNS in the browser",
6+
"keywords": [
7+
"IPNS",
8+
"Publish"
9+
],
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/ipfs/js-ipfs/examples"
1513
},
14+
"license": "MIT",
15+
"author": "Doug Anderson",
16+
"main": "dist/index.html",
1617
"scripts": {
1718
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
1819
"build": "parcel build index.html --no-scope-hoist",
1920
"serve": "parcel serve index.html --open -p 8888",
2021
"start": "npm run serve",
2122
"test:example": "npm run build && playwright test tests"
2223
},
23-
"author": "Doug Anderson",
24-
"license": "MIT",
24+
"browserslist": "last 1 Chrome version",
2525
"dependencies": {
2626
"human-crypto-keys": "^0.1.4",
27-
"ipfs": "^0.55.4",
28-
"ipfs-http-client": "^50.1.2",
27+
"ipfs": "^0.56.0",
28+
"ipfs-http-client": "^51.0.0",
2929
"ipfs-utils": "^8.1.4",
3030
"ipns": "^0.13.2",
3131
"it-last": "^1.0.4",
3232
"p-retry": "^4.2.0",
3333
"uint8arrays": "^2.1.6"
3434
},
3535
"devDependencies": {
36+
"@babel/core": "^7.14.8",
37+
"@playwright/test": "^1.12.3",
3638
"delay": "^5.0.0",
3739
"execa": "^5.0.0",
38-
"ipfsd-ctl": "^9.0.0",
3940
"go-ipfs": "0.8.0",
41+
"ipfsd-ctl": "^9.0.0",
4042
"parcel": "latest",
41-
"rimraf": "^3.0.2",
42-
"@playwright/test": "^1.12.3",
43-
"playwright": "^1.12.3"
44-
},
45-
"repository": {
46-
"type": "git",
47-
"url": "https://github.com/ipfs/js-ipfs/examples"
48-
},
49-
"keywords": [
50-
"IPNS",
51-
"Publish"
52-
]
43+
"playwright": "^1.12.3",
44+
"rimraf": "^3.0.2"
45+
}
5346
}

examples/browser-mfs/package.json

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,29 @@
11
{
22
"name": "example-browser-mfs",
3-
"description": "How to use ipfs MFS in the browser",
43
"version": "1.0.0",
5-
"main": "dist/index.html",
64
"private": true,
7-
"targets": {
8-
"main": {
9-
"engines": {
10-
"browsers": [
11-
"last 1 Chrome version"
12-
]
13-
}
14-
}
15-
},
5+
"description": "How to use ipfs MFS in the browser",
6+
"license": "ISC",
7+
"author": "",
8+
"main": "dist/index.html",
169
"scripts": {
1710
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
1811
"build": "parcel build index.html --no-scope-hoist",
1912
"serve": "parcel serve index.html --open -p 8888",
2013
"start": "npm run serve",
2114
"test:example": "npm run build && playwright test tests"
2215
},
23-
"author": "",
24-
"license": "ISC",
16+
"browserslist": "last 1 Chrome version",
17+
"dependencies": {
18+
"ipfs": "^0.56.0",
19+
"mime-sniffer": "~0.0.3"
20+
},
2521
"devDependencies": {
22+
"@babel/core": "^7.14.8",
2623
"@playwright/test": "^1.12.3",
24+
"parcel": "latest",
2725
"playwright": "^1.12.3",
2826
"rimraf": "^3.0.2",
29-
"parcel": "latest",
3027
"test-util-ipfs-example": "^1.0.2"
31-
},
32-
"dependencies": {
33-
"ipfs": "^0.55.4",
34-
"mime-sniffer": "~0.0.3"
3528
}
3629
}

examples/browser-nextjs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
"test:example": "npm run build && playwright test tests"
1313
},
1414
"dependencies": {
15-
"ipfs": "^0.55.4",
15+
"ipfs": "^0.56.0",
1616
"next": "11.0.1",
1717
"react": "17.0.2",
1818
"react-dom": "17.0.2"
1919
},
2020
"devDependencies": {
2121
"eslint": "7.30.0",
2222
"eslint-config-next": "11.0.1",
23-
"test-util-ipfs-example": "^1.0.0",
24-
"rimraf": "^3.0.2"
23+
"rimraf": "^3.0.2",
24+
"test-util-ipfs-example": "^1.0.0"
2525
}
2626
}

0 commit comments

Comments
 (0)