Skip to content

Commit cb79d16

Browse files
committed
Use the deno-based build
1 parent 5f9bde8 commit cb79d16

File tree

9 files changed

+26
-11596
lines changed

9 files changed

+26
-11596
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"deno.enable": true,
3+
"editor.formatOnSave": true,
4+
"deno.config": "deno.jsonc"
5+
}

deno.jsonc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"importMap": "import_map.json",
3+
"tasks": {
4+
"build": "plugos-bundle --importmap import_map.json hello.plug.yaml",
5+
"watch": "plugos-bundle -w --importmap import_map.json hello.plug.yaml"
6+
}
7+
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: hello-world
22
version: 0.1
3+
imports:
4+
- https://get.silverbullet.md/global.plug.json
35
functions:
46
helloWorld:
57
path: "./hello.ts:helloWorld"
68
command:
7-
name: "Say hello"
9+
name: "Say hello"

hello.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { flashNotification } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
1+
import { editor } from "$sb/silverbullet-syscall/mod.ts";
22

33
const loneRangerQuotes = [
44
"Hi-Yo! Silver",
@@ -8,5 +8,7 @@ const loneRangerQuotes = [
88
];
99

1010
export async function helloWorld() {
11-
await flashNotification(loneRangerQuotes[Math.floor(Math.random() * loneRangerQuotes.length)]);
11+
await editor.flashNotification(
12+
loneRangerQuotes[Math.floor(Math.random() * loneRangerQuotes.length)],
13+
);
1214
}

import_map.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"imports": {
3+
"$sb/": "https://deno.land/x/silverbullet@0.1.2/plug-api/",
4+
"handlebars": "https://esm.sh/handlebars",
5+
"yaml": "https://deno.land/std/encoding/yaml.ts"
6+
}
7+
}

0 commit comments

Comments
 (0)