diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..d71279d Binary files /dev/null and b/.DS_Store differ diff --git a/assets/.DS_Store b/assets/.DS_Store new file mode 100644 index 0000000..71d1cc2 Binary files /dev/null and b/assets/.DS_Store differ diff --git a/guide/making-a-pear-desktop-app.md b/guide/making-a-pear-desktop-app.md index 22a334c..0253d54 100644 --- a/guide/making-a-pear-desktop-app.md +++ b/guide/making-a-pear-desktop-app.md @@ -169,6 +169,14 @@ Running `pear run --dev .` should show **Note**: Close the app before installing dependencies. If dependencies are installed while the app is running, an error is thrown. +Install the development dependencies using: +``` +npm install +``` +This will install the following: +- [pear-interface](https://github.com/holepunchto/pear-interface) for documentation and auto-completion inside editor. +- [brittle](https://github.com/holepunchto/brittle) a TAP framework for testing. + The app uses these modules: - [hyperswarm](https://www.npmjs.com/package/hyperswarm) to connect peers on a "topic". @@ -187,11 +195,15 @@ npm install hyperswarm hypercore-crypto b4a Replace `app.js` with ``` js + +// For interactive documentation and code auto-completion in editor +/** @typedef {import('pear-interface')} */ + /* global Pear */ import Hyperswarm from 'hyperswarm' // Module for P2P networking and connecting peers import crypto from 'hypercore-crypto' // Cryptographic functions for generating the key in app import b4a from 'b4a' // Module for buffer-to-string and vice-versa conversions -const { teardown, updates } = Pear // Cleanup and updates function +const { teardown, updates } = Pear // Functions for cleanup and updates const swarm = new Hyperswarm() diff --git a/guide/making-a-pear-terminal-app.md b/guide/making-a-pear-terminal-app.md index 327bdc6..22b2be3 100644 --- a/guide/making-a-pear-terminal-app.md +++ b/guide/making-a-pear-terminal-app.md @@ -8,6 +8,14 @@ It continues where [Starting a Pear Terminal Project](./starting-a-pear-terminal ## Step 1. Install modules +Install the development dependencies using: +``` +npm install +``` +This will install the following: +- [pear-interface](https://github.com/holepunchto/pear-interface) for documentation and auto-completion inside editors. +- [brittle](https://github.com/holepunchto/brittle) a TAP framework for testing. + 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`. 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 Replace `index.js` with ``` js + +// For interactive documentation and code auto-completion in editor +/** @typedef {import('pear-interface')} */ + /* global Pear */ import Hyperswarm from 'hyperswarm' // Module for P2P networking and connecting peers import b4a from 'b4a' // Module for buffer-to-string and vice-versa conversions