Skip to content

Commit

Permalink
feat: Add web3storage example
Browse files Browse the repository at this point in the history
  • Loading branch information
icidasset committed Mar 22, 2024
1 parent 1e59a42 commit 3f00e84
Show file tree
Hide file tree
Showing 13 changed files with 2,493 additions and 22 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _More info in the [package readme](https://github.com/wnfs-wg/nest/tree/main/pac

- [`audio`](https://github.com/wnfs-wg/nest/tree/main/examples/audio) - Shows how to play audio from a file system using an `<audio>` element.
- [`demo`](https://github.com/wnfs-wg/nest/tree/main/examples/demo) - A simple demo of how the `nest` package is used.
- [`web3storage`](https://github.com/wnfs-wg/nest/tree/main/examples/web3storage) - An example app that shows how to store a WNFS on Web3Storage using the `nest` package.

### Checkout examples

Expand Down
19 changes: 19 additions & 0 deletions examples/web3storage/.codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "https://codesandbox.io/schemas/tasks.json",
"setupTasks": ["pnpm install"],
"tasks": {
"install-dependencies": {
"name": "Install Dependencies",
"command": "pnpm install",
"restartOn": {
"files": ["package.json", "pnpm-lock.yaml"],
"branch": true
}
},
"dev": {
"name": "Run Dev Server",
"command": "pnpm dev",
"runAtStart": true
}
}
}
12 changes: 12 additions & 0 deletions examples/web3storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Web3Storage example

An example app that shows how to store a WNFS on Web3Storage using the `@wnfs-wg/nest` package.

## Run locally

From this directory:

```bash
pnpm install
pnpm dev
```
51 changes: 51 additions & 0 deletions examples/web3storage/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "demo",
"type": "module",
"version": "1.0.0",
"private": true,
"description": "",
"author": "Steven Vandevelde <[email protected]> (tokono.ma)",
"license": "MIT",
"keywords": [],
"main": "src/main.jsx",
"scripts": {
"lint": "tsc --build && eslint . && prettier --check '**/*.{js,jsx,ts,tsx,yml,json,css}' --ignore-path ../../.gitignore",
"dev": "rsbuild dev",
"build": "rsbuild build",
"preview": "rsbuild preview"
},
"dependencies": {
"@picocss/pico": "^2.0.6",
"@ucanto/core": "^9.0.1",
"@web3-storage/upload-client": "^13.1.0",
"@web3-storage/w3up-client": "^12.5.0",
"@wnfs-wg/nest": "*",
"blockstore-core": "^4.4.0",
"blockstore-idb": "^1.1.8",
"idb-keyval": "^6.2.1",
"interface-blockstore": "^5.2.10",
"maake-oob": "^0.1.4",
"partykit-transport": "^0.1.0",
"qrcode": "^1.5.3"
},
"devDependencies": {
"@rsbuild/core": "^0.5.2",
"@types/node": "^20.11.30",
"@types/qrcode": "^1.5.5",
"typescript": "5.4.3"
},
"eslintConfig": {
"extends": [
"@fission-codes"
],
"ignorePatterns": [
"dist"
],
"rules": {
"no-console": [
"off",
"always"
]
}
}
}
7 changes: 7 additions & 0 deletions examples/web3storage/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from "@rsbuild/core";

export default defineConfig({
html: {
template: "./src/index.html",
},
});
Loading

0 comments on commit 3f00e84

Please sign in to comment.