From 8f5eddbaba2c1734e42c7191f7a4aae419aa360d Mon Sep 17 00:00:00 2001 From: David Mark Clements Date: Fri, 15 Dec 2023 13:57:30 +0100 Subject: [PATCH] terminal doc stubs --- README.md | 8 +++++--- ...ear-app.md => making-a-pear-desktop-app.md} | 2 +- guide/making-a-pear-terminal-app.md | 17 +++++++++++++++++ ...t.md => starting-a-pear-desktop-project.md} | 0 guide/starting-a-pear-terminal-project.md | 18 ++++++++++++++++++ 5 files changed, 41 insertions(+), 4 deletions(-) rename guide/{making-a-pear-app.md => making-a-pear-desktop-app.md} (99%) create mode 100644 guide/making-a-pear-terminal-app.md rename guide/{starting-a-pear-project.md => starting-a-pear-desktop-project.md} (100%) create mode 100644 guide/starting-a-pear-terminal-project.md diff --git a/README.md b/README.md index c869a3e..3a89a9a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Pear by Holepunch is a combined Peer-to-Peer (P2P) Runtime, Development & Deploy Pear makes it possible to build, share and extend P2P applications using common Web and Mobile technology. -Herein is everything needed to create unstoppable, zero-infrastructure P2P applications for Desktop, Terminal (soon) & Mobile (soon). +Herein is everything needed to create unstoppable, zero-infrastructure P2P applications for Desktop, Terminal & Mobile (soon). Welcome to the Internet of Peers   _– Holepunch, the P2P Company_ @@ -16,8 +16,10 @@ Welcome to the Internet of Peers ### Guide * [Getting Started](./guide/getting-started.md) -* [Starting a Pear Project](./guide/starting-a-pear-project.md) -* [Making a Pear Application](./guide/making-a-pear-app.md) +* [Starting a Pear Desktop Project](./guide/starting-a-pear-desktop-project.md) +* [Making a Pear Desktop Application](./guide/making-a-pear-desktop-app.md) +* [Starting a Pear Terminal Project](./guide/starting-a-pear-terminal-project.md) +* [Making a Pear Terminal Application](./guide/making-a-pear-terminal-app.md) * [Sharing a Pear Application](./guide/sharing-a-pear-app.md) * [Releasing a Pear Application](./guide/releasing-a-pear-app.md) diff --git a/guide/making-a-pear-app.md b/guide/making-a-pear-desktop-app.md similarity index 99% rename from guide/making-a-pear-app.md rename to guide/making-a-pear-desktop-app.md index 56bd998..d1477d6 100644 --- a/guide/making-a-pear-app.md +++ b/guide/making-a-pear-desktop-app.md @@ -1,4 +1,4 @@ -# Making a Pear Application +# Making a Pear Desktop Application ## Step 1. Install modules diff --git a/guide/making-a-pear-terminal-app.md b/guide/making-a-pear-terminal-app.md new file mode 100644 index 0000000..c2501fc --- /dev/null +++ b/guide/making-a-pear-terminal-app.md @@ -0,0 +1,17 @@ +# Making a Pear Terminal Application + +## Step 1. Install modules + +This app uses these modules: `hyperswarm`, `hypercore-crypto`, and `b4a`. + +``` +$ npm i hyperswarm hypercore-crypto b4a +``` + +**Note**: If the modules are installed while the app is running an error is thrown similar to `Cannot find package 'hyperswarm' imported from /app.js`. When installing modules, close down the app, before they can be installed. + +- [hyperswarm](https://www.npmjs.com/package/hyperswarm). One of the main building blocks. Find peers that share a "topic". +- [hypercore-crypto](https://www.npmjs.com/package/hypercore-crypto). A set of crypto function used in Pear. +- [b4a](https://www.npmjs.com/package/b4a). A set of functions for bridging the gap between the Node.js `Buffer` class and the `Uint8Array` class. + +## Step 2. diff --git a/guide/starting-a-pear-project.md b/guide/starting-a-pear-desktop-project.md similarity index 100% rename from guide/starting-a-pear-project.md rename to guide/starting-a-pear-desktop-project.md diff --git a/guide/starting-a-pear-terminal-project.md b/guide/starting-a-pear-terminal-project.md new file mode 100644 index 0000000..af2c7d4 --- /dev/null +++ b/guide/starting-a-pear-terminal-project.md @@ -0,0 +1,18 @@ +# Starting a Pear Terminal Project + +## Step 1. Init + +First create a new project using `pear init`. + +``` +$ mkdir chat-bot +$ cd chat-bot +$ pear init --yes +``` + +This will create a base structure for the project. + +- `package.json`. Configuration for the app. Notice the `pear` property. +- `index.js`. The entrpoint for the app. +- `app.js`. The main code. +- `test/index.test.js`. Skeleton for writing tests.