From 081ef01ad76ae6a04e6175b65893e72c70298a8e Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Sat, 24 Sep 2022 12:38:58 +0000 Subject: [PATCH 1/5] Add Gitpod support --- .gitpod.yml | 36 ++++++++++++++++++++++++++++++++++++ README.md | 3 +++ 2 files changed, 39 insertions(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..f9db221 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,36 @@ +ports: + - port: 3000 + name: Silverbullet + onOpen: open-browser + visibility: public + +github: + prebuilds: + master: true + pullRequests: true + +tasks: + - name: Setup + init: | + nvm install + nvm use + npm install + npm run clean-build + gp sync-done setup + exit + - name: Run Silverbullet server + init: | + gp sync-await setup + nvm use + mkdir pages + command: npm run server -- ./pages + - name: Run ParcelJS + init: | + gp sync-await setup + nvm use + command: npm run watch + - name: Build plugins + init: | + gp sync-await setup + nvm use + command: npm run plugs diff --git a/README.md b/README.md index b8871f7..c682048 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,9 @@ Once downloaded and booted, SB will print out a URL to open SB in your browser ( #protip: If you have a PWA enabled browser (like any browser based on Chromium) hit that little button right of the location bar to install SB, and give it its own window frame (sans location bar) and desktop/dock icon. At last the PWA has found its killer app. ## Developing Silver Bullet + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/https://github.com/silverbulletmd/silverbullet) + 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. This repo is a monorepo using npm's "workspaces" feature. It consists of a number of npm packages under `packages`. From 4c59c3f44d94f9acfddc9380b16733a6eded1016 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Sat, 24 Sep 2022 16:30:05 +0000 Subject: [PATCH 2/5] tmp From dae302b2cd2293649178799e6f8068153afd55d1 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Sat, 24 Sep 2022 17:01:16 +0000 Subject: [PATCH 3/5] Add shortcut hint for command switcher --- packages/web/components/top_bar.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/web/components/top_bar.tsx b/packages/web/components/top_bar.tsx index 4e0f8ff..5732f24 100644 --- a/packages/web/components/top_bar.tsx +++ b/packages/web/components/top_bar.tsx @@ -7,6 +7,7 @@ import { import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useEffect, useState } from "react"; import { Notification } from "../types"; +import { isMacLike } from "../../common/util"; function prettyName(s: string | undefined): string { if (!s) { @@ -40,6 +41,8 @@ export function TopBar({ }) { const [theme, setTheme] = useState(localStorage.theme ?? "light"); + const isMac = isMacLike(); + return (
{lhs} @@ -83,7 +86,7 @@ export function TopBar({ onActionClick(); e.stopPropagation(); }} - title="Open the command palette" + title={"Open the command palette (" + (isMac ? "Cmd" : "Ctrl") + "+/)"} > From 934f64115ecaf2546cda30a225c9f2f46ee9534e Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sat, 24 Sep 2022 20:07:23 +0200 Subject: [PATCH 4/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c682048..b321cb1 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Once downloaded and booted, SB will print out a URL to open SB in your browser ( ## Developing Silver Bullet -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/https://github.com/silverbulletmd/silverbullet) +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/silverbulletmd/silverbullet) 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. From 949518355b2829a01fc4eb655b0f483610ccf802 Mon Sep 17 00:00:00 2001 From: Ben Schumacher Date: Sun, 25 Sep 2022 00:07:07 +0000 Subject: [PATCH 5/5] Fix Gitpod prebuilt image --- .gitpod.Dockerfile | 7 +++++++ .gitpod.yml | 15 +++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .gitpod.Dockerfile diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 0000000..1c4c6ab --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,7 @@ +FROM gitpod/workspace-full:latest + +RUN bash -c 'VERSION="18" \ + && source $HOME/.nvm/nvm.sh && nvm install $VERSION \ + && nvm use $VERSION && nvm alias default $VERSION' + +RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix diff --git a/.gitpod.yml b/.gitpod.yml index f9db221..d430943 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,3 +1,6 @@ +image: + file: .gitpod.Dockerfile + ports: - port: 3000 name: Silverbullet @@ -12,25 +15,17 @@ github: tasks: - name: Setup init: | - nvm install - nvm use npm install npm run clean-build gp sync-done setup - exit - name: Run Silverbullet server init: | gp sync-await setup - nvm use mkdir pages command: npm run server -- ./pages - name: Run ParcelJS - init: | - gp sync-await setup - nvm use + init: gp sync-await setup command: npm run watch - name: Build plugins - init: | - gp sync-await setup - nvm use + init: gp sync-await setup command: npm run plugs