Skip to content

Commit

Permalink
0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zefhemel committed Feb 29, 2024
1 parent ec858b8 commit e919aa8
Show file tree
Hide file tree
Showing 149 changed files with 248 additions and 889 deletions.
2 changes: 1 addition & 1 deletion common/common_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CodeWidgetHook } from "../web/hooks/code_widget.ts";
import { PanelWidgetHook } from "../web/hooks/panel_widget.ts";
import { SlashCommandHook } from "../web/hooks/slash_command.ts";
import { DataStoreMQ } from "$lib/data/mq.datastore.ts";
import { ParseTree } from "$lib/tree.ts";
import { ParseTree } from "../plug-api/lib/tree.ts";

export abstract class CommonSystem {
system!: System<SilverBulletHooks>;
Expand Down
2 changes: 1 addition & 1 deletion common/hooks/command.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Hook, Manifest } from "../../lib/plugos/types.ts";
import { System } from "../../lib/plugos/system.ts";
import { EventEmitter } from "../../lib/plugos/event.ts";
import { ObjectValue } from "../../type/types.ts";
import { ObjectValue } from "../../plug-api/types.ts";
import {
FrontmatterConfig,
SnippetConfig,
Expand Down
2 changes: 1 addition & 1 deletion common/markdown_parser/parse_tree.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ParseTree } from "$lib/tree.ts";
import type { ParseTree } from "../../plug-api/lib/tree.ts";
import type { Language, SyntaxNode } from "../deps.ts";

export function lezerToParseTree(
Expand Down
6 changes: 5 additions & 1 deletion common/markdown_parser/parser.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { parse } from "./parse_tree.ts";
import { collectNodesOfType, findNodeOfType, renderToText } from "$lib/tree.ts";
import {
collectNodesOfType,
findNodeOfType,
renderToText,
} from "$sb/lib/tree.ts";
import { assertEquals, assertNotEquals } from "$lib/test_deps.ts";
import { extendedMarkdownLanguage } from "./parser.ts";

Expand Down
4 changes: 2 additions & 2 deletions common/query_functions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FunctionMap } from "../type/types.ts";
import { FunctionMap } from "../plug-api/types.ts";
import { builtinFunctions } from "../lib/builtin_query_functions.ts";
import { System } from "../lib/plugos/system.ts";
import { Query } from "../type/types.ts";
import { Query } from "../plug-api/types.ts";
import { LimitedMap } from "$lib/limited_map.ts";

const pageCacheTtl = 10 * 1000; // 10s
Expand Down
2 changes: 1 addition & 1 deletion common/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { YAML } from "./deps.ts";
import { INDEX_TEMPLATE, SETTINGS_TEMPLATE } from "./PAGE_TEMPLATES.ts";
import { SpacePrimitives } from "./spaces/space_primitives.ts";
import { expandPropertyNames } from "../lib/json.ts";
import { expandPropertyNames } from "../plug-api/lib/json.ts";
import type { BuiltinSettings } from "../type/web.ts";

const yamlSettingsRegex = /^(```+|~~~+)ya?ml\r?\n([\S\s]+)\1/m;
Expand Down
2 changes: 1 addition & 1 deletion common/space.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SpacePrimitives } from "$common/spaces/space_primitives.ts";
import { plugPrefix } from "$common/spaces/constants.ts";

import { AttachmentMeta, FileMeta, PageMeta } from "../type/types.ts";
import { AttachmentMeta, FileMeta, PageMeta } from "../plug-api/types.ts";
import { EventHook } from "./hooks/event.ts";
import { safeRun } from "../lib/async.ts";

Expand Down
2 changes: 1 addition & 1 deletion common/space_script.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { System } from "../lib/plugos/system.ts";
import { ParseTree } from "$lib/tree.ts";
import { ParseTree } from "../plug-api/lib/tree.ts";
import { ScriptObject } from "../plugs/index/script.ts";
import { AppCommand, CommandDef } from "./hooks/command.ts";

Expand Down
2 changes: 1 addition & 1 deletion common/spaces/asset_bundle_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SpacePrimitives } from "./space_primitives.ts";
import { AssetBundle } from "../../lib/asset_bundle/bundle.ts";
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";

export class AssetBundlePlugSpacePrimitives implements SpacePrimitives {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/chunked_datastore_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { SpacePrimitives } from "./space_primitives.ts";
import { KvKey } from "$type/types.ts";
import { KvKey } from "../../plug-api/types.ts";
import { KvPrimitives } from "$lib/data/kv_primitives.ts";
import { KvMetaSpacePrimitives } from "./kv_meta_space_primitives.ts";
import { PrefixedKvPrimitives } from "$lib/data/prefixed_kv_primitives.ts";
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/datastore_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SpacePrimitives } from "./space_primitives.ts";
import { mime } from "mimetypes";
import { FileMeta } from "$type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { DataStore } from "$lib/data/datastore.ts";

export type FileContent = {
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/disk_space_primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from "https://deno.land/std@0.189.0/path/mod.ts";
import { readAll } from "https://deno.land/std@0.165.0/streams/conversion.ts";
import { SpacePrimitives } from "./space_primitives.ts";
import { mime } from "https://deno.land/x/mimetypes@v1.0.0/mod.ts";
import { FileMeta } from "$type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";

function lookupContentType(path: string): string {
return mime.getType(path) || "application/octet-stream";
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/encrypted_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import {
base32Decode,
base32Encode,
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/evented_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { EventHook } from "../hooks/event.ts";

import type { SpacePrimitives } from "./space_primitives.ts";
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/fallback_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import type { SpacePrimitives } from "./space_primitives.ts";

/**
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/filtered_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { SpacePrimitives } from "./space_primitives.ts";

export class FilteredSpacePrimitives implements SpacePrimitives {
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/http_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SpacePrimitives } from "./space_primitives.ts";
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { flushCachesAndUnregisterServiceWorker } from "../sw_util.ts";

export class HttpSpacePrimitives implements SpacePrimitives {
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/kv_meta_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "$type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { mime } from "mimetypes";
import { KvPrimitives } from "$lib/data/kv_primitives.ts";
import { SpacePrimitives } from "./space_primitives.ts";
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/plug_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SpacePrimitives } from "$common/spaces/space_primitives.ts";
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import {
NamespaceOperation,
PlugNamespaceHook,
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/ro_space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { SpacePrimitives } from "./space_primitives.ts";

export class ReadOnlySpacePrimitives implements SpacePrimitives {
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/s3_space_primitives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ClientOptions } from "https://deno.land/x/s3_lite_client@0.4.0/cli
import { KvMetaSpacePrimitives } from "./kv_meta_space_primitives.ts";
import { KvPrimitives } from "$lib/data/kv_primitives.ts";
import { mime } from "../deps.ts";
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { PrefixedKvPrimitives } from "$lib/data/prefixed_kv_primitives.ts";

export type S3SpacePrimitivesOptions = ClientOptions;
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/space_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FileMeta } from "../../type/types.ts";
import type { FileMeta } from "../../plug-api/types.ts";

/**
* A generic interface used by `Space` to interact with the underlying storage, designed to be easy to implement for different storage backends
Expand Down
2 changes: 1 addition & 1 deletion common/spaces/sync.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SpacePrimitives } from "./space_primitives.ts";
import { EventEmitter } from "../../lib/plugos/event.ts";
import { FileMeta } from "../../type/types.ts";
import { FileMeta } from "../../plug-api/types.ts";
import { plugPrefix } from "./constants.ts";

type SyncHash = number;
Expand Down
2 changes: 1 addition & 1 deletion common/syscalls/language.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SysCallMapping } from "../../lib/plugos/system.ts";
import { parse } from "../markdown_parser/parse_tree.ts";
import type { ParseTree } from "$lib/tree.ts";
import type { ParseTree } from "../../plug-api/lib/tree.ts";
import { builtinLanguages, languageFor } from "../languages.ts";

export function languageSyscalls(): SysCallMapping {
Expand Down
2 changes: 1 addition & 1 deletion common/syscalls/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SysCallMapping } from "../../lib/plugos/system.ts";
import { parse } from "../markdown_parser/parse_tree.ts";
import type { ParseTree } from "$lib/tree.ts";
import type { ParseTree } from "../../plug-api/lib/tree.ts";
import { extendedMarkdownLanguage } from "../markdown_parser/parser.ts";

export function markdownSyscalls(): SysCallMapping {
Expand Down
4 changes: 2 additions & 2 deletions common/syscalls/system.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { SyscallMeta } from "../../type/types.ts";
import { SyscallMeta } from "../../plug-api/types.ts";
import { SysCallMapping, System } from "../../lib/plugos/system.ts";
import type { Client } from "../../web/client.ts";
import { CommandDef } from "../hooks/command.ts";
import { proxySyscall } from "../../web/syscalls/util.ts";
import type { CommonSystem } from "../common_system.ts";
import { version } from "../../version.ts";
import { ParseTree } from "$lib/tree.ts";
import { ParseTree } from "../../plug-api/lib/tree.ts";

export function systemSyscalls(
system: System<any>,
Expand Down
4 changes: 2 additions & 2 deletions common/syscalls/template.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionMap } from "$type/types.ts";
import { AST } from "$lib/tree.ts";
import { FunctionMap } from "../../plug-api/types.ts";
import { AST } from "../../plug-api/lib/tree.ts";
import { SysCallMapping } from "$lib/plugos/system.ts";
import { renderTemplate } from "$common/template/render.ts";
import { parseTemplate } from "$common/template/template_parser.ts";
Expand Down
4 changes: 2 additions & 2 deletions common/template/render.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AST } from "$lib/tree.ts";
import { AST } from "../../plug-api/lib/tree.ts";
import { evalQueryExpression } from "$sb/lib/query_expression.ts";
import { expressionToKvQueryExpression } from "$sb/lib/parse-query.ts";
import { FunctionMap } from "../../type/types.ts";
import { FunctionMap } from "../../plug-api/types.ts";
import { jsonToMDTable } from "../../plugs/template/util.ts";

export async function renderTemplate(
Expand Down
4 changes: 2 additions & 2 deletions common/template/template_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { parse } from "../markdown_parser/parse_tree.ts";
import { parser as templateParser } from "./parse-template.js";
import { parser as expressionParser } from "../markdown_parser/parse-expression.js";
import { parser as queryParser } from "../markdown_parser/parse-query.js";
import { AST, parseTreeToAST } from "$lib/tree.ts";
import { deepEqual } from "../../lib/json.ts";
import { AST, parseTreeToAST } from "../../plug-api/lib/tree.ts";
import { deepEqual } from "../../plug-api/lib/json.ts";

export const templateLanguage = LRLanguage.define({
name: "template",
Expand Down
2 changes: 1 addition & 1 deletion lib/builtin_query_functions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FunctionMap } from "../type/types.ts";
import type { FunctionMap } from "../plug-api/types.ts";
import { niceDate, niceTime } from "./dates.ts";

export const builtinFunctions: FunctionMap = {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/datastore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DenoKvPrimitives } from "../data/deno_kv_primitives.ts";
import { KvPrimitives } from "../data/kv_primitives.ts";
import { assertEquals } from "https://deno.land/std@0.165.0/testing/asserts.ts";
import { PrefixedKvPrimitives } from "../data/prefixed_kv_primitives.ts";
import { Query } from "$type/types.ts";
import { Query } from "../../plug-api/types.ts";

async function test(db: KvPrimitives) {
const datastore = new DataStore(new PrefixedKvPrimitives(db, ["ds"]), {
Expand Down
2 changes: 1 addition & 1 deletion lib/data/datastore.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { applyQueryNoFilterKV } from "$sb/lib/query.ts";
import { FunctionMap, KV, KvKey, KvQuery } from "$type/types.ts";
import { FunctionMap, KV, KvKey, KvQuery } from "../../plug-api/types.ts";
import { builtinFunctions } from "$lib/builtin_query_functions.ts";
import { KvPrimitives } from "./kv_primitives.ts";
import { evalQueryExpression } from "$sb/lib/query_expression.ts";
Expand Down
2 changes: 1 addition & 1 deletion lib/data/deno_kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference lib="deno.unstable" />

import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts";

const kvBatchSize = 100;
Expand Down
2 changes: 1 addition & 1 deletion lib/data/dynamodb_kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts";
import {
createClient,
Expand Down
2 changes: 1 addition & 1 deletion lib/data/indexeddb_kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts";
import { IDBPDatabase, openDB } from "https://esm.sh/idb@7.1.1/with-async-ittr";

Expand Down
2 changes: 1 addition & 1 deletion lib/data/kv_primitives.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KvPrimitives } from "./kv_primitives.ts";
import { assertEquals } from "$lib/test_deps.ts";
import { KV } from "$type/types.ts";
import { KV } from "../../plug-api/types.ts";

export async function allTests(db: KvPrimitives) {
await db.batchSet([
Expand Down
2 changes: 1 addition & 1 deletion lib/data/kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";

export type KvQueryOptions = {
prefix?: KvKey;
Expand Down
2 changes: 1 addition & 1 deletion lib/data/memory_kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts";

const memoryKeySeparator = "\0";
Expand Down
2 changes: 1 addition & 1 deletion lib/data/mq.datastore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DenoKvPrimitives } from "./deno_kv_primitives.ts";
import { DataStore } from "./datastore.ts";
import { PrefixedKvPrimitives } from "./prefixed_kv_primitives.ts";
import { FakeTime } from "$std/testing/time.ts";
import type { MQMessage } from "$type/types.ts";
import type { MQMessage } from "../../plug-api/types.ts";

Deno.test("DataStore MQ", async () => {
const time = new FakeTime();
Expand Down
7 changes: 6 additions & 1 deletion lib/data/mq.datastore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { KV, MQMessage, MQStats, MQSubscribeOptions } from "$type/types.ts";
import {
KV,
MQMessage,
MQStats,
MQSubscribeOptions,
} from "../../plug-api/types.ts";
import { MessageQueue } from "./mq.ts";
import { DataStore } from "./datastore.ts";

Expand Down
6 changes: 5 additions & 1 deletion lib/data/mq.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { MQMessage, MQStats, MQSubscribeOptions } from "$type/types.ts";
import {
MQMessage,
MQStats,
MQSubscribeOptions,
} from "../../plug-api/types.ts";

export interface MessageQueue {
batchSend(queue: string, bodies: any[]): Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion lib/data/prefixed_kv_primitives.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KV, KvKey } from "$type/types.ts";
import { KV, KvKey } from "../../plug-api/types.ts";
import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts";

/**
Expand Down
21 changes: 0 additions & 21 deletions lib/json.test.ts

This file was deleted.

Loading

0 comments on commit e919aa8

Please sign in to comment.