update example docs/scripts

This commit is contained in:
tabcat 2021-03-20 14:29:07 -05:00 committed by Mark Robert Henderson
parent 630bd3d497
commit 68971f4ad8
3 changed files with 47 additions and 17 deletions

View File

@ -189,38 +189,28 @@ See [API.md](https://github.com/orbitdb/orbit-db/blob/master/API.md) for the ful
## Examples ## Examples
### Install dependencies ### Install dependencies
``` ```
git clone https://github.com/orbitdb/orbit-db.git git clone https://github.com/orbitdb/orbit-db.git
cd orbit-db cd orbit-db
npm install npm install
``` ```
You'll also need babel and webpack, if you don't have them installed already:
```
npm install --global babel-cli
npm install --global webpack
```
Some dependencies depend on native addon modules, so you'll also need to meet [node-gyp's](https://github.com/nodejs/node-gyp#installation) installation prerequisites. Therefore, Linux users may need to Some dependencies depend on native addon modules, so you'll also need to meet [node-gyp's](https://github.com/nodejs/node-gyp#installation) installation prerequisites. Therefore, Linux users may need to
``` ```
make clean && make make clean-dependencies && make deps
``` ```
to redo the local package-lock.json with working native dependencies. to redo the local package-lock.json with working native dependencies.
### Browser example ### Browser example
In macOS:
``` ```
npm run build npm run build
npm run examples:browser-macos npm run examples:browser
``` ```
In Linux: Using Webpack:
``` ```
npm run build npm run build
npm run examples:browser-linux npm run examples:browser-webpack
``` ```
<p align="left"> <p align="left">

40
package-lock.json generated
View File

@ -11059,6 +11059,12 @@
} }
} }
}, },
"is-docker": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz",
"integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==",
"dev": true
},
"is-domain-name": { "is-domain-name": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-domain-name/-/is-domain-name-1.0.1.tgz", "resolved": "https://registry.npmjs.org/is-domain-name/-/is-domain-name-1.0.1.tgz",
@ -16771,6 +16777,40 @@
"mimic-fn": "^2.1.0" "mimic-fn": "^2.1.0"
} }
}, },
"open": {
"version": "7.4.2",
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
"integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
"dev": true,
"requires": {
"is-docker": "^2.0.0",
"is-wsl": "^2.1.1"
},
"dependencies": {
"is-wsl": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
"dev": true,
"requires": {
"is-docker": "^2.0.0"
}
}
}
},
"open-cli": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/open-cli/-/open-cli-6.0.1.tgz",
"integrity": "sha512-A5h8MF3GrT1efn9TiO9LPajDnLtuEiGQT5G8TxWObBlgt1cZJF1YbQo/kNtsD1bJb7HxnT6SaSjzeLq0Rfhygw==",
"dev": true,
"requires": {
"file-type": "^14.1.4",
"get-stdin": "^7.0.0",
"meow": "^6.1.0",
"open": "^7.0.3",
"temp-write": "^4.0.0"
}
},
"opencollective-postinstall": { "opencollective-postinstall": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz",

View File

@ -53,6 +53,7 @@
"markdown-toc": "^1.2.0", "markdown-toc": "^1.2.0",
"mkdirp": "^1.0.4", "mkdirp": "^1.0.4",
"mocha": "^8.1.1", "mocha": "^8.1.1",
"open-cli": "^6.0.1",
"orbit-db-test-utils": "^0.12.0", "orbit-db-test-utils": "^0.12.0",
"p-each-series": "^2.1.0", "p-each-series": "^2.1.0",
"p-map": "^4.0.0", "p-map": "^4.0.0",
@ -71,9 +72,8 @@
"scripts": { "scripts": {
"examples:eventlog": "node examples/eventlog.js", "examples:eventlog": "node examples/eventlog.js",
"examples:keyvalue": "node examples/keyvalue.js", "examples:keyvalue": "node examples/keyvalue.js",
"examples:browser-macos": "open examples/browser/browser.html", "examples:browser": "open-cli examples/browser/browser.html",
"examples:browser-linux": "xdg-open examples/browser/browser.html", "examples:browser-webpack": "open-cli examples/browser/browser-webpack-example/index.html",
"examples:browser-windows": "start examples/browser/browser.html",
"lint:docs": "remark -qf -u validate-links .", "lint:docs": "remark -qf -u validate-links .",
"test:all": "npm run test:browser-multiple-tabs && npm run test", "test:all": "npm run test:browser-multiple-tabs && npm run test",
"test": "cross-env TEST=all mocha", "test": "cross-env TEST=all mocha",