Make stuff work with npm

This commit is contained in:
Zef Hemel
2022-04-25 11:24:13 +02:00
parent 44cf4c6a72
commit d52d81a909
32 changed files with 1471 additions and 10639 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
import { insertAtCursor } from "@plugos/plugos-silverbullet-syscall/editor";
import { insertAtCursor } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
const dateMatchRegex = /(\d{4}\-\d{2}\-\d{2})/g;
+1 -1
View File
@@ -3,7 +3,7 @@ import type { IndexTreeEvent } from "@silverbulletmd/web/app_event";
import {
batchSet,
scanPrefixGlobal,
} from "@plugos/plugos-silverbullet-syscall/index";
} from "@silverbulletmd/plugos-silverbullet-syscall/index";
import {
collectNodesOfType,
ParseTree,
+1 -1
View File
@@ -3,7 +3,7 @@ import {
getText,
insertAtPos,
replaceRange,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
export async function toggleH1() {
await togglePrefix("# ");
+2 -2
View File
@@ -4,8 +4,8 @@ import {
getText,
navigate as navigateTo,
openUrl,
} from "@plugos/plugos-silverbullet-syscall/editor";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import { nodeAtPos, ParseTree } from "@silverbulletmd/common/tree";
const materializedQueryPrefix = /<!--\s*#query\s+/;
+5 -5
View File
@@ -5,7 +5,7 @@ import {
clearPageIndexForPage,
scanPrefixGlobal,
set,
} from "@plugos/plugos-silverbullet-syscall/index";
} from "@silverbulletmd/plugos-silverbullet-syscall/index";
import {
flashNotification,
getCurrentPage,
@@ -13,7 +13,7 @@ import {
matchBefore,
navigate,
prompt,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { dispatch } from "@plugos/plugos-syscall/event";
import {
@@ -21,9 +21,9 @@ import {
listPages,
readPage,
writePage,
} from "@plugos/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import {
addParentPointers,
collectNodesMatching,
+3 -3
View File
@@ -2,13 +2,13 @@ import {
listPages,
readPage,
writePage,
} from "@plugos/plugos-silverbullet-syscall/space";
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import {
filterBox,
navigate,
prompt,
} from "@plugos/plugos-silverbullet-syscall/editor";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import { extractMeta } from "../query/data";
import { renderToText } from "@silverbulletmd/common/tree";
import { niceDate } from "./dates";
+1 -1
View File
@@ -1,4 +1,4 @@
import * as clientStore from "@plugos/plugos-silverbullet-syscall/clientStore";
import * as clientStore from "@silverbulletmd/plugos-silverbullet-syscall/clientStore";
export async function toggleMode() {
let currentValue = !!(await clientStore.get("enableDraftMode"));
+1 -1
View File
@@ -1,6 +1,6 @@
// @ts-ignore
import emojis from "./emoji.json";
import { matchBefore } from "@plugos/plugos-silverbullet-syscall/editor";
import { matchBefore } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
const emojiMatcher = /\(([^\)]+)\)\s+(.+)$/;
+7 -4
View File
@@ -1,11 +1,14 @@
import { readPage, writePage } from "@plugos/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
import {
readPage,
writePage,
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
import {
getCurrentPage,
getText,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { cleanMarkdown } from "../markdown/util";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import { extractMeta } from "../query/data";
type GhostConfig = {
+2 -2
View File
@@ -2,8 +2,8 @@ import { run } from "@plugos/plugos-syscall/shell";
import {
flashNotification,
prompt,
} from "@plugos/plugos-silverbullet-syscall/editor";
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
export async function commit(message?: string) {
if (!message) {
+3 -3
View File
@@ -1,6 +1,6 @@
import { hideRhs } from "@plugos/plugos-silverbullet-syscall/editor";
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
import * as clientStore from "@plugos/plugos-silverbullet-syscall/clientStore";
import { hideRhs } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
import * as clientStore from "@silverbulletmd/plugos-silverbullet-syscall/clientStore";
export async function togglePreview() {
let currentValue = !!(await clientStore.get("enableMarkdownPreview"));
+5 -2
View File
@@ -1,6 +1,9 @@
import MarkdownIt from "markdown-it";
import { getText, showRhs } from "@plugos/plugos-silverbullet-syscall/editor";
import * as clientStore from "@plugos/plugos-silverbullet-syscall/clientStore";
import {
getText,
showRhs,
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import * as clientStore from "@silverbulletmd/plugos-silverbullet-syscall/clientStore";
import { cleanMarkdown } from "./util";
const css = `
+1 -1
View File
@@ -3,7 +3,7 @@ import {
renderToText,
replaceNodesMatching,
} from "@silverbulletmd/common/tree";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
export function encodePageUrl(name: string): string {
return name.replaceAll(" ", "_");
+2 -2
View File
@@ -1,7 +1,7 @@
import { Client4 } from "@mattermost/client";
import { applyQuery, QueryProviderEvent } from "../query/engine";
import { readPage } from "@plugos/plugos-silverbullet-syscall/space";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
import { readPage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import { extractMeta } from "../query/data";
import { niceDate } from "../core/dates";
import { Post } from "@mattermost/types/lib/posts";
+9 -1
View File
@@ -1,11 +1,19 @@
{
"name": "@silverbulletmd/plugs",
"version": "1.0.0",
"author": {
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.1",
"license": "MIT",
"scripts": {
"generate": "lezer-generator query/query.grammar -o query/parse-query.js",
"watch": "plugos-bundle -w --dist dist --exclude @lezer/lr yaml -- */*.plug.yaml",
"build": "plugos-bundle --dist dist --exclude @lezer/lr yaml -- */*.plug.yaml"
},
"files": [
"dist"
],
"dependencies": {
"@jest/globals": "^27.5.1",
"@lezer/generator": "^0.15.4",
+1 -1
View File
@@ -2,7 +2,7 @@ import {
getCursor,
insertAtCursor,
moveCursor,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
export async function insertQuery() {
let cursorPos = await getCursor();
+1 -1
View File
@@ -5,7 +5,7 @@ import type { IndexTreeEvent } from "@silverbulletmd/web/app_event";
import {
batchSet,
scanPrefixGlobal,
} from "@plugos/plugos-silverbullet-syscall";
} from "@silverbulletmd/plugos-silverbullet-syscall";
import {
collectNodesOfType,
findNodeOfType,
+7 -4
View File
@@ -4,16 +4,19 @@ import {
getText,
reloadPage,
save,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { readPage, writePage } from "@plugos/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
import {
readPage,
writePage,
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
import { parseQuery } from "./engine";
import { replaceTemplateVars } from "../core/template";
import { queryRegex, removeQueries } from "./util";
import { dispatch } from "@plugos/plugos-syscall/event";
import { replaceAsync } from "../lib/util";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
export async function updateMaterializedQueriesCommand() {
const currentPage = await getCurrentPage();
+7 -4
View File
@@ -3,15 +3,18 @@ import type { ClickEvent, IndexTreeEvent } from "@silverbulletmd/web/app_event";
import {
batchSet,
scanPrefixGlobal,
} from "@plugos/plugos-silverbullet-syscall/index";
import { readPage, writePage } from "@plugos/plugos-silverbullet-syscall/space";
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
} from "@silverbulletmd/plugos-silverbullet-syscall/index";
import {
readPage,
writePage,
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
import {
dispatch,
filterBox,
getCursor,
getText,
} from "@plugos/plugos-silverbullet-syscall/editor";
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import {
addParentPointers,
collectNodesMatching,