Refactor and renaming
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { insertAtCursor } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { insertAtCursor } from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
const dateMatchRegex = /(\d{4}\-\d{2}\-\d{2})/g;
|
||||
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import type { IndexTreeEvent } from "@silverbulletmd/web/app_event";
|
||||
|
||||
import { batchSet, scanPrefixGlobal } from "@silverbulletmd/plugos-silverbullet-syscall/index";
|
||||
import { collectNodesOfType, ParseTree, renderToText } from "@silverbulletmd/common/tree";
|
||||
import {
|
||||
batchSet,
|
||||
scanPrefixGlobal,
|
||||
} from "@plugos/plugos-silverbullet-syscall/index";
|
||||
import {
|
||||
collectNodesOfType,
|
||||
ParseTree,
|
||||
renderToText,
|
||||
} from "@silverbulletmd/common/tree";
|
||||
import { removeQueries } from "../query/util";
|
||||
import { applyQuery, QueryProviderEvent } from "../query/engine";
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { getCursor, getText, insertAtPos, replaceRange } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import {
|
||||
getCursor,
|
||||
getText,
|
||||
insertAtPos,
|
||||
replaceRange,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
export async function toggleH1() {
|
||||
await togglePrefix("# ");
|
||||
|
||||
@@ -3,9 +3,9 @@ import {
|
||||
getCursor,
|
||||
getText,
|
||||
navigate as navigateTo,
|
||||
openUrl
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
openUrl,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
import { nodeAtPos, ParseTree } from "@silverbulletmd/common/tree";
|
||||
|
||||
const materializedQueryPrefix = /<!--\s*#query\s+/;
|
||||
|
||||
+10
-10
@@ -4,32 +4,32 @@ import {
|
||||
clearPageIndex as clearPageIndexSyscall,
|
||||
clearPageIndexForPage,
|
||||
scanPrefixGlobal,
|
||||
set
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/index";
|
||||
set,
|
||||
} from "@plugos/plugos-silverbullet-syscall/index";
|
||||
import {
|
||||
flashNotification,
|
||||
getCurrentPage,
|
||||
getText,
|
||||
matchBefore,
|
||||
navigate,
|
||||
prompt
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
prompt,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
import { dispatch } from "@silverbulletmd/plugos-syscall/event";
|
||||
import { dispatch } from "@plugos/plugos-syscall/event";
|
||||
import {
|
||||
deletePage as deletePageSyscall,
|
||||
listPages,
|
||||
readPage,
|
||||
writePage
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
writePage,
|
||||
} from "@plugos/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
import {
|
||||
addParentPointers,
|
||||
collectNodesMatching,
|
||||
ParseTree,
|
||||
renderToText,
|
||||
replaceNodesMatching
|
||||
replaceNodesMatching,
|
||||
} from "@silverbulletmd/common/tree";
|
||||
import { applyQuery, QueryProviderEvent } from "../query/engine";
|
||||
import { PageMeta } from "@silverbulletmd/common/types";
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { EndpointRequest, EndpointResponse } from "@silverbulletmd/plugos/hooks/endpoint";
|
||||
import {
|
||||
EndpointRequest,
|
||||
EndpointResponse,
|
||||
} from "@plugos/plugos/hooks/endpoint";
|
||||
|
||||
export function endpointTest(req: EndpointRequest): EndpointResponse {
|
||||
console.log("I'm running on the server!", req);
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
import { listPages, readPage, writePage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
|
||||
import { filterBox, navigate, prompt } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import {
|
||||
listPages,
|
||||
readPage,
|
||||
writePage,
|
||||
} from "@plugos/plugos-silverbullet-syscall/space";
|
||||
import {
|
||||
filterBox,
|
||||
navigate,
|
||||
prompt,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
import { extractMeta } from "../query/data";
|
||||
import { renderToText } from "@silverbulletmd/common/tree";
|
||||
import { niceDate } from "./dates";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as clientStore from "@silverbulletmd/plugos-silverbullet-syscall/clientStore";
|
||||
import * as clientStore from "@plugos/plugos-silverbullet-syscall/clientStore";
|
||||
|
||||
export async function toggleMode() {
|
||||
let currentValue = !!(await clientStore.get("enableDraftMode"));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @ts-ignore
|
||||
import emojis from "./emoji.json";
|
||||
import { matchBefore } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { matchBefore } from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
const emojiMatcher = /\(([^\)]+)\)\s+(.+)$/;
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { readPage, writePage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
|
||||
import { getCurrentPage, getText } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { readPage, writePage } from "@plugos/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
|
||||
import {
|
||||
getCurrentPage,
|
||||
getText,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import { cleanMarkdown } from "../markdown/util";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
import { extractMeta } from "../query/data";
|
||||
|
||||
type GhostConfig = {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { run } from "@silverbulletmd/plugos-syscall/shell";
|
||||
import { flashNotification, prompt } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
|
||||
import { run } from "@plugos/plugos-syscall/shell";
|
||||
import {
|
||||
flashNotification,
|
||||
prompt,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
|
||||
|
||||
export async function commit(message?: string) {
|
||||
if (!message) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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";
|
||||
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";
|
||||
|
||||
export async function togglePreview() {
|
||||
let currentValue = !!(await clientStore.get("enableMarkdownPreview"));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import MarkdownIt from "markdown-it";
|
||||
import { getText, showRhs } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import * as clientStore from "@silverbulletmd/plugos-silverbullet-syscall/clientStore";
|
||||
import { getText, showRhs } from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import * as clientStore from "@plugos/plugos-silverbullet-syscall/clientStore";
|
||||
import { cleanMarkdown } from "./util";
|
||||
|
||||
const css = `
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { findNodeOfType, renderToText, replaceNodesMatching } from "@silverbulletmd/common/tree";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import {
|
||||
findNodeOfType,
|
||||
renderToText,
|
||||
replaceNodesMatching,
|
||||
} from "@silverbulletmd/common/tree";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
|
||||
export function encodePageUrl(name: string): string {
|
||||
return name.replaceAll(" ", "_");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Client4 } from "@mattermost/client";
|
||||
import { applyQuery, QueryProviderEvent } from "../query/engine";
|
||||
import { readPage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import { readPage } from "@plugos/plugos-silverbullet-syscall/space";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
import { extractMeta } from "../query/data";
|
||||
import { niceDate } from "../core/dates";
|
||||
import { Post } from "@mattermost/types/lib/posts";
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"generate": "lezer-generator query/query.grammar -o query/parse-query.js",
|
||||
"watch": "plugos-bundle -w --dist dist */*.plug.yaml",
|
||||
"build": "plugos-bundle --dist dist */*.plug.yaml"
|
||||
"watch": "plugos-bundle -w --dist dist --exclude @lezer/lr yaml -- */*.plug.yaml",
|
||||
"build": "plugos-bundle --dist dist --exclude @lezer/lr yaml -- */*.plug.yaml"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/globals": "^27.5.1",
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { getCursor, insertAtCursor, moveCursor } from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
import {
|
||||
getCursor,
|
||||
insertAtCursor,
|
||||
moveCursor,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
export async function insertQuery() {
|
||||
let cursorPos = await getCursor();
|
||||
|
||||
@@ -2,8 +2,16 @@
|
||||
// data:page@pos
|
||||
|
||||
import type { IndexTreeEvent } from "@silverbulletmd/web/app_event";
|
||||
import { batchSet, scanPrefixGlobal } from "@silverbulletmd/plugos-silverbullet-syscall";
|
||||
import { collectNodesOfType, findNodeOfType, ParseTree, replaceNodesMatching } from "@silverbulletmd/common/tree";
|
||||
import {
|
||||
batchSet,
|
||||
scanPrefixGlobal,
|
||||
} from "@plugos/plugos-silverbullet-syscall";
|
||||
import {
|
||||
collectNodesOfType,
|
||||
findNodeOfType,
|
||||
ParseTree,
|
||||
replaceNodesMatching,
|
||||
} from "@silverbulletmd/common/tree";
|
||||
import { parse as parseYaml, parseAllDocuments } from "yaml";
|
||||
import type { QueryProviderEvent } from "./engine";
|
||||
import { applyQuery } from "./engine";
|
||||
|
||||
@@ -3,17 +3,17 @@ import {
|
||||
getCurrentPage,
|
||||
getText,
|
||||
reloadPage,
|
||||
save
|
||||
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
save,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
|
||||
import { readPage, writePage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
|
||||
import { readPage, writePage } from "@plugos/plugos-silverbullet-syscall/space";
|
||||
import { invokeFunction } from "@plugos/plugos-silverbullet-syscall/system";
|
||||
import { parseQuery } from "./engine";
|
||||
import { replaceTemplateVars } from "../core/template";
|
||||
import { queryRegex, removeQueries } from "./util";
|
||||
import { dispatch } from "@silverbulletmd/plugos-syscall/event";
|
||||
import { dispatch } from "@plugos/plugos-syscall/event";
|
||||
import { replaceAsync } from "../lib/util";
|
||||
import { parseMarkdown } from "@silverbulletmd/plugos-silverbullet-syscall/markdown";
|
||||
import { parseMarkdown } from "@plugos/plugos-silverbullet-syscall/markdown";
|
||||
|
||||
export async function updateMaterializedQueriesCommand() {
|
||||
const currentPage = await getCurrentPage();
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import type { ClickEvent, IndexTreeEvent } from "@silverbulletmd/web/app_event";
|
||||
|
||||
import { batchSet, scanPrefixGlobal } 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 "@silverbulletmd/plugos-silverbullet-syscall/editor";
|
||||
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";
|
||||
import {
|
||||
dispatch,
|
||||
filterBox,
|
||||
getCursor,
|
||||
getText,
|
||||
} from "@plugos/plugos-silverbullet-syscall/editor";
|
||||
import {
|
||||
addParentPointers,
|
||||
collectNodesMatching,
|
||||
@@ -11,7 +19,7 @@ import {
|
||||
findNodeOfType,
|
||||
nodeAtPos,
|
||||
ParseTree,
|
||||
renderToText
|
||||
renderToText,
|
||||
} from "@silverbulletmd/common/tree";
|
||||
import { removeQueries } from "../query/util";
|
||||
import { applyQuery, QueryProviderEvent } from "../query/engine";
|
||||
|
||||
Reference in New Issue
Block a user