Skip to content

Commit 2ee7373

Browse files
authored
add pear interface (#143)
* add pear interface * fix semi-colon spacing
1 parent 15b52d7 commit 2ee7373

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

Diff for: .DS_Store

6 KB
Binary file not shown.

Diff for: assets/.DS_Store

6 KB
Binary file not shown.

Diff for: guide/making-a-pear-desktop-app.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ Running `pear run --dev .` should show
169169

170170
**Note**: Close the app before installing dependencies. If dependencies are installed while the app is running, an error is thrown.
171171

172+
Install the development dependencies using:
173+
```
174+
npm install
175+
```
176+
This will install the following:
177+
- [pear-interface](https://github.com/holepunchto/pear-interface) for documentation and auto-completion inside editor.
178+
- [brittle](https://github.com/holepunchto/brittle) a TAP framework for testing.
179+
172180
The app uses these modules:
173181

174182
- [hyperswarm](https://www.npmjs.com/package/hyperswarm) to connect peers on a "topic".
@@ -187,11 +195,15 @@ npm install hyperswarm hypercore-crypto b4a
187195
Replace `app.js` with
188196

189197
``` js
198+
199+
// For interactive documentation and code auto-completion in editor
200+
/** @typedef {import('pear-interface')} */
201+
190202
/* global Pear */
191203
import Hyperswarm from 'hyperswarm' // Module for P2P networking and connecting peers
192204
import crypto from 'hypercore-crypto' // Cryptographic functions for generating the key in app
193205
import b4a from 'b4a' // Module for buffer-to-string and vice-versa conversions
194-
const { teardown, updates } = Pear // Cleanup and updates function
206+
const { teardown, updates } = Pear // Functions for cleanup and updates
195207

196208
const swarm = new Hyperswarm()
197209

Diff for: guide/making-a-pear-terminal-app.md

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ It continues where [Starting a Pear Terminal Project](./starting-a-pear-terminal
88

99
## Step 1. Install modules
1010

11+
Install the development dependencies using:
12+
```
13+
npm install
14+
```
15+
This will install the following:
16+
- [pear-interface](https://github.com/holepunchto/pear-interface) for documentation and auto-completion inside editors.
17+
- [brittle](https://github.com/holepunchto/brittle) a TAP framework for testing.
18+
1119
For the chat part of the app, the same modules are needed as in [Making a Pear Desktop Application](./making-a-pear-desktop-app.md), `hyperswarm`, `b4a` and `hypercore-crypto`.
1220

1321
Pear runs on [`Bare`](https://github.com/holepunchto/bare), a lightweight JavaScript runtime which is similar to Node.js but comes with very few internal modules. Almost all Bare functionality comes from dependencies. Pear Terminal Applications are Bare applications so we will need `bare-readline` and `bare-tty` to read user input.
@@ -22,6 +30,10 @@ npm i bare-readline bare-tty bare-process hyperswarm b4a hypercore-crypto
2230
Replace `index.js` with
2331

2432
``` js
33+
34+
// For interactive documentation and code auto-completion in editor
35+
/** @typedef {import('pear-interface')} */
36+
2537
/* global Pear */
2638
import Hyperswarm from 'hyperswarm' // Module for P2P networking and connecting peers
2739
import b4a from 'b4a' // Module for buffer-to-string and vice-versa conversions

0 commit comments

Comments
 (0)