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

chore: update examples dependencies #8

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions examples/browser-add-readable-stream/package.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
{
"name": "example-browser-add-readable-stream",
"description": "How to add readable streams in the browser",
"version": "1.0.0",
"main": "dist/index.html",
"private": true,
"targets": {
"main": {
"engines": {
"browsers": [
"last 1 Chrome version"
]
}
}
},
"description": "How to add readable streams in the browser",
"keywords": [],
"license": "MIT",
"main": "dist/index.html",
"scripts": {
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
"build": "parcel build index.html --no-scope-hoist",
"serve": "parcel serve index.html --open -p 8888",
"start": "npm run serve",
"test:example": "npm run build && playwright test tests"
},
"keywords": [],
"license": "MIT",
"browserslist": "last 1 Chrome version",
"dependencies": {
"ipfs": "^0.55.4"
"ipfs": "^0.56.0"
},
"devDependencies": {
"parcel": "latest",
"rimraf": "^3.0.2",
"@babel/core": "^7.14.8",
"@playwright/test": "^1.12.3",
"parcel": "latest",
"playwright": "^1.12.3",
"rimraf": "^3.0.2",
"test-util-ipfs-example": "^1.0.2"
}
}
14 changes: 7 additions & 7 deletions examples/browser-browserify/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "example-browser-browserify",
"description": "Bundle js-ipfs with Browserify",
"version": "1.0.0",
"main": "dist/index.html",
"private": true,
"description": "Bundle js-ipfs with Browserify",
"keywords": [],
"license": "MIT",
"main": "dist/index.html",
"scripts": {
"clean": "rimraf ./dist",
"build": "copyfiles -u 1 -a './public/**/*' './dist' && browserify ./src/index.js > ./dist/bundle.js",
"serve": "http-server dist -a 127.0.0.1 -p 8888",
"start": "npm run build && npm run serve",
"test:example": "npm run build && playwright test tests"
},
"keywords": [],
"license": "MIT",
"dependencies": {
"ipfs": "^0.56.0"
},
"devDependencies": {
"@playwright/test": "^1.12.3",
"browserify": "^17.0.0",
Expand All @@ -23,8 +26,5 @@
"playwright": "^1.12.3",
"rimraf": "^3.0.2",
"test-util-ipfs-example": "^1.0.2"
},
"dependencies": {
"ipfs": "^0.55.4"
}
}
8 changes: 5 additions & 3 deletions examples/browser-create-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ But with modern hosting services like Heroku, Netlity or Fleek, you can skip the

## Usage

A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.
This is a minimal demonstration of how to use `js-ipfs` in a `create-react-app` generated app.

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.

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

- `App.js` renders the cosmetics of the demo and call `useIpfs` to retrieve the `id` of the node
- `App.js` renders the cosmetics of the demo and calls `useIpfs` to retrieve the `id` of the node
- `useIpfsFactory.js` initialises and closes the IPFS local node
- `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`)

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

> _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`._
> _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`._

![Screen shot of the js ipfs node id info](./images/screenshot.png)

Expand Down
46 changes: 23 additions & 23 deletions examples/browser-create-react-app/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
{
"name": "example-browser-create-react-app",
"description": "A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.",
"version": "1.0.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"dot-prop": "^6.0.1",
"ipfs": "^0.55.4",
"ipfs-css": "^1.3.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"tachyons": "^4.12.0",
"web-vitals": "^1.1.2"
},
"description": "A minimal demonstration of how to use js-ipfs in a `create-react-app` generated app.",
"license": "MIT",
"scripts": {
"clean": "rimraf ./build",
"build": "react-scripts build",
Expand All @@ -24,12 +12,6 @@
"test": "react-scripts test",
"test:example": "npm run build && playwright test tests"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -42,11 +24,29 @@
"last 1 safari version"
]
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"dependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"dot-prop": "^6.0.1",
"ipfs": "^0.56.0",
"ipfs-css": "^1.3.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"tachyons": "^4.12.0",
"web-vitals": "^1.1.2"
},
"devDependencies": {
"rimraf": "^3.0.2",
"@playwright/test": "^1.12.3",
"playwright": "^1.12.3",
"rimraf": "^3.0.2",
"test-util-ipfs-example": "^1.0.2"
},
"license": "MIT"
}
}
31 changes: 12 additions & 19 deletions examples/browser-exchange-files/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
{
"name": "example-exchange-files-in-browser",
"version": "1.0.0",
"main": "dist/index.html",
"private": true,
"targets": {
"main": {
"engines": {
"browsers": [
"last 1 Chrome version"
]
}
}
},
"license": "MIT",
"main": "dist/index.html",
"scripts": {
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
"build": "parcel build index.html --no-scope-hoist",
Expand All @@ -20,19 +12,20 @@
"test": "playwright test",
"test:example": "npm run build && playwright test tests"
},
"license": "MIT",
"browserslist": "last 1 Chrome version",
"dependencies": {
"ipfs": "^0.56.0",
"it-all": "^1.0.4",
"libp2p-websockets": "^0.16.1",
"uint8arrays": "^2.1.6"
},
"devDependencies": {
"ipfs-http-client": "^50.1.2",
"parcel": "latest",
"@babel/core": "^7.14.8",
"@playwright/test": "^1.12.3",
"ipfs-http-client": "^51.0.0",
"parcel": "latest",
"playwright": "^1.12.3",
"rimraf": "^3.0.2",
"test-util-ipfs-example": "^1.0.2"
},
"dependencies": {
"uint8arrays": "^2.1.6",
"ipfs": "^0.55.4",
"it-all": "^1.0.4",
"libp2p-websockets": "^0.16.1"
}
}
47 changes: 20 additions & 27 deletions examples/browser-ipns-publish/package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
{
"name": "example-browser-ipns-publish",
"description": "An example demonstrating publishing to IPNS in the browser",
"version": "1.0.0",
"main": "dist/index.html",
"private": true,
"targets": {
"main": {
"engines": {
"browsers": [
"last 1 Chrome version"
]
}
}
"description": "An example demonstrating publishing to IPNS in the browser",
"keywords": [
"IPNS",
"Publish"
],
"repository": {
"type": "git",
"url": "https://github.com/ipfs/js-ipfs/examples"
},
"license": "MIT",
"author": "Doug Anderson",
"main": "dist/index.html",
"scripts": {
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
"build": "parcel build index.html --no-scope-hoist",
"serve": "parcel serve index.html --open -p 8888",
"start": "npm run serve",
"test:example": "npm run build && playwright test tests"
},
"author": "Doug Anderson",
"license": "MIT",
"browserslist": "last 1 Chrome version",
"dependencies": {
"human-crypto-keys": "^0.1.4",
"ipfs": "^0.55.4",
"ipfs-http-client": "^50.1.2",
"ipfs": "^0.56.0",
"ipfs-http-client": "^51.0.0",
"ipfs-utils": "^8.1.4",
"ipns": "^0.13.2",
"it-last": "^1.0.4",
"p-retry": "^4.2.0",
"uint8arrays": "^2.1.6"
},
"devDependencies": {
"@babel/core": "^7.14.8",
"@playwright/test": "^1.12.3",
"delay": "^5.0.0",
"execa": "^5.0.0",
"ipfsd-ctl": "^9.0.0",
"go-ipfs": "0.8.0",
"ipfsd-ctl": "^9.0.0",
"parcel": "latest",
"rimraf": "^3.0.2",
"@playwright/test": "^1.12.3",
"playwright": "^1.12.3"
},
"repository": {
"type": "git",
"url": "https://github.com/ipfs/js-ipfs/examples"
},
"keywords": [
"IPNS",
"Publish"
]
"playwright": "^1.12.3",
"rimraf": "^3.0.2"
}
}
29 changes: 11 additions & 18 deletions examples/browser-mfs/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
{
"name": "example-browser-mfs",
"description": "How to use ipfs MFS in the browser",
"version": "1.0.0",
"main": "dist/index.html",
"private": true,
"targets": {
"main": {
"engines": {
"browsers": [
"last 1 Chrome version"
]
}
}
},
"description": "How to use ipfs MFS in the browser",
"license": "ISC",
"author": "",
"main": "dist/index.html",
"scripts": {
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
"build": "parcel build index.html --no-scope-hoist",
"serve": "parcel serve index.html --open -p 8888",
"start": "npm run serve",
"test:example": "npm run build && playwright test tests"
},
"author": "",
"license": "ISC",
"browserslist": "last 1 Chrome version",
"dependencies": {
"ipfs": "^0.56.0",
"mime-sniffer": "~0.0.3"
},
"devDependencies": {
"@babel/core": "^7.14.8",
"@playwright/test": "^1.12.3",
"parcel": "latest",
"playwright": "^1.12.3",
"rimraf": "^3.0.2",
"parcel": "latest",
"test-util-ipfs-example": "^1.0.2"
},
"dependencies": {
"ipfs": "^0.55.4",
"mime-sniffer": "~0.0.3"
}
}
6 changes: 3 additions & 3 deletions examples/browser-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"test:example": "npm run build && playwright test tests"
},
"dependencies": {
"ipfs": "^0.55.4",
"ipfs": "^0.56.0",
"next": "11.0.1",
"react": "17.0.2",
"react-dom": "17.0.2"
},
"devDependencies": {
"eslint": "7.30.0",
"eslint-config-next": "11.0.1",
"test-util-ipfs-example": "^1.0.0",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"test-util-ipfs-example": "^1.0.0"
}
}
Loading