From eb1530429e9a8fcbe7bf94957485c4fb0134dddc Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 10 Oct 2022 14:55:48 +0200 Subject: [PATCH] Update development.md --- website/🔨 Development.md | 51 ++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/website/🔨 Development.md b/website/🔨 Development.md index 25a1f7d1..136a8fae 100644 --- a/website/🔨 Development.md +++ b/website/🔨 Development.md @@ -1,38 +1,39 @@ ## Stack -Silver Bullet is written in [TypeScript](https://www.typescriptlang.org/) and built on top of the excellent [CodeMirror 6](https://codemirror.net/) editor component. Additional UI is built using React.js. [ParcelJS](https://parceljs.org/) is used to build both the front-end and back-end bundles. The server backend runs as a HTTP server on node.js using express. + +Silver Bullet is written in [TypeScript](https://www.typescriptlang.org/) and +built on top of the excellent [CodeMirror 6](https://codemirror.net/) editor +component. Additional UI is built using Preact. +[ES Build](https://esbuild.github.io) is used to build both the front-end and +back-end bundles. The server backend runs as a HTTP server on Deno using Oak. ## Development -This [Silver Bullet repo](https://github.com/zefhemel/silverbullet) is a monorepo using npm's "workspaces" feature. -Requirements: node 16+ and npm 8+ as well as C/C++ compilers (for compiling SQLite, on debian/ubuntu style systems you get these via the `build-essential` package) +Requirements: [Deno](https://deno.land/) 1.26. To run, after clone: ```shell -# Install dependencies -npm install -# Run initial build (web app, server, etc.) -npm run build -# Again, to install the CLIs just built (plugos-bundler, silverbullet) -npm install -# Build built-in plugs -npm run build-plugs -# Launch server -npm run server -- +deno task install ``` -This `` can be any folder with markdown files, upon first boot SB will ensure there is an `index.md` file (root page) and `PLUGS.md` file (with the default list of plugs to load). SB will also create an SQLite `data.db` file with various data caches and indices (you can delete this file at any time and use the `Space: Reindex` command to reindex everything). +To prepare the initial web and plug build run: -Open SB at http://localhost:3000 If you're using a browser supporting PWAs, you can install this page as a PWA. This also works on iOS (use the "Add to homescreen" option in the share menu). - -General development workflow: - -Run these in separate terminals ```shell -# Runs ParcelJS in watch mode, rebuilding the server and webapp continuously on change -npm run watch -# Runs the silverbullet server -npm run server -# Builds (and watches for changes) all builtin plugs (in packages/plugs) -npm run plugs +deno task build +``` + +You can then run the server in “watch mode” (automatically restarting when you +change source files) with: + +```shell +deno task watch-server -- +``` + +After this initial build, it's convenient to run three commands in parallel (in +separate terminals): + +```shell +deno task watch-web +deno task watch-server -- +deno task watch-plugs ```