Skip to content

Commit 9f92985

Browse files
authored
Merge pull request #229 from Web3-API/prealpha-dev
Prep 0.0.1-prealpha.7 Release
2 parents 4eccf97 + ec65857 commit 9f92985

98 files changed

Lines changed: 2534 additions & 1016 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/js-ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
CI:
77
name: JS-CI
88
runs-on: ubuntu-latest
9-
timeout-minutes: 15
9+
timeout-minutes: 20
1010
steps:
1111
- name: Checkout repository
1212
uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# Web3API 0.0.1-prealpha.7
2+
## Features
3+
* Console Log Web3API
4+
* Calls log on logger plugin at uri w3://w3/logger. Default logger logs to console, but can be overridden with redirect to custom logger web3api implementation.
5+
* Log levels: Debug, Info, Warn, Error
6+
* `createWeb3ApiClient(...)` helper for easily setting up a Web3API Client with all needed plugins (ex: ethereum, ipfs, etc) in one function call.
7+
* Additional support for plugins can be added in the future, without bloating the `@web3api/client-js` package thanks to dynamic imports!
8+
* When using the Web3ApiClient, specify Web3API URIs without having to create a new URI class (`new Uri("...")`). Simply provide a string instead.
9+
* Improved plugin instantiation interface.
10+
11+
## Bug Fixes
12+
* Proper MsgPack numeric overflow assertions (closes: [#150](https://github.com/Web3-API/monorepo/issues/150))
13+
* Proper usage of [GraphQL Aliases](https://graphql.org/learn/queries/#aliases) when invoking multiple methods in one query.
14+
115
# Web3API 0.0.1-prealpha.6
216
## Features
317
* Web3API React Integration: `@web3api/react`

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1-prealpha.6
1+
0.0.1-prealpha.7

demos/simple-storage/dapp/src/web3api/setupClient.ts

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Uri, UriRedirect, Web3ApiClient } from "@web3api/client-js";
2-
import { EnsPlugin } from "@web3api/ens-plugin-js";
3-
import { EthereumPlugin } from "@web3api/ethereum-plugin-js";
4-
import { IpfsPlugin } from "@web3api/ipfs-plugin-js";
1+
import { Web3ApiClient, UriRedirect } from "@web3api/client-js";
2+
import { ensPlugin } from "@web3api/ens-plugin-js";
3+
import { ethereumPlugin } from "@web3api/ethereum-plugin-js";
4+
import { ipfsPlugin } from "@web3api/ipfs-plugin-js";
55

66
export async function setupWeb3ApiClient(): Promise<Web3ApiClient> {
77
const ethereum = (window as any).ethereum;
@@ -11,25 +11,16 @@ export async function setupWeb3ApiClient(): Promise<Web3ApiClient> {
1111

1212
const redirects: UriRedirect[] = [
1313
{
14-
from: new Uri("w3://ens/ethereum.web3api.eth"),
15-
to: {
16-
factory: () => new EthereumPlugin({ provider: ethereum }),
17-
manifest: EthereumPlugin.manifest()
18-
}
14+
from: "w3://ens/ethereum.web3api.eth",
15+
to: ethereumPlugin({ provider: ethereum }),
1916
},
2017
{
21-
from: new Uri("w3://ens/ipfs.web3api.eth"),
22-
to: {
23-
factory: () => new IpfsPlugin({ provider: 'https://ipfs.io' }),
24-
manifest: IpfsPlugin.manifest()
25-
}
18+
from: "w3://ens/ipfs.web3api.eth",
19+
to: ipfsPlugin({ provider: "https://ipfs.io" }),
2620
},
2721
{
28-
from: new Uri("w3://ens/ens.web3api.eth"),
29-
to: {
30-
factory: () => new EnsPlugin({ }),
31-
manifest: EnsPlugin.manifest()
32-
}
22+
from: "w3://ens/ens.web3api.eth",
23+
to: ensPlugin({}),
3324
}
3425
];
3526

demos/simple-storage/dapp/src/web3api/simplestorage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Uri, Web3ApiClient } from "@web3api/client-js";
1+
import { Web3ApiClient } from "@web3api/client-js";
22

3-
export const uri = new Uri("ens/api.simplestorage.eth");
3+
export const uri = "ens/api.simplestorage.eth";
44

55
export interface SetDataResult {
66
txReceipt: string,

demos/simple-storage/protocol/web3api.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
format: 0.0.1-prealpha.1
22
description: SimpleStorage Web3API Example
3-
repository: https://github.com/web3-api/prototype
3+
repository: https://github.com/web3-api/monorepo
44
mutation:
55
schema:
66
file: ./src/mutation/schema.graphql

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Hello and welcome to the documentation for Web3 API.
33
![](https://github.com/Web3-API/branding/blob/master/logo/Web3API_On_Black_BG.jpg?raw=true)
44

5-
You can find all source code here in [our monorepo](https://github.com/web3-api/prototype).
5+
You can find all source code here in [our monorepo](https://github.com/web3-api/monorepo).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"reset": "yarn clean && yarn && yarn build",
2323
"clean": "rimraf ./**/node_modules ./**/build ./**/coverage",
24-
"build": "lerna run build --no-private --ignore @web3api/cli && lerna run build --scope @web3api/cli",
24+
"build": "lerna run build --no-private --ignore @web3api/cli* --ignore @web3api/react && lerna run build --scope @web3api/client-js --scope @web3api/react && lerna run build --scope @web3api/cli",
2525
"lint": "lerna run lint",
2626
"lint:fix": "lerna run lint -- --fix",
2727
"lint:ci": "lerna run lint --parallel",

packages/apis/console/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Console Web3API
2+
3+
Calls log on logger plugin at uri `w3://w3/logger`. Default logger logs to console, but can be overridden with redirect to custom logger web3api implementation.
4+
5+
### Log levels
6+
7+
- DEBUG
8+
- INFO
9+
- WARN
10+
- ERROR
11+
12+
## Example
13+
14+
### Usage
15+
16+
In schema:
17+
```graph
18+
#import { Query } into Console from "w3://ens/console.eth"
19+
20+
type Query {
21+
customMethod(): Boolean!
22+
}
23+
```
24+
25+
In code:
26+
27+
```ts
28+
import { Console_Query } from "./w3";
29+
30+
function customMethod(): bool {
31+
Console_Query.info("some useful info about my API");
32+
33+
return true;
34+
}
35+
```
36+
### How To Run
37+
38+
### 1. Setup Test Env
39+
40+
```
41+
yarn run test:env:up
42+
```
43+
44+
### 2. Build & Deploy The Web3API
45+
46+
```
47+
yarn run build
48+
yarn run deploy
49+
```
50+
51+
### 3. Test The Web3API Using A Query Recipe
52+
53+
```
54+
npx w3 query ./recipes/e2e.json
55+
```

packages/apis/console/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@web3api/console",
3+
"description": "Web3API for logging",
4+
"private": true,
5+
"version": "0.0.1-prealpha.6",
6+
"scripts": {
7+
"build": "w3 build",
8+
"deploy": "w3 build --ipfs http://127.0.0.1:5001 --test-ens console.eth",
9+
"test": "w3 query ./recipes/e2e.json",
10+
"test:ci": "yarn test:env:up && yarn deploy && yarn test && yarn test:env:down",
11+
"test:env:up": "w3 test-env up",
12+
"test:env:down": "w3 test-env down"
13+
},
14+
"devDependencies": {
15+
"@web3api/cli": "0.0.1-prealpha.6",
16+
"@web3api/wasm-as": "0.0.1-prealpha.6",
17+
"js-yaml": "3.14.0"
18+
}
19+
}

0 commit comments

Comments
 (0)