Skip to content
This repository was archived by the owner on Sep 14, 2023. It is now read-only.

Commit 27f08d5

Browse files
harrysolovaytjjfvi
andauthored
docs: update readme (#1093)
Co-authored-by: tjjfvi <[email protected]>
1 parent 0589359 commit 27f08d5

File tree

1 file changed

+51
-8
lines changed

1 file changed

+51
-8
lines changed

Readme.md

+51-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# Capi
22

3-
> Capi is a work in progress. The documentation may not reflect the current
4-
> implementation. **Expect a stable release and proper documentation in early
5-
> 2023**.
6-
73
Capi is a framework for crafting interactions with Substrate chains. It consists
84
of a development server and fluent API, which facilitates multichain
95
interactions without compromising either performance or ease of use.
106

7+
- [Manual &rarr;](https://docs.capi.dev)<br />Guides to get up and running
118
- [Examples &rarr;](./examples)<br />SHOW ME THE CODE
129
- [API Reference &rarr;](https://deno.land/x/capi/mod.ts)<br />A generated API
1310
reference, based on type signatures and TSDocs.
@@ -27,7 +24,8 @@ npm i capi
2724
```json
2825
{
2926
"imports": {
30-
"capi": "https://deno.land/x/capi/mod.ts"
27+
"capi": "https://deno.land/x/capi/mod.ts",
28+
"capi/nets": "https://deno.land/x/capi/nets/mod.ts"
3129
}
3230
}
3331
```
@@ -39,7 +37,7 @@ npm i capi
3937
Create a `nets.ts` and specify the chains with which you'd like to interact.
4038

4139
```ts
42-
import { bins, net } from "capi"
40+
import { bins, net } from "capi/nets"
4341

4442
const bin = bins({ polkadot: ["polkadot", "v0.9.38"] })
4543

@@ -78,15 +76,60 @@ deno run -A https://deno.land/x/capi/main.ts
7876
## Codegen Chain-specific APIs
7977

8078
```sh
81-
capi sync --package-json package.json
79+
capi sync node
8280
```
8381

8482
<details>
8583
<summary>Deno Equivalent</summary>
8684
<br>
8785

8886
```sh
89-
capi sync --import-map import_map.json
87+
capi sync deno
88+
```
89+
90+
</details>
91+
92+
## Build Tool Integration
93+
94+
If you use a build tool such as Vite or Webpack during development, you'll need
95+
to configure two environment variables.
96+
97+
<details>
98+
<summary><code>vite.config.ts</code> example</summary>
99+
<br>
100+
101+
```ts
102+
import { defineConfig } from "vite"
103+
104+
export default defineConfig({
105+
define: {
106+
"process.env.CAPI_SERVER": process.env.CAPI_SERVER,
107+
"process.env.CAPI_TARGET": process.env.CAPI_TARGET,
108+
},
109+
})
110+
```
111+
112+
</details>
113+
114+
<details>
115+
<summary><code>webpack.config.js</code> example</summary>
116+
<br>
117+
118+
```ts
119+
import webpack from "webpack"
120+
121+
export default {
122+
plugins: [
123+
new webpack.DefinePlugin({
124+
process: {
125+
env: {
126+
CAPI_SERVER: JSON.stringify(process.env.CAPI_SERVER),
127+
CAPI_TARGET: JSON.stringify(process.env.CAPI_TARGET),
128+
},
129+
},
130+
}),
131+
],
132+
}
90133
```
91134

92135
</details>

0 commit comments

Comments
 (0)