From c111f72e09b5010e365ab61cdcbe364be31c198b Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Tue, 30 Jul 2024 17:33:33 +0200 Subject: [PATCH] Lint error removal --- cmd/plug_run.ts | 2 +- cmd/server.ts | 4 +-- cmd/sync.ts | 2 +- cmd/test/runtime.test.ts | 2 +- common/common_system.ts | 24 ++++++++-------- common/expression_parser.ts | 2 +- common/hooks/command.ts | 12 ++++---- common/hooks/event.ts | 8 +++--- common/hooks/plug_namespace.ts | 10 +++---- common/languages.ts | 2 +- common/markdown_parser/extended_task.ts | 2 +- common/markdown_parser/parser.ts | 12 ++++---- common/markdown_parser/table_parser.ts | 2 +- common/query_functions.ts | 4 +-- common/settings.ts | 8 +++--- common/space.ts | 6 ++-- common/space_index.ts | 4 +-- common/space_script.ts | 8 +++--- .../spaces/asset_bundle_space_primitives.ts | 6 ++-- .../chunked_datastore_space_primitives.ts | 4 +-- common/spaces/datastore_space_primitives.ts | 4 +-- common/spaces/disk_space_primitives.ts | 4 +-- common/spaces/evented_space_primitives.ts | 4 +-- common/spaces/fallback_space_primitives.ts | 2 +- common/spaces/filtered_space_primitives.ts | 4 +-- common/spaces/http_space_primitives.ts | 4 +-- common/spaces/kv_meta_space_primitives.ts | 6 ++-- common/spaces/plug_space_primitives.ts | 8 +++--- common/spaces/ro_space_primitives.ts | 4 +-- common/spaces/s3_space_primitives.ts | 4 +-- common/spaces/space_primitives.test.ts | 2 +- common/spaces/sync.test.ts | 2 +- common/spaces/sync.ts | 4 +-- common/syscalls/language.ts | 2 +- common/syscalls/markdown.ts | 2 +- common/syscalls/system.ts | 8 +++--- common/syscalls/template.ts | 8 +++--- common/syscalls/yaml.ts | 2 +- common/template/render.ts | 4 +-- common/template/template_parser.ts | 2 +- lib/data/datastore.test.ts | 4 +-- lib/data/datastore.ts | 4 +-- lib/data/deno_kv_primitives.ts | 4 +-- lib/data/indexeddb_kv_primitives.ts | 4 +-- lib/data/kv_primitives.test.ts | 4 +-- lib/data/kv_primitives.ts | 2 +- lib/data/memory_kv_primitives.ts | 4 +-- lib/data/mq.datastore.ts | 6 ++-- lib/data/mq.ts | 2 +- lib/data/prefixed_kv_primitives.ts | 4 +-- lib/manifest.ts | 6 ++-- lib/plugos/eventhook.ts | 4 +-- lib/plugos/hooks/cron.ts | 6 ++-- lib/plugos/hooks/mq.ts | 10 +++---- lib/plugos/manifest_cache.ts | 6 ++-- lib/plugos/plug.ts | 8 +++--- lib/plugos/sandboxes/no_sandbox.ts | 10 +++---- lib/plugos/sandboxes/sandbox.ts | 4 +-- lib/plugos/sandboxes/worker_sandbox.ts | 10 +++---- lib/plugos/syscalls/asset.ts | 2 +- lib/plugos/syscalls/datastore.ts | 2 +- lib/plugos/syscalls/event.ts | 4 +-- lib/plugos/syscalls/fetch.ts | 5 +++- lib/plugos/syscalls/fs.deno.test.ts | 2 +- lib/plugos/syscalls/fs.deno.ts | 2 +- lib/plugos/syscalls/mq.ts | 4 +-- lib/plugos/system.ts | 4 +-- lib/plugos/types.ts | 4 +-- plug-api/lib/attribute.ts | 2 +- plug-api/lib/feed.ts | 2 +- plug-api/lib/frontmatter.ts | 2 +- plug-api/lib/markdown.ts | 2 +- plug-api/lib/parser-query.test.ts | 2 +- plug-api/lib/query.ts | 2 +- plug-api/lib/query_expression.ts | 2 +- plug-api/lib/resolve.test.ts | 2 +- plug-api/lib/resolve.ts | 2 +- plug-api/lib/tags.ts | 4 +-- plug-api/syscalls/datastore.ts | 2 +- plug-api/syscalls/editor.ts | 2 +- plug-api/syscalls/space.ts | 2 +- plugs/editor/command.ts | 2 +- plugs/editor/complete.ts | 2 +- plugs/editor/navigate.ts | 2 +- plugs/editor/upload.ts | 2 +- plugs/index/api.ts | 4 +-- plugs/index/attachment.ts | 2 +- plugs/index/attributes.ts | 2 +- plugs/index/builtins.ts | 2 +- plugs/index/command.ts | 2 +- plugs/index/data.ts | 4 +-- plugs/index/header.ts | 2 +- plugs/index/item.ts | 4 +-- plugs/index/lint.ts | 6 ++-- plugs/index/page_links.ts | 2 +- plugs/index/paragraph.ts | 2 +- plugs/index/refactor.ts | 4 +-- plugs/index/script.ts | 4 +-- plugs/index/style.ts | 4 +-- plugs/index/table.ts | 4 +-- plugs/index/tag_page.ts | 2 +- plugs/index/toc.ts | 2 +- plugs/index/widget.ts | 4 +-- plugs/markdown/api.ts | 4 +-- plugs/markdown/markdown_render.ts | 6 ++-- plugs/query/api.ts | 4 +-- plugs/query/complete.ts | 4 +-- plugs/query/lint.ts | 4 +-- plugs/query/widget.ts | 4 +-- plugs/search/search.ts | 4 +-- plugs/share/publish.ts | 2 +- plugs/share/share.ts | 2 +- plugs/tasks/complete.ts | 4 +-- plugs/tasks/task.ts | 4 +-- plugs/template/api.ts | 2 +- plugs/template/page.ts | 4 +-- plugs/template/snippet.ts | 4 +-- plugs/template/types.ts | 4 +-- plugs/template/util.ts | 2 +- plugs/template/var.ts | 4 +-- plugs/template/widget.ts | 2 +- scripts/generate_fs_list.ts | 2 +- server/db_backend.ts | 2 +- server/instance.ts | 14 +++++----- server/server_system.ts | 16 +++++------ server/shell_backend.ts | 2 +- server/storage_backend.ts | 4 +-- server/syscalls/shell.ts | 6 ++-- server/syscalls/space.ts | 4 +-- type/settings.ts | 4 +-- type/web.ts | 8 +++--- web/client.ts | 28 +++++++++---------- web/client_system.ts | 12 ++++---- web/cm_plugins/admonition.ts | 4 +-- web/cm_plugins/block.ts | 2 +- web/cm_plugins/block_quote.ts | 2 +- web/cm_plugins/code_copy.ts | 10 +++---- web/cm_plugins/command_link.ts | 4 +-- web/cm_plugins/editor_paste.ts | 6 ++-- web/cm_plugins/escapes.ts | 2 +- web/cm_plugins/fenced_code.ts | 2 +- web/cm_plugins/frontmatter.ts | 2 +- web/cm_plugins/hide_mark.ts | 2 +- web/cm_plugins/iframe_widget.ts | 2 +- web/cm_plugins/inline_content.ts | 2 +- web/cm_plugins/line_wrapper.ts | 2 +- web/cm_plugins/link.ts | 2 +- web/cm_plugins/lint.ts | 4 +-- web/cm_plugins/smart_quotes.ts | 4 +-- web/cm_plugins/table.ts | 4 +-- web/cm_plugins/task.ts | 2 +- web/cm_plugins/top_bottom_panels.ts | 2 +- web/cm_plugins/util.ts | 4 +-- web/cm_plugins/wiki_link.ts | 4 +-- web/commands.ts | 2 +- web/components/basic_modals.tsx | 7 +++-- web/components/command_palette.tsx | 8 +++--- web/components/filter.tsx | 11 +++++--- web/components/mini_editor.tsx | 6 ++-- web/components/page_navigator.tsx | 6 ++-- web/components/panel.tsx | 4 +-- web/components/top_bar.tsx | 11 +++++--- web/components/widget_sandbox_iframe.ts | 4 +-- web/editor_state.ts | 12 ++++---- web/editor_ui.tsx | 6 +++- web/fuse_search.test.ts | 2 +- web/fuse_search.ts | 2 +- web/hooks/code_widget.ts | 8 +++--- web/hooks/panel_widget.ts | 8 +++--- web/hooks/slash_command.ts | 12 ++++---- web/navigator.ts | 4 +-- web/reducer.ts | 4 +-- web/sync_service.ts | 8 +++--- web/syscalls/clientStore.ts | 6 ++-- web/syscalls/client_code_widget.ts | 2 +- web/syscalls/code_widget.ts | 6 ++-- web/syscalls/debug.ts | 4 +-- web/syscalls/editor.ts | 10 +++---- web/syscalls/fetch.ts | 4 +-- web/syscalls/mq.proxy.ts | 4 +-- web/syscalls/shell.ts | 2 +- web/syscalls/space.ts | 6 ++-- web/syscalls/sync.ts | 2 +- web/syscalls/util.ts | 6 ++-- 184 files changed, 427 insertions(+), 411 deletions(-) diff --git a/cmd/plug_run.ts b/cmd/plug_run.ts index e1305af0..d7df8cad 100644 --- a/cmd/plug_run.ts +++ b/cmd/plug_run.ts @@ -1,7 +1,7 @@ import { resolve } from "@std/path"; import assets from "../dist/plug_asset_bundle.json" with { type: "json" }; import { determineDatabaseBackend } from "../server/db_backend.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { DiskSpacePrimitives } from "$common/spaces/disk_space_primitives.ts"; import { ServerSystem } from "../server/server_system.ts"; diff --git a/cmd/server.ts b/cmd/server.ts index 420bdc5d..98d38971 100644 --- a/cmd/server.ts +++ b/cmd/server.ts @@ -5,10 +5,10 @@ import clientAssetBundle from "../dist/client_asset_bundle.json" with { import plugAssetBundle from "../dist/plug_asset_bundle.json" with { type: "json", }; -import { AssetBundle, AssetJson } from "../lib/asset_bundle/bundle.ts"; +import { AssetBundle, type AssetJson } from "../lib/asset_bundle/bundle.ts"; import { determineDatabaseBackend } from "../server/db_backend.ts"; -import { SpaceServerConfig } from "../server/instance.ts"; +import type { SpaceServerConfig } from "../server/instance.ts"; import { runPlug } from "../cmd/plug_run.ts"; import { PrefixedKvPrimitives } from "$lib/data/prefixed_kv_primitives.ts"; import { sleep } from "$lib/async.ts"; diff --git a/cmd/sync.ts b/cmd/sync.ts index 2234bda3..d2e06458 100644 --- a/cmd/sync.ts +++ b/cmd/sync.ts @@ -1,4 +1,4 @@ -import { SpaceSync, SyncStatusItem } from "$common/spaces/sync.ts"; +import { SpaceSync, type SyncStatusItem } from "$common/spaces/sync.ts"; import { MemoryKvPrimitives } from "$lib/data/memory_kv_primitives.ts"; import { determineStorageBackend } from "../server/storage_backend.ts"; diff --git a/cmd/test/runtime.test.ts b/cmd/test/runtime.test.ts index dfd269f2..9f9e1d7c 100644 --- a/cmd/test/runtime.test.ts +++ b/cmd/test/runtime.test.ts @@ -7,7 +7,7 @@ import { createSandbox as createNoSandbox, runWithSystemLock, } from "../../lib/plugos/sandboxes/no_sandbox.ts"; -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import { sleep } from "../../lib/async.ts"; Deno.test("Run a deno sandbox", { diff --git a/common/common_system.ts b/common/common_system.ts index e4d3714e..c2456bd7 100644 --- a/common/common_system.ts +++ b/common/common_system.ts @@ -1,17 +1,17 @@ -import { AppCommand } from "$lib/command.ts"; -import { CommandHook } from "./hooks/command.ts"; -import { PlugNamespaceHook } from "$common/hooks/plug_namespace.ts"; -import { SilverBulletHooks } from "../lib/manifest.ts"; +import type { AppCommand } from "$lib/command.ts"; +import type { CommandHook } from "./hooks/command.ts"; +import type { PlugNamespaceHook } from "$common/hooks/plug_namespace.ts"; +import type { SilverBulletHooks } from "../lib/manifest.ts"; import { buildQueryFunctions } from "./query_functions.ts"; import { ScriptEnvironment } from "./space_script.ts"; -import { EventHook } from "./hooks/event.ts"; -import { DataStore } from "$lib/data/datastore.ts"; -import { System } from "$lib/plugos/system.ts"; -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 "../plug-api/lib/tree.ts"; +import type { EventHook } from "./hooks/event.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; +import type { System } from "$lib/plugos/system.ts"; +import type { CodeWidgetHook } from "../web/hooks/code_widget.ts"; +import type { PanelWidgetHook } from "../web/hooks/panel_widget.ts"; +import type { SlashCommandHook } from "../web/hooks/slash_command.ts"; +import type { DataStoreMQ } from "$lib/data/mq.datastore.ts"; +import type { ParseTree } from "../plug-api/lib/tree.ts"; const mqTimeout = 10000; // 10s const mqTimeoutRetry = 3; diff --git a/common/expression_parser.ts b/common/expression_parser.ts index c978bdf2..74c54ad0 100644 --- a/common/expression_parser.ts +++ b/common/expression_parser.ts @@ -1,4 +1,4 @@ -import { QueryExpression } from "$sb/types.ts"; +import type { QueryExpression } from "$sb/types.ts"; import { parseTreeToAST } from "$sb/lib/tree.ts"; import { expressionLanguage } from "$common/template/template_parser.ts"; import { expressionToKvQueryExpression } from "$sb/lib/parse-query.ts"; diff --git a/common/hooks/command.ts b/common/hooks/command.ts index 55b7dec4..ef1230b4 100644 --- a/common/hooks/command.ts +++ b/common/hooks/command.ts @@ -1,15 +1,15 @@ -import { Hook, Manifest } from "../../lib/plugos/types.ts"; -import { System } from "../../lib/plugos/system.ts"; +import type { Hook, Manifest } from "../../lib/plugos/types.ts"; +import type { System } from "../../lib/plugos/system.ts"; import { EventEmitter } from "../../lib/plugos/event.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { - FrontmatterConfig, + type FrontmatterConfig, SnippetConfig, } from "../../plugs/template/types.ts"; import { NewPageConfig } from "../../plugs/template/types.ts"; import { throttle } from "../../lib/async.ts"; -import { AppCommand, CommandHookEvents } from "../../lib/command.ts"; -import { CommandHookT } from "$lib/manifest.ts"; +import type { AppCommand, CommandHookEvents } from "../../lib/command.ts"; +import type { CommandHookT } from "$lib/manifest.ts"; export class CommandHook extends EventEmitter implements Hook { diff --git a/common/hooks/event.ts b/common/hooks/event.ts index c2982779..4a4bb3d3 100644 --- a/common/hooks/event.ts +++ b/common/hooks/event.ts @@ -1,8 +1,8 @@ import type { Manifest } from "$lib/plugos/types.ts"; -import { System } from "$lib/plugos/system.ts"; -import { ScriptEnvironment } from "$common/space_script.ts"; -import { EventHookI } from "$lib/plugos/eventhook.ts"; -import { EventHookT } from "$lib/manifest.ts"; +import type { System } from "$lib/plugos/system.ts"; +import type { ScriptEnvironment } from "$common/space_script.ts"; +import type { EventHookI } from "$lib/plugos/eventhook.ts"; +import type { EventHookT } from "$lib/manifest.ts"; // System events: // - plug:load (plugName: string) diff --git a/common/hooks/plug_namespace.ts b/common/hooks/plug_namespace.ts index f25a22b6..84c913a2 100644 --- a/common/hooks/plug_namespace.ts +++ b/common/hooks/plug_namespace.ts @@ -1,8 +1,8 @@ -import { NamespaceOperation } from "$lib/plugos/namespace.ts"; -import { PlugNamespaceHookT } from "$lib/manifest.ts"; -import { Plug } from "../../lib/plugos/plug.ts"; -import { System } from "../../lib/plugos/system.ts"; -import { Hook, Manifest } from "../../lib/plugos/types.ts"; +import type { NamespaceOperation } from "$lib/plugos/namespace.ts"; +import type { PlugNamespaceHookT } from "$lib/manifest.ts"; +import type { Plug } from "../../lib/plugos/plug.ts"; +import type { System } from "../../lib/plugos/system.ts"; +import type { Hook, Manifest } from "../../lib/plugos/types.ts"; type SpaceFunction = { operation: NamespaceOperation; diff --git a/common/languages.ts b/common/languages.ts index 0db6e331..1494700f 100644 --- a/common/languages.ts +++ b/common/languages.ts @@ -34,7 +34,7 @@ import { objectiveCpp as objectiveCppLanguage, scala as scalaLanguage, } from "@codemirror/legacy-modes/mode/clike?external=@codemirror/language&target=es2022"; -import { Language, StreamLanguage } from "@codemirror/language"; +import { type Language, StreamLanguage } from "@codemirror/language"; import { javascriptLanguage, typescriptLanguage, diff --git a/common/markdown_parser/extended_task.ts b/common/markdown_parser/extended_task.ts index 1ed7680d..d66b091b 100644 --- a/common/markdown_parser/extended_task.ts +++ b/common/markdown_parser/extended_task.ts @@ -1,4 +1,4 @@ -import { +import type { BlockContext, LeafBlock, LeafBlockParser, diff --git a/common/markdown_parser/parser.ts b/common/markdown_parser/parser.ts index 4c59e146..19346ead 100644 --- a/common/markdown_parser/parser.ts +++ b/common/markdown_parser/parser.ts @@ -1,12 +1,12 @@ import { commandLinkRegex } from "../command.ts"; import { yaml as yamlLanguage } from "@codemirror/legacy-modes/mode/yaml?external=@codemirror/language&target=es2022"; -import { styleTags, Tag, tags as t } from "@lezer/highlight"; +import { styleTags, type Tag, tags as t } from "@lezer/highlight"; import { - BlockContext, - LeafBlock, - LeafBlockParser, - Line, - MarkdownConfig, + type BlockContext, + type LeafBlock, + type LeafBlockParser, + type Line, + type MarkdownConfig, Strikethrough, Subscript, Superscript, diff --git a/common/markdown_parser/table_parser.ts b/common/markdown_parser/table_parser.ts index 4d055bcd..50591ce8 100644 --- a/common/markdown_parser/table_parser.ts +++ b/common/markdown_parser/table_parser.ts @@ -1,4 +1,4 @@ -import { +import type { BlockContext, Element, LeafBlock, diff --git a/common/query_functions.ts b/common/query_functions.ts index a2728a9c..3082f1e2 100644 --- a/common/query_functions.ts +++ b/common/query_functions.ts @@ -1,6 +1,6 @@ -import { FunctionMap, Query } from "$sb/types.ts"; +import type { FunctionMap, Query } from "$sb/types.ts"; import { builtinFunctions } from "$lib/builtin_query_functions.ts"; -import { System } from "$lib/plugos/system.ts"; +import type { System } from "$lib/plugos/system.ts"; import { LimitedMap } from "$lib/limited_map.ts"; import { parsePageRef, positionOfLine } from "$sb/lib/page_ref.ts"; import { parse } from "$common/markdown_parser/parse_tree.ts"; diff --git a/common/settings.ts b/common/settings.ts index ba3aec9f..5401b8f9 100644 --- a/common/settings.ts +++ b/common/settings.ts @@ -1,11 +1,11 @@ import YAML from "js-yaml"; import { INDEX_TEMPLATE, SETTINGS_TEMPLATE } from "./PAGE_TEMPLATES.ts"; -import { SpacePrimitives } from "./spaces/space_primitives.ts"; +import type { SpacePrimitives } from "./spaces/space_primitives.ts"; import { cleanupJSON } from "../plug-api/lib/json.ts"; -import { BuiltinSettings } from "$type/settings.ts"; -import { DataStore, ObjectEnricher } from "$lib/data/datastore.ts"; +import type { BuiltinSettings } from "$type/settings.ts"; +import type { DataStore, ObjectEnricher } from "$lib/data/datastore.ts"; import { parseExpression } from "$common/expression_parser.ts"; -import { QueryExpression } from "$sb/types.ts"; +import type { QueryExpression } from "$sb/types.ts"; const yamlSettingsRegex = /^(```+|~~~+)ya?ml\r?\n([\S\s]+?)\1/m; diff --git a/common/space.ts b/common/space.ts index cde58a7d..b2dee266 100644 --- a/common/space.ts +++ b/common/space.ts @@ -1,8 +1,8 @@ -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; import { plugPrefix } from "$common/spaces/constants.ts"; -import { AttachmentMeta, FileMeta, PageMeta } from "../plug-api/types.ts"; -import { EventHook } from "./hooks/event.ts"; +import type { AttachmentMeta, FileMeta, PageMeta } from "../plug-api/types.ts"; +import type { EventHook } from "./hooks/event.ts"; import { safeRun } from "../lib/async.ts"; const pageWatchInterval = 5000; diff --git a/common/space_index.ts b/common/space_index.ts index 2088038a..d4ca6802 100644 --- a/common/space_index.ts +++ b/common/space_index.ts @@ -1,5 +1,5 @@ -import { DataStore } from "$lib/data/datastore.ts"; -import { System } from "$lib/plugos/system.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; +import type { System } from "$lib/plugos/system.ts"; const indexVersionKey = ["$indexVersion"]; diff --git a/common/space_script.ts b/common/space_script.ts index 5126e9bf..8dc4b91f 100644 --- a/common/space_script.ts +++ b/common/space_script.ts @@ -1,7 +1,7 @@ -import { System } from "../lib/plugos/system.ts"; -import { ParseTree } from "../plug-api/lib/tree.ts"; -import { ScriptObject } from "../plugs/index/script.ts"; -import { AppCommand, CommandDef } from "$lib/command.ts"; +import type { System } from "../lib/plugos/system.ts"; +import type { ParseTree } from "../plug-api/lib/tree.ts"; +import type { ScriptObject } from "../plugs/index/script.ts"; +import type { AppCommand, CommandDef } from "$lib/command.ts"; import { Intl, Temporal, toTemporalInstant } from "@js-temporal/polyfill"; // @ts-ignore: Temporal polyfill diff --git a/common/spaces/asset_bundle_space_primitives.ts b/common/spaces/asset_bundle_space_primitives.ts index cae9ac6f..1445e299 100644 --- a/common/spaces/asset_bundle_space_primitives.ts +++ b/common/spaces/asset_bundle_space_primitives.ts @@ -1,6 +1,6 @@ -import { SpacePrimitives } from "./space_primitives.ts"; -import { AssetBundle } from "../../lib/asset_bundle/bundle.ts"; -import { FileMeta } from "../../plug-api/types.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; +import type { AssetBundle } from "../../lib/asset_bundle/bundle.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; export class AssetBundlePlugSpacePrimitives implements SpacePrimitives { constructor( diff --git a/common/spaces/chunked_datastore_space_primitives.ts b/common/spaces/chunked_datastore_space_primitives.ts index 33c2d37d..f3a1909b 100644 --- a/common/spaces/chunked_datastore_space_primitives.ts +++ b/common/spaces/chunked_datastore_space_primitives.ts @@ -1,6 +1,6 @@ import type { SpacePrimitives } from "./space_primitives.ts"; -import { KvKey } from "../../plug-api/types.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvKey } from "../../plug-api/types.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { KvMetaSpacePrimitives } from "./kv_meta_space_primitives.ts"; import { PrefixedKvPrimitives } from "$lib/data/prefixed_kv_primitives.ts"; diff --git a/common/spaces/datastore_space_primitives.ts b/common/spaces/datastore_space_primitives.ts index 67ba4611..96651e39 100644 --- a/common/spaces/datastore_space_primitives.ts +++ b/common/spaces/datastore_space_primitives.ts @@ -1,7 +1,7 @@ import type { SpacePrimitives } from "./space_primitives.ts"; import { mime } from "mimetypes"; -import { FileMeta } from "../../plug-api/types.ts"; -import { DataStore } from "$lib/data/datastore.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; export type FileContent = { name: string; diff --git a/common/spaces/disk_space_primitives.ts b/common/spaces/disk_space_primitives.ts index 707ec080..313b98e2 100644 --- a/common/spaces/disk_space_primitives.ts +++ b/common/spaces/disk_space_primitives.ts @@ -1,8 +1,8 @@ import * as path from "@std/path"; import { readAll } from "@std/io/read-all"; -import { SpacePrimitives } from "./space_primitives.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; import { mime } from "mimetypes"; -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; function lookupContentType(path: string): string { return mime.getType(path) || "application/octet-stream"; diff --git a/common/spaces/evented_space_primitives.ts b/common/spaces/evented_space_primitives.ts index 4fb000b2..704de24b 100644 --- a/common/spaces/evented_space_primitives.ts +++ b/common/spaces/evented_space_primitives.ts @@ -1,5 +1,5 @@ -import { FileMeta } from "$sb/types.ts"; -import { EventHook } from "$common/hooks/event.ts"; +import type { FileMeta } from "$sb/types.ts"; +import type { EventHook } from "$common/hooks/event.ts"; import { plugPrefix } from "$common/spaces/constants.ts"; import type { SpacePrimitives } from "./space_primitives.ts"; diff --git a/common/spaces/fallback_space_primitives.ts b/common/spaces/fallback_space_primitives.ts index 96027d29..aefae7df 100644 --- a/common/spaces/fallback_space_primitives.ts +++ b/common/spaces/fallback_space_primitives.ts @@ -1,4 +1,4 @@ -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import type { SpacePrimitives } from "./space_primitives.ts"; /** diff --git a/common/spaces/filtered_space_primitives.ts b/common/spaces/filtered_space_primitives.ts index 80757eac..ab9ef028 100644 --- a/common/spaces/filtered_space_primitives.ts +++ b/common/spaces/filtered_space_primitives.ts @@ -1,5 +1,5 @@ -import { FileMeta } from "../../plug-api/types.ts"; -import { SpacePrimitives } from "./space_primitives.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; export class FilteredSpacePrimitives implements SpacePrimitives { constructor( diff --git a/common/spaces/http_space_primitives.ts b/common/spaces/http_space_primitives.ts index ef437dcd..2d6ff8b8 100644 --- a/common/spaces/http_space_primitives.ts +++ b/common/spaces/http_space_primitives.ts @@ -1,5 +1,5 @@ -import { SpacePrimitives } from "./space_primitives.ts"; -import { FileMeta } from "../../plug-api/types.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import { flushCachesAndUnregisterServiceWorker } from "../sw_util.ts"; const fetchTimeout = 5000; diff --git a/common/spaces/kv_meta_space_primitives.ts b/common/spaces/kv_meta_space_primitives.ts index f951de48..7f8cbaca 100644 --- a/common/spaces/kv_meta_space_primitives.ts +++ b/common/spaces/kv_meta_space_primitives.ts @@ -1,7 +1,7 @@ -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import { mime } from "mimetypes"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; -import { SpacePrimitives } from "./space_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; export type KvMetaSpacePrimitivesCallbacks = { readFile: ( diff --git a/common/spaces/plug_space_primitives.ts b/common/spaces/plug_space_primitives.ts index ccc8f4e2..8c40913d 100644 --- a/common/spaces/plug_space_primitives.ts +++ b/common/spaces/plug_space_primitives.ts @@ -1,7 +1,7 @@ -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; -import { NamespaceOperation } from "$lib/plugos/namespace.ts"; -import { FileMeta } from "../../plug-api/types.ts"; -import { PlugNamespaceHook } from "../hooks/plug_namespace.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { NamespaceOperation } from "$lib/plugos/namespace.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; +import type { PlugNamespaceHook } from "../hooks/plug_namespace.ts"; export class PlugSpacePrimitives implements SpacePrimitives { constructor( diff --git a/common/spaces/ro_space_primitives.ts b/common/spaces/ro_space_primitives.ts index 152c3749..79ee4c51 100644 --- a/common/spaces/ro_space_primitives.ts +++ b/common/spaces/ro_space_primitives.ts @@ -1,5 +1,5 @@ -import { FileMeta } from "../../plug-api/types.ts"; -import { SpacePrimitives } from "./space_primitives.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; export class ReadOnlySpacePrimitives implements SpacePrimitives { wrapped: SpacePrimitives; diff --git a/common/spaces/s3_space_primitives.ts b/common/spaces/s3_space_primitives.ts index 75f912e0..d52e2f2c 100644 --- a/common/spaces/s3_space_primitives.ts +++ b/common/spaces/s3_space_primitives.ts @@ -2,9 +2,9 @@ import { S3Client } from "s3_lite_client/mod.ts"; import type { ClientOptions } from "s3_lite_client/client.ts"; import { KvMetaSpacePrimitives } from "./kv_meta_space_primitives.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { mime } from "mimetypes"; -import { KV, KvKey } from "../../plug-api/types.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; import { PrefixedKvPrimitives } from "$lib/data/prefixed_kv_primitives.ts"; export type S3SpacePrimitivesOptions = ClientOptions; diff --git a/common/spaces/space_primitives.test.ts b/common/spaces/space_primitives.test.ts index 5ad3daf9..e4f4f7d3 100644 --- a/common/spaces/space_primitives.test.ts +++ b/common/spaces/space_primitives.test.ts @@ -1,5 +1,5 @@ import { assert, assertEquals } from "@std/assert"; -import { SpacePrimitives } from "./space_primitives.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; export async function testSpacePrimitives(spacePrimitives: SpacePrimitives) { const files = await spacePrimitives.fetchFileList(); diff --git a/common/spaces/sync.test.ts b/common/spaces/sync.test.ts index b04d2e89..2ebe94f3 100644 --- a/common/spaces/sync.test.ts +++ b/common/spaces/sync.test.ts @@ -1,4 +1,4 @@ -import { SpaceSync, SyncStatusItem } from "./sync.ts"; +import { SpaceSync, type SyncStatusItem } from "./sync.ts"; import { DiskSpacePrimitives } from "./disk_space_primitives.ts"; import { assertEquals } from "@std/assert"; diff --git a/common/spaces/sync.ts b/common/spaces/sync.ts index ef888ff1..fc43a253 100644 --- a/common/spaces/sync.ts +++ b/common/spaces/sync.ts @@ -1,6 +1,6 @@ -import { SpacePrimitives } from "./space_primitives.ts"; +import type { SpacePrimitives } from "./space_primitives.ts"; import { EventEmitter } from "../../lib/plugos/event.ts"; -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import { plugPrefix } from "./constants.ts"; type SyncHash = number; diff --git a/common/syscalls/language.ts b/common/syscalls/language.ts index 2a3a4fa9..19fb8059 100644 --- a/common/syscalls/language.ts +++ b/common/syscalls/language.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import { parse } from "../markdown_parser/parse_tree.ts"; import type { ParseTree } from "../../plug-api/lib/tree.ts"; import { builtinLanguages, languageFor } from "../languages.ts"; diff --git a/common/syscalls/markdown.ts b/common/syscalls/markdown.ts index 4d30d73e..17475fe1 100644 --- a/common/syscalls/markdown.ts +++ b/common/syscalls/markdown.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import { parse } from "../markdown_parser/parse_tree.ts"; import type { ParseTree } from "../../plug-api/lib/tree.ts"; import { extendedMarkdownLanguage } from "../markdown_parser/parser.ts"; diff --git a/common/syscalls/system.ts b/common/syscalls/system.ts index 056739e1..acd1ba83 100644 --- a/common/syscalls/system.ts +++ b/common/syscalls/system.ts @@ -1,11 +1,11 @@ -import { SyscallMeta } from "../../plug-api/types.ts"; -import { SysCallMapping, System } from "../../lib/plugos/system.ts"; +import type { SyscallMeta } from "../../plug-api/types.ts"; +import type { SysCallMapping, System } from "../../lib/plugos/system.ts"; import type { Client } from "../../web/client.ts"; -import { CommandDef } from "$lib/command.ts"; +import type { CommandDef } from "$lib/command.ts"; import { proxySyscall } from "../../web/syscalls/util.ts"; import type { CommonSystem } from "../common_system.ts"; import { version } from "../../version.ts"; -import { ParseTree } from "../../plug-api/lib/tree.ts"; +import type { ParseTree } from "../../plug-api/lib/tree.ts"; export function systemSyscalls( system: System, diff --git a/common/syscalls/template.ts b/common/syscalls/template.ts index 1e35b752..8b49d23c 100644 --- a/common/syscalls/template.ts +++ b/common/syscalls/template.ts @@ -1,9 +1,9 @@ -import { FunctionMap } from "../../plug-api/types.ts"; -import { AST } from "../../plug-api/lib/tree.ts"; -import { SysCallMapping } from "$lib/plugos/system.ts"; +import type { FunctionMap } from "../../plug-api/types.ts"; +import type { AST } from "../../plug-api/lib/tree.ts"; +import type { SysCallMapping } from "$lib/plugos/system.ts"; import { renderTemplate } from "$common/template/render.ts"; import { parseTemplate } from "$common/template/template_parser.ts"; -import { DataStore } from "$lib/data/datastore.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; export function templateSyscalls(ds: DataStore): SysCallMapping { return { diff --git a/common/syscalls/yaml.ts b/common/syscalls/yaml.ts index b56e26a8..2cfccb85 100644 --- a/common/syscalls/yaml.ts +++ b/common/syscalls/yaml.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import YAML from "js-yaml"; type YamlStringifyOptions = { diff --git a/common/template/render.ts b/common/template/render.ts index fba52b70..1c7d0789 100644 --- a/common/template/render.ts +++ b/common/template/render.ts @@ -1,7 +1,7 @@ -import { AST } from "../../plug-api/lib/tree.ts"; +import type { 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 "../../plug-api/types.ts"; +import type { FunctionMap } from "../../plug-api/types.ts"; import { jsonToMDTable } from "../../plugs/template/util.ts"; export async function renderTemplate( diff --git a/common/template/template_parser.ts b/common/template/template_parser.ts index 458a3acc..41f5dbf3 100644 --- a/common/template/template_parser.ts +++ b/common/template/template_parser.ts @@ -4,7 +4,7 @@ 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 "../../plug-api/lib/tree.ts"; +import { type AST, parseTreeToAST } from "../../plug-api/lib/tree.ts"; import { deepEqual } from "../../plug-api/lib/json.ts"; export const templateLanguage = LRLanguage.define({ diff --git a/lib/data/datastore.test.ts b/lib/data/datastore.test.ts index 4a1f962b..c78cd47a 100644 --- a/lib/data/datastore.test.ts +++ b/lib/data/datastore.test.ts @@ -2,10 +2,10 @@ import "fake-indexeddb/auto"; import { IndexedDBKvPrimitives } from "../data/indexeddb_kv_primitives.ts"; import { cleanupEmptyObjects, DataStore } from "../data/datastore.ts"; import { DenoKvPrimitives } from "../data/deno_kv_primitives.ts"; -import { KvPrimitives } from "../data/kv_primitives.ts"; +import type { KvPrimitives } from "../data/kv_primitives.ts"; import { assertEquals, assertThrows } from "@std/assert"; import { PrefixedKvPrimitives } from "../data/prefixed_kv_primitives.ts"; -import { Query } from "../../plug-api/types.ts"; +import type { Query } from "../../plug-api/types.ts"; async function test(db: KvPrimitives) { const datastore = new DataStore(new PrefixedKvPrimitives(db, ["ds"]), { diff --git a/lib/data/datastore.ts b/lib/data/datastore.ts index 898859b8..4a49ed61 100644 --- a/lib/data/datastore.ts +++ b/lib/data/datastore.ts @@ -1,5 +1,5 @@ import { applyQueryNoFilterKV } from "../../plug-api/lib/query.ts"; -import { +import type { FunctionMap, KV, KvKey, @@ -7,7 +7,7 @@ import { QueryExpression, } from "../../plug-api/types.ts"; import { builtinFunctions } from "../builtin_query_functions.ts"; -import { KvPrimitives } from "./kv_primitives.ts"; +import type { KvPrimitives } from "./kv_primitives.ts"; import { evalQueryExpression } from "../../plug-api/lib/query_expression.ts"; /** * This is the data store class you'll actually want to use, wrapping the primitives diff --git a/lib/data/deno_kv_primitives.ts b/lib/data/deno_kv_primitives.ts index f1c3d557..222246bb 100644 --- a/lib/data/deno_kv_primitives.ts +++ b/lib/data/deno_kv_primitives.ts @@ -1,7 +1,7 @@ /// -import { KV, KvKey } from "../../plug-api/types.ts"; -import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; +import type { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; const kvBatchSize = 100; diff --git a/lib/data/indexeddb_kv_primitives.ts b/lib/data/indexeddb_kv_primitives.ts index 7ffa73e7..a8c471a0 100644 --- a/lib/data/indexeddb_kv_primitives.ts +++ b/lib/data/indexeddb_kv_primitives.ts @@ -1,5 +1,5 @@ -import { KV, KvKey } from "../../plug-api/types.ts"; -import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; +import type { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; import { type IDBPDatabase, openDB } from "../deps_client.ts"; const sep = "\0"; diff --git a/lib/data/kv_primitives.test.ts b/lib/data/kv_primitives.test.ts index 6b0f8135..b41e07c0 100644 --- a/lib/data/kv_primitives.test.ts +++ b/lib/data/kv_primitives.test.ts @@ -1,6 +1,6 @@ -import { KvPrimitives } from "./kv_primitives.ts"; +import type { KvPrimitives } from "./kv_primitives.ts"; import { assertEquals } from "@std/assert"; -import { KV } from "../../plug-api/types.ts"; +import type { KV } from "../../plug-api/types.ts"; export async function allTests(db: KvPrimitives) { await db.batchSet([ diff --git a/lib/data/kv_primitives.ts b/lib/data/kv_primitives.ts index 375759a5..a680c7e0 100644 --- a/lib/data/kv_primitives.ts +++ b/lib/data/kv_primitives.ts @@ -1,4 +1,4 @@ -import { KV, KvKey } from "../../plug-api/types.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; export type KvQueryOptions = { prefix?: KvKey; diff --git a/lib/data/memory_kv_primitives.ts b/lib/data/memory_kv_primitives.ts index 7e2f389c..750850e2 100644 --- a/lib/data/memory_kv_primitives.ts +++ b/lib/data/memory_kv_primitives.ts @@ -1,5 +1,5 @@ -import { KV, KvKey } from "../../plug-api/types.ts"; -import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; +import type { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; const memoryKeySeparator = "\0"; diff --git a/lib/data/mq.datastore.ts b/lib/data/mq.datastore.ts index 3607103f..a88ba050 100644 --- a/lib/data/mq.datastore.ts +++ b/lib/data/mq.datastore.ts @@ -1,11 +1,11 @@ -import { +import type { KV, MQMessage, MQStats, MQSubscribeOptions, } from "../../plug-api/types.ts"; -import { MessageQueue } from "./mq.ts"; -import { DataStore } from "./datastore.ts"; +import type { MessageQueue } from "./mq.ts"; +import type { DataStore } from "./datastore.ts"; export type ProcessingMessage = MQMessage & { ts: number; diff --git a/lib/data/mq.ts b/lib/data/mq.ts index fd54be21..d73245c0 100644 --- a/lib/data/mq.ts +++ b/lib/data/mq.ts @@ -1,4 +1,4 @@ -import { +import type { MQMessage, MQStats, MQSubscribeOptions, diff --git a/lib/data/prefixed_kv_primitives.ts b/lib/data/prefixed_kv_primitives.ts index d22e49f1..f02dd30e 100644 --- a/lib/data/prefixed_kv_primitives.ts +++ b/lib/data/prefixed_kv_primitives.ts @@ -1,5 +1,5 @@ -import { KV, KvKey } from "../../plug-api/types.ts"; -import { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; +import type { KV, KvKey } from "../../plug-api/types.ts"; +import type { KvPrimitives, KvQueryOptions } from "./kv_primitives.ts"; /** * Turns any KvPrimitives into a KvPrimitives that automatically prefixes all keys (and removes them again when reading) diff --git a/lib/manifest.ts b/lib/manifest.ts index edf17b93..8d1dcff8 100644 --- a/lib/manifest.ts +++ b/lib/manifest.ts @@ -1,6 +1,6 @@ -import { Manifest as PlugosManifest } from "./plugos/types.ts"; -import { CommandDef } from "./command.ts"; -import { NamespaceOperation } from "./plugos/namespace.ts"; +import type { Manifest as PlugosManifest } from "./plugos/types.ts"; +import type { CommandDef } from "./command.ts"; +import type { NamespaceOperation } from "./plugos/namespace.ts"; export type CodeWidgetT = { codeWidget?: string; diff --git a/lib/plugos/eventhook.ts b/lib/plugos/eventhook.ts index 43b722f1..1f286d16 100644 --- a/lib/plugos/eventhook.ts +++ b/lib/plugos/eventhook.ts @@ -1,5 +1,5 @@ -import { EventHookT } from "$lib/manifest.ts"; -import { Hook } from "./types.ts"; +import type { EventHookT } from "$lib/manifest.ts"; +import type { Hook } from "./types.ts"; export interface EventHookI extends Hook { dispatchEvent(eventName: string, ...args: unknown[]): Promise; diff --git a/lib/plugos/hooks/cron.ts b/lib/plugos/hooks/cron.ts index 96a3ee29..a215f917 100644 --- a/lib/plugos/hooks/cron.ts +++ b/lib/plugos/hooks/cron.ts @@ -1,7 +1,7 @@ -import { Hook, Manifest } from "../types.ts"; +import type { Hook, Manifest } from "../types.ts"; import { Cron } from "../../deps_server.ts"; -import { System } from "../system.ts"; -import { CronHookT } from "$lib/manifest.ts"; +import type { System } from "../system.ts"; +import type { CronHookT } from "$lib/manifest.ts"; export class CronHook implements Hook { tasks: Cron[] = []; diff --git a/lib/plugos/hooks/mq.ts b/lib/plugos/hooks/mq.ts index c107f7c3..d57f4875 100644 --- a/lib/plugos/hooks/mq.ts +++ b/lib/plugos/hooks/mq.ts @@ -1,9 +1,9 @@ -import { Hook, Manifest } from "../types.ts"; -import { System } from "../system.ts"; -import { MQMessage } from "../../../plug-api/types.ts"; -import { MessageQueue } from "../../data/mq.ts"; +import type { Hook, Manifest } from "../types.ts"; +import type { System } from "../system.ts"; +import type { MQMessage } from "../../../plug-api/types.ts"; +import type { MessageQueue } from "../../data/mq.ts"; import { throttle } from "../../async.ts"; -import { MQHookT } from "$lib/manifest.ts"; +import type { MQHookT } from "$lib/manifest.ts"; export class MQHook implements Hook { subscriptions: (() => void)[] = []; diff --git a/lib/plugos/manifest_cache.ts b/lib/plugos/manifest_cache.ts index 3f9af989..e193a3bb 100644 --- a/lib/plugos/manifest_cache.ts +++ b/lib/plugos/manifest_cache.ts @@ -1,6 +1,6 @@ -import { KvPrimitives } from "../data/kv_primitives.ts"; -import { Plug } from "./plug.ts"; -import { Manifest } from "./types.ts"; +import type { KvPrimitives } from "../data/kv_primitives.ts"; +import type { Plug } from "./plug.ts"; +import type { Manifest } from "./types.ts"; export interface ManifestCache { getManifest(plug: Plug, hash: number): Promise>; diff --git a/lib/plugos/plug.ts b/lib/plugos/plug.ts index cd443b2c..eb86b8bd 100644 --- a/lib/plugos/plug.ts +++ b/lib/plugos/plug.ts @@ -1,7 +1,7 @@ -import { Manifest } from "./types.ts"; -import { System } from "./system.ts"; -import { AssetBundle } from "../asset_bundle/bundle.ts"; -import { Sandbox, SandboxFactory } from "./sandboxes/sandbox.ts"; +import type { Manifest } from "./types.ts"; +import type { System } from "./system.ts"; +import type { AssetBundle } from "../asset_bundle/bundle.ts"; +import type { Sandbox, SandboxFactory } from "./sandboxes/sandbox.ts"; export class Plug { readonly runtimeEnv?: string; diff --git a/lib/plugos/sandboxes/no_sandbox.ts b/lib/plugos/sandboxes/no_sandbox.ts index 83a732bf..8cccd119 100644 --- a/lib/plugos/sandboxes/no_sandbox.ts +++ b/lib/plugos/sandboxes/no_sandbox.ts @@ -1,8 +1,8 @@ -import { Plug } from "../plug.ts"; -import { Sandbox } from "./sandbox.ts"; -import { Manifest } from "../types.ts"; -import { System } from "../system.ts"; -import { SandboxFactory } from "./sandbox.ts"; +import type { Plug } from "../plug.ts"; +import type { Sandbox } from "./sandbox.ts"; +import type { Manifest } from "../types.ts"; +import type { System } from "../system.ts"; +import type { SandboxFactory } from "./sandbox.ts"; import { PromiseQueue } from "../../async.ts"; /** diff --git a/lib/plugos/sandboxes/sandbox.ts b/lib/plugos/sandboxes/sandbox.ts index 9ae92f4a..492fc890 100644 --- a/lib/plugos/sandboxes/sandbox.ts +++ b/lib/plugos/sandboxes/sandbox.ts @@ -1,5 +1,5 @@ -import { Plug } from "../plug.ts"; -import { Manifest } from "../types.ts"; +import type { Plug } from "../plug.ts"; +import type { Manifest } from "../types.ts"; export type SandboxFactory = (plug: Plug) => Sandbox; diff --git a/lib/plugos/sandboxes/worker_sandbox.ts b/lib/plugos/sandboxes/worker_sandbox.ts index 3312cb18..ebac3b91 100644 --- a/lib/plugos/sandboxes/worker_sandbox.ts +++ b/lib/plugos/sandboxes/worker_sandbox.ts @@ -1,8 +1,8 @@ -import { Manifest } from "../types.ts"; -import { ControllerMessage, WorkerMessage } from "../protocol.ts"; -import { Plug } from "../plug.ts"; -import { AssetBundle, AssetJson } from "../../asset_bundle/bundle.ts"; -import { Sandbox } from "./sandbox.ts"; +import type { Manifest } from "../types.ts"; +import type { ControllerMessage, WorkerMessage } from "../protocol.ts"; +import type { Plug } from "../plug.ts"; +import { AssetBundle, type AssetJson } from "../../asset_bundle/bundle.ts"; +import type { Sandbox } from "./sandbox.ts"; /** * Represents a "safe" execution environment for plug code diff --git a/lib/plugos/syscalls/asset.ts b/lib/plugos/syscalls/asset.ts index 67b0e436..8e4e5f0f 100644 --- a/lib/plugos/syscalls/asset.ts +++ b/lib/plugos/syscalls/asset.ts @@ -1,4 +1,4 @@ -import { SysCallMapping, System } from "../system.ts"; +import type { SysCallMapping, System } from "../system.ts"; export default function assetSyscalls(system: System): SysCallMapping { return { diff --git a/lib/plugos/syscalls/datastore.ts b/lib/plugos/syscalls/datastore.ts index 476c3dfe..5e083511 100644 --- a/lib/plugos/syscalls/datastore.ts +++ b/lib/plugos/syscalls/datastore.ts @@ -1,4 +1,4 @@ -import { KV, KvKey, KvQuery } from "../../../plug-api/types.ts"; +import type { KV, KvKey, KvQuery } from "../../../plug-api/types.ts"; import type { DataStore } from "../../data/datastore.ts"; import type { SysCallMapping } from "../system.ts"; diff --git a/lib/plugos/syscalls/event.ts b/lib/plugos/syscalls/event.ts index 19d1d24e..df7cfd0e 100644 --- a/lib/plugos/syscalls/event.ts +++ b/lib/plugos/syscalls/event.ts @@ -1,5 +1,5 @@ -import { SysCallMapping } from "../system.ts"; -import { EventHookI } from "../eventhook.ts"; +import type { SysCallMapping } from "../system.ts"; +import type { EventHookI } from "../eventhook.ts"; export function eventSyscalls(eventHook: EventHookI): SysCallMapping { return { diff --git a/lib/plugos/syscalls/fetch.ts b/lib/plugos/syscalls/fetch.ts index d098c548..6de35ddf 100644 --- a/lib/plugos/syscalls/fetch.ts +++ b/lib/plugos/syscalls/fetch.ts @@ -1,5 +1,8 @@ import type { SysCallMapping } from "../system.ts"; -import { ProxyFetchRequest, ProxyFetchResponse } from "../../proxy_fetch.ts"; +import type { + ProxyFetchRequest, + ProxyFetchResponse, +} from "../../proxy_fetch.ts"; import { base64Encode } from "../../crypto.ts"; export function sandboxFetchSyscalls(): SysCallMapping { diff --git a/lib/plugos/syscalls/fs.deno.test.ts b/lib/plugos/syscalls/fs.deno.test.ts index 0e7ae78a..6a06d00f 100644 --- a/lib/plugos/syscalls/fs.deno.test.ts +++ b/lib/plugos/syscalls/fs.deno.test.ts @@ -1,4 +1,4 @@ -import { FileMeta } from "../../../plug-api/types.ts"; +import type { FileMeta } from "../../../plug-api/types.ts"; import { assert } from "@std/assert"; import { path } from "../../deps_server.ts"; import fileSystemSyscalls from "./fs.deno.ts"; diff --git a/lib/plugos/syscalls/fs.deno.ts b/lib/plugos/syscalls/fs.deno.ts index 81ffeb7c..d2f63448 100644 --- a/lib/plugos/syscalls/fs.deno.ts +++ b/lib/plugos/syscalls/fs.deno.ts @@ -1,6 +1,6 @@ import type { SysCallMapping } from "../system.ts"; import { mime, path, walk } from "../../deps_server.ts"; -import { FileMeta } from "../../../plug-api/types.ts"; +import type { FileMeta } from "../../../plug-api/types.ts"; import { base64DecodeDataUrl, base64Encode } from "../../crypto.ts"; export default function fileSystemSyscalls(root = "/"): SysCallMapping { diff --git a/lib/plugos/syscalls/mq.ts b/lib/plugos/syscalls/mq.ts index 2f0d40a1..158f1150 100644 --- a/lib/plugos/syscalls/mq.ts +++ b/lib/plugos/syscalls/mq.ts @@ -1,5 +1,5 @@ -import { SysCallMapping } from "../system.ts"; -import { MessageQueue } from "../../data/mq.ts"; +import type { SysCallMapping } from "../system.ts"; +import type { MessageQueue } from "../../data/mq.ts"; export function mqSyscalls( mq: MessageQueue, diff --git a/lib/plugos/system.ts b/lib/plugos/system.ts index 78138f7d..5c214c22 100644 --- a/lib/plugos/system.ts +++ b/lib/plugos/system.ts @@ -1,8 +1,8 @@ -import { Hook } from "./types.ts"; +import type { Hook } from "./types.ts"; import { EventEmitter } from "./event.ts"; import type { SandboxFactory } from "./sandboxes/sandbox.ts"; import { Plug } from "./plug.ts"; -import { InMemoryManifestCache, ManifestCache } from "./manifest_cache.ts"; +import { InMemoryManifestCache, type ManifestCache } from "./manifest_cache.ts"; export interface SysCallMapping { [key: string]: (ctx: SyscallContext, ...args: any) => Promise | any; diff --git a/lib/plugos/types.ts b/lib/plugos/types.ts index f01f1f7a..013f4135 100644 --- a/lib/plugos/types.ts +++ b/lib/plugos/types.ts @@ -1,5 +1,5 @@ -import { System } from "./system.ts"; -import { AssetJson } from "../asset_bundle/bundle.ts"; +import type { System } from "./system.ts"; +import type { AssetJson } from "../asset_bundle/bundle.ts"; /** The generic top level of a plug manifest file. * Defines plug metadata and functions. diff --git a/plug-api/lib/attribute.ts b/plug-api/lib/attribute.ts index 8b4d0f53..69c526a3 100644 --- a/plug-api/lib/attribute.ts +++ b/plug-api/lib/attribute.ts @@ -1,6 +1,6 @@ import { findNodeOfType, - ParseTree, + type ParseTree, renderToText, replaceNodesMatchingAsync, } from "./tree.ts"; diff --git a/plug-api/lib/feed.ts b/plug-api/lib/feed.ts index 464e6a68..34ac2137 100644 --- a/plug-api/lib/feed.ts +++ b/plug-api/lib/feed.ts @@ -1,7 +1,7 @@ import { findNodeMatching, findNodeOfType, - ParseTree, + type ParseTree, renderToText, } from "./tree.ts"; diff --git a/plug-api/lib/frontmatter.ts b/plug-api/lib/frontmatter.ts index b92bc713..4b3167b3 100644 --- a/plug-api/lib/frontmatter.ts +++ b/plug-api/lib/frontmatter.ts @@ -1,6 +1,6 @@ import { addParentPointers, - ParseTree, + type ParseTree, renderToText, replaceNodesMatchingAsync, traverseTreeAsync, diff --git a/plug-api/lib/markdown.ts b/plug-api/lib/markdown.ts index dea82841..027f16f8 100644 --- a/plug-api/lib/markdown.ts +++ b/plug-api/lib/markdown.ts @@ -1,4 +1,4 @@ -import { findNodeOfType, ParseTree, renderToText } from "$sb/lib/tree.ts"; +import { findNodeOfType, type ParseTree, renderToText } from "$sb/lib/tree.ts"; export function stripMarkdown( tree: ParseTree, diff --git a/plug-api/lib/parser-query.test.ts b/plug-api/lib/parser-query.test.ts index b2f4377e..e53763fd 100644 --- a/plug-api/lib/parser-query.test.ts +++ b/plug-api/lib/parser-query.test.ts @@ -1,5 +1,5 @@ import { parse } from "$common/markdown_parser/parse_tree.ts"; -import { AST, collectNodesOfType, parseTreeToAST } from "./tree.ts"; +import { type AST, collectNodesOfType, parseTreeToAST } from "./tree.ts"; import { assert, assertEquals } from "@std/assert"; import { astToKvQuery } from "$sb/lib/parse-query.ts"; import { languageFor } from "$common/languages.ts"; diff --git a/plug-api/lib/query.ts b/plug-api/lib/query.ts index 698c785f..30e080a0 100644 --- a/plug-api/lib/query.ts +++ b/plug-api/lib/query.ts @@ -1,4 +1,4 @@ -import { FunctionMap, KV, Query, QueryExpression } from "../types.ts"; +import type { FunctionMap, KV, Query, QueryExpression } from "../types.ts"; import { evalQueryExpression } from "./query_expression.ts"; /** diff --git a/plug-api/lib/query_expression.ts b/plug-api/lib/query_expression.ts index 280d8f65..b81b8fb9 100644 --- a/plug-api/lib/query_expression.ts +++ b/plug-api/lib/query_expression.ts @@ -1,4 +1,4 @@ -import { FunctionMap, QueryExpression } from "../types.ts"; +import type { FunctionMap, QueryExpression } from "../types.ts"; export function evalQueryExpression( val: QueryExpression, diff --git a/plug-api/lib/resolve.test.ts b/plug-api/lib/resolve.test.ts index 0210114f..6ecfc0fd 100644 --- a/plug-api/lib/resolve.test.ts +++ b/plug-api/lib/resolve.test.ts @@ -5,7 +5,7 @@ import { rewritePageRefs, } from "$sb/lib/resolve.ts"; import { assertEquals } from "@std/assert"; -import { ParseTree, renderToText } from "./tree.ts"; +import { type ParseTree, renderToText } from "./tree.ts"; import { parse } from "$common/markdown_parser/parse_tree.ts"; import { extendedMarkdownLanguage } from "$common/markdown_parser/parser.ts"; diff --git a/plug-api/lib/resolve.ts b/plug-api/lib/resolve.ts index cd348eba..6ed30826 100644 --- a/plug-api/lib/resolve.ts +++ b/plug-api/lib/resolve.ts @@ -1,4 +1,4 @@ -import { findNodeOfType, ParseTree, traverseTree } from "./tree.ts"; +import { findNodeOfType, type ParseTree, traverseTree } from "./tree.ts"; // [[Wikilinks]] use absolute paths and should pass pathToResolve with a leading / to this function // [Markdown links]() are relative unless it has a leading / diff --git a/plug-api/lib/tags.ts b/plug-api/lib/tags.ts index 4333141d..42ccd979 100644 --- a/plug-api/lib/tags.ts +++ b/plug-api/lib/tags.ts @@ -1,5 +1,5 @@ -import { FrontMatter } from "./frontmatter.ts"; -import { ObjectValue } from "../types.ts"; +import type { FrontMatter } from "./frontmatter.ts"; +import type { ObjectValue } from "../types.ts"; export function updateITags(obj: ObjectValue, frontmatter: FrontMatter) { const itags = [obj.tag, ...frontmatter.tags || []]; diff --git a/plug-api/syscalls/datastore.ts b/plug-api/syscalls/datastore.ts index b906d1ba..2101fcd2 100644 --- a/plug-api/syscalls/datastore.ts +++ b/plug-api/syscalls/datastore.ts @@ -1,5 +1,5 @@ import { syscall } from "../syscall.ts"; -import { KV, KvKey, KvQuery } from "../types.ts"; +import type { KV, KvKey, KvQuery } from "../types.ts"; export function set(key: KvKey, value: any): Promise { return syscall("datastore.set", key, value); diff --git a/plug-api/syscalls/editor.ts b/plug-api/syscalls/editor.ts index 9e80f80f..37cc7fc5 100644 --- a/plug-api/syscalls/editor.ts +++ b/plug-api/syscalls/editor.ts @@ -1,4 +1,4 @@ -import { UploadFile } from "../types.ts"; +import type { UploadFile } from "../types.ts"; import { syscall } from "../syscall.ts"; import type { PageRef } from "../lib/page_ref.ts"; import type { FilterOption } from "../../lib/web.ts"; diff --git a/plug-api/syscalls/space.ts b/plug-api/syscalls/space.ts index b44a0bb4..11928312 100644 --- a/plug-api/syscalls/space.ts +++ b/plug-api/syscalls/space.ts @@ -1,5 +1,5 @@ import { syscall } from "../syscall.ts"; -import { AttachmentMeta, FileMeta, PageMeta } from "../types.ts"; +import type { AttachmentMeta, FileMeta, PageMeta } from "../types.ts"; export function listPages(unfiltered = false): Promise { return syscall("space.listPages", unfiltered); diff --git a/plugs/editor/command.ts b/plugs/editor/command.ts index 9c67664e..f9e536a4 100644 --- a/plugs/editor/command.ts +++ b/plugs/editor/command.ts @@ -1,5 +1,5 @@ import { system } from "$sb/syscalls.ts"; -import { CompleteEvent } from "../../plug-api/types.ts"; +import type { CompleteEvent } from "../../plug-api/types.ts"; export async function commandComplete(completeEvent: CompleteEvent) { const match = /\{\[([^\]\[]*)$/.exec(completeEvent.linePrefix); diff --git a/plugs/editor/complete.ts b/plugs/editor/complete.ts index a0f41d49..eb0e4d33 100644 --- a/plugs/editor/complete.ts +++ b/plugs/editor/complete.ts @@ -1,4 +1,4 @@ -import { +import type { AttachmentMeta, CompleteEvent, FileMeta, diff --git a/plugs/editor/navigate.ts b/plugs/editor/navigate.ts index 4e8e342f..6738af96 100644 --- a/plugs/editor/navigate.ts +++ b/plugs/editor/navigate.ts @@ -5,7 +5,7 @@ import { findNodeOfType, findParentMatching, nodeAtPos, - ParseTree, + type ParseTree, } from "$sb/lib/tree.ts"; import { isLocalPath, resolvePath } from "$sb/lib/resolve.ts"; import { looksLikePathWithExtension, parsePageRef } from "$sb/lib/page_ref.ts"; diff --git a/plugs/editor/upload.ts b/plugs/editor/upload.ts index 0047c50d..ec09a5a4 100644 --- a/plugs/editor/upload.ts +++ b/plugs/editor/upload.ts @@ -1,6 +1,6 @@ import { readSetting } from "$sb/lib/settings_page.ts"; import { editor, space } from "$sb/syscalls.ts"; -import { UploadFile } from "$sb/types.ts"; +import type { UploadFile } from "$sb/types.ts"; import { defaultLinkStyle, maximumAttachmentSize, diff --git a/plugs/index/api.ts b/plugs/index/api.ts index 408faa72..16a9ecc1 100644 --- a/plugs/index/api.ts +++ b/plugs/index/api.ts @@ -1,12 +1,12 @@ import { datastore } from "$sb/syscalls.ts"; -import { +import type { KV, KvKey, KvQuery, ObjectQuery, ObjectValue, } from "../../plug-api/types.ts"; -import { QueryProviderEvent } from "../../plug-api/types.ts"; +import type { QueryProviderEvent } from "../../plug-api/types.ts"; import { builtins } from "./builtins.ts"; import { determineType } from "./attributes.ts"; import { ttlCache } from "$lib/memory_cache.ts"; diff --git a/plugs/index/attachment.ts b/plugs/index/attachment.ts index ebf53e94..2772d280 100644 --- a/plugs/index/attachment.ts +++ b/plugs/index/attachment.ts @@ -1,5 +1,5 @@ import { space, system } from "$sb/syscalls.ts"; -import { AttachmentMeta } from "$sb/types.ts"; +import type { AttachmentMeta } from "$sb/types.ts"; import { indexObjects } from "./api.ts"; // Note: clearFileIndex is not called but since this is the only attachmet:index listener, this should be fine (famous last words) diff --git a/plugs/index/attributes.ts b/plugs/index/attributes.ts index f6db4a25..874bc785 100644 --- a/plugs/index/attributes.ts +++ b/plugs/index/attributes.ts @@ -1,7 +1,7 @@ import type { CompleteEvent } from "../../plug-api/types.ts"; import { events } from "$sb/syscalls.ts"; import { queryObjects } from "./api.ts"; -import { ObjectValue, QueryExpression } from "../../plug-api/types.ts"; +import type { ObjectValue, QueryExpression } from "../../plug-api/types.ts"; import { determineTags } from "$lib/cheap_yaml.ts"; export type AttributeObject = ObjectValue<{ diff --git a/plugs/index/builtins.ts b/plugs/index/builtins.ts index 60d31712..afbab892 100644 --- a/plugs/index/builtins.ts +++ b/plugs/index/builtins.ts @@ -1,6 +1,6 @@ import { system } from "$sb/syscalls.ts"; import { indexObjects } from "./api.ts"; -import { ObjectValue, QueryProviderEvent } from "$sb/types.ts"; +import type { ObjectValue, QueryProviderEvent } from "$sb/types.ts"; import { applyQuery } from "$sb/lib/query.ts"; import { builtinFunctions } from "$lib/builtin_query_functions.ts"; diff --git a/plugs/index/command.ts b/plugs/index/command.ts index 536774d5..2fcec00e 100644 --- a/plugs/index/command.ts +++ b/plugs/index/command.ts @@ -1,5 +1,5 @@ import { editor, events, markdown, mq, space, system } from "$sb/syscalls.ts"; -import { IndexEvent, MQMessage } from "$sb/types.ts"; +import type { IndexEvent, MQMessage } from "$sb/types.ts"; import { isTemplate } from "$lib/cheap_yaml.ts"; import { sleep } from "$lib/async.ts"; import { plugPrefix } from "$common/spaces/constants.ts"; diff --git a/plugs/index/data.ts b/plugs/index/data.ts index 1f9d331e..856f8b33 100644 --- a/plugs/index/data.ts +++ b/plugs/index/data.ts @@ -1,9 +1,9 @@ import type { IndexTreeEvent } from "../../plug-api/types.ts"; import { YAML } from "$sb/syscalls.ts"; import { collectNodesOfType, findNodeOfType } from "$sb/lib/tree.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects } from "./api.ts"; -import { TagObject } from "./tags.ts"; +import type { TagObject } from "./tags.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; import { updateITags } from "$sb/lib/tags.ts"; diff --git a/plugs/index/header.ts b/plugs/index/header.ts index 313dee82..2fe96340 100644 --- a/plugs/index/header.ts +++ b/plugs/index/header.ts @@ -4,7 +4,7 @@ import { renderToText, } from "$sb/lib/tree.ts"; import type { CompleteEvent, IndexTreeEvent } from "../../plug-api/types.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects, queryObjects } from "./api.ts"; import { parsePageRef } from "$sb/lib/page_ref.ts"; import { extractAttributes } from "$sb/lib/attribute.ts"; diff --git a/plugs/index/item.ts b/plugs/index/item.ts index 41680af4..93a42db5 100644 --- a/plugs/index/item.ts +++ b/plugs/index/item.ts @@ -2,12 +2,12 @@ import type { IndexTreeEvent } from "../../plug-api/types.ts"; import { collectNodesOfType, - ParseTree, + type ParseTree, renderToText, } from "../../plug-api/lib/tree.ts"; import { extractAttributes } from "$sb/lib/attribute.ts"; import { rewritePageRefs } from "$sb/lib/resolve.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects } from "./api.ts"; import { updateITags } from "$sb/lib/tags.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; diff --git a/plugs/index/lint.ts b/plugs/index/lint.ts index 10b2a1f9..88b69258 100644 --- a/plugs/index/lint.ts +++ b/plugs/index/lint.ts @@ -1,13 +1,13 @@ import { YAML } from "$sb/syscalls.ts"; -import { LintDiagnostic, QueryExpression } from "../../plug-api/types.ts"; +import type { LintDiagnostic, QueryExpression } from "../../plug-api/types.ts"; import { findNodeOfType, renderToText, traverseTreeAsync, } from "$sb/lib/tree.ts"; -import { LintEvent } from "../../plug-api/types.ts"; +import type { LintEvent } from "../../plug-api/types.ts"; import { queryObjects } from "./api.ts"; -import { AttributeObject } from "./attributes.ts"; +import type { AttributeObject } from "./attributes.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; export async function lintYAML({ tree }: LintEvent): Promise { diff --git a/plugs/index/page_links.ts b/plugs/index/page_links.ts index 3addc833..e91b7462 100644 --- a/plugs/index/page_links.ts +++ b/plugs/index/page_links.ts @@ -1,5 +1,5 @@ import { findNodeOfType, renderToText, traverseTree } from "$sb/lib/tree.ts"; -import { IndexTreeEvent, ObjectValue } from "$sb/types.ts"; +import type { IndexTreeEvent, ObjectValue } from "$sb/types.ts"; import { isLocalPath, resolvePath } from "$sb/lib/resolve.ts"; import { indexObjects, queryObjects } from "./api.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; diff --git a/plugs/index/paragraph.ts b/plugs/index/paragraph.ts index 16eea3a0..fbff4a1b 100644 --- a/plugs/index/paragraph.ts +++ b/plugs/index/paragraph.ts @@ -7,7 +7,7 @@ import { traverseTreeAsync, } from "../../plug-api/lib/tree.ts"; import { extractAttributes } from "$sb/lib/attribute.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { updateITags } from "$sb/lib/tags.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; diff --git a/plugs/index/refactor.ts b/plugs/index/refactor.ts index 08bf2926..5edd4637 100644 --- a/plugs/index/refactor.ts +++ b/plugs/index/refactor.ts @@ -1,9 +1,9 @@ import { editor, space } from "$sb/syscalls.ts"; import { validatePageName } from "$sb/lib/page_ref.ts"; -import { getBackLinks, LinkObject } from "./page_links.ts"; +import { getBackLinks, type LinkObject } from "./page_links.ts"; import { queryObjects } from "./api.ts"; import { absoluteToRelativePath, folderName } from "$sb/lib/resolve.ts"; -import { ObjectValue } from "$sb/types.ts"; +import type { ObjectValue } from "$sb/types.ts"; /** * Renames a single page. diff --git a/plugs/index/script.ts b/plugs/index/script.ts index 193b8354..8b53a67b 100644 --- a/plugs/index/script.ts +++ b/plugs/index/script.ts @@ -1,6 +1,6 @@ -import { IndexTreeEvent } from "../../plug-api/types.ts"; +import type { IndexTreeEvent } from "../../plug-api/types.ts"; import { collectNodesOfType, findNodeOfType } from "../../plug-api/lib/tree.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects } from "./api.ts"; export type ScriptObject = ObjectValue<{ diff --git a/plugs/index/style.ts b/plugs/index/style.ts index f19d7cc7..aae06418 100644 --- a/plugs/index/style.ts +++ b/plugs/index/style.ts @@ -1,6 +1,6 @@ -import { IndexTreeEvent } from "../../plug-api/types.ts"; +import type { IndexTreeEvent } from "../../plug-api/types.ts"; import { collectNodesOfType, findNodeOfType } from "../../plug-api/lib/tree.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects } from "./api.ts"; import { readSetting } from "$sb/lib/settings_page.ts"; import { cleanPageRef } from "$sb/lib/resolve.ts"; diff --git a/plugs/index/table.ts b/plugs/index/table.ts index 2617871f..9a0d9238 100644 --- a/plugs/index/table.ts +++ b/plugs/index/table.ts @@ -1,8 +1,8 @@ -import { IndexTreeEvent, ObjectValue } from "../../plug-api/types.ts"; +import type { IndexTreeEvent, ObjectValue } from "../../plug-api/types.ts"; import { collectNodesMatching, collectNodesOfType, - ParseTree, + type ParseTree, } from "$sb/lib/tree.ts"; import { indexObjects } from "./api.ts"; diff --git a/plugs/index/tag_page.ts b/plugs/index/tag_page.ts index 435a023b..ac0746e8 100644 --- a/plugs/index/tag_page.ts +++ b/plugs/index/tag_page.ts @@ -1,4 +1,4 @@ -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import { markdown, system } from "$sb/syscalls.ts"; import { renderToText } from "$sb/lib/tree.ts"; import { tagPrefix } from "./constants.ts"; diff --git a/plugs/index/toc.ts b/plugs/index/toc.ts index 83292ea6..9df7e29b 100644 --- a/plugs/index/toc.ts +++ b/plugs/index/toc.ts @@ -1,5 +1,5 @@ import { editor, markdown, YAML } from "$sb/syscalls.ts"; -import { CodeWidgetContent } from "$sb/types.ts"; +import type { CodeWidgetContent } from "$sb/types.ts"; import { stripMarkdown } from "$sb/lib/markdown.ts"; import { traverseTree } from "$sb/lib/tree.ts"; diff --git a/plugs/index/widget.ts b/plugs/index/widget.ts index 6ae508b4..fc368e0c 100644 --- a/plugs/index/widget.ts +++ b/plugs/index/widget.ts @@ -1,9 +1,9 @@ import { codeWidget, editor, language, markdown, space } from "$sb/syscalls.ts"; import { parseTreeToAST, renderToText } from "$sb/lib/tree.ts"; -import { CodeWidgetContent } from "../../plug-api/types.ts"; +import type { CodeWidgetContent } from "../../plug-api/types.ts"; import { loadPageObject } from "../template/page.ts"; import { queryObjects } from "./api.ts"; -import { TemplateObject, WidgetConfig } from "../template/types.ts"; +import { type TemplateObject, WidgetConfig } from "../template/types.ts"; import { expressionToKvQueryExpression } from "$sb/lib/parse-query.ts"; import { evalQueryExpression } from "$sb/lib/query_expression.ts"; import { renderTemplate } from "../template/plug_api.ts"; diff --git a/plugs/markdown/api.ts b/plugs/markdown/api.ts index 508ed084..be57d383 100644 --- a/plugs/markdown/api.ts +++ b/plugs/markdown/api.ts @@ -1,13 +1,13 @@ import { findNodeOfType, - ParseTree, + type ParseTree, renderToText, replaceNodesMatchingAsync, } from "../../plug-api/lib/tree.ts"; import { codeWidget } from "$sb/syscalls.ts"; import { parseMarkdown } from "../../plug-api/syscalls/markdown.ts"; import { - MarkdownRenderOptions, + type MarkdownRenderOptions, renderMarkdownToHtml, } from "./markdown_render.ts"; import { validatePageName } from "$sb/lib/page_ref.ts"; diff --git a/plugs/markdown/markdown_render.ts b/plugs/markdown/markdown_render.ts index 4ded6f60..8d5fec72 100644 --- a/plugs/markdown/markdown_render.ts +++ b/plugs/markdown/markdown_render.ts @@ -2,15 +2,15 @@ import { addParentPointers, collectNodesOfType, findNodeOfType, - ParseTree, + type ParseTree, removeParentPointers, renderToText, traverseTree, } from "$sb/lib/tree.ts"; import { encodePageRef, parsePageRef } from "$sb/lib/page_ref.ts"; -import { Fragment, renderHtml, Tag } from "./html_render.ts"; +import { Fragment, renderHtml, type Tag } from "./html_render.ts"; import { isLocalPath } from "$sb/lib/resolve.ts"; -import { PageMeta } from "$sb/types.ts"; +import type { PageMeta } from "$sb/types.ts"; export type MarkdownRenderOptions = { failOnUnknown?: true; diff --git a/plugs/query/api.ts b/plugs/query/api.ts index 39574adb..090037d8 100644 --- a/plugs/query/api.ts +++ b/plugs/query/api.ts @@ -1,7 +1,7 @@ import { parseQuery } from "$sb/lib/parse-query.ts"; -import { Query } from "../../plug-api/types.ts"; +import type { Query } from "../../plug-api/types.ts"; import { events } from "$sb/syscalls.ts"; -import { QueryProviderEvent } from "../../plug-api/types.ts"; +import type { QueryProviderEvent } from "../../plug-api/types.ts"; import { resolvePath } from "$sb/lib/resolve.ts"; import { renderQueryTemplate } from "../template/util.ts"; diff --git a/plugs/query/complete.ts b/plugs/query/complete.ts index 2d6fa54f..d4e0555b 100644 --- a/plugs/query/complete.ts +++ b/plugs/query/complete.ts @@ -1,6 +1,6 @@ -import { CompleteEvent } from "../../plug-api/types.ts"; +import type { CompleteEvent } from "../../plug-api/types.ts"; import { events, language } from "$sb/syscalls.ts"; -import { +import type { AttributeCompleteEvent, AttributeCompletion, } from "../index/attributes.ts"; diff --git a/plugs/query/lint.ts b/plugs/query/lint.ts index 270ac346..630cb0be 100644 --- a/plugs/query/lint.ts +++ b/plugs/query/lint.ts @@ -1,9 +1,9 @@ -import { LintEvent } from "../../plug-api/types.ts"; +import type { LintEvent } from "../../plug-api/types.ts"; import { parseQuery } from "$sb/lib/parse-query.ts"; import { cleanPageRef, resolvePath } from "$sb/lib/resolve.ts"; import { findNodeOfType, traverseTreeAsync } from "$sb/lib/tree.ts"; import { events, space } from "$sb/syscalls.ts"; -import { LintDiagnostic } from "../../plug-api/types.ts"; +import type { LintDiagnostic } from "../../plug-api/types.ts"; import { loadPageObject, replaceTemplateVars } from "../template/page.ts"; export async function lintQuery( diff --git a/plugs/query/widget.ts b/plugs/query/widget.ts index 9b8da3b6..e9ed8dea 100644 --- a/plugs/query/widget.ts +++ b/plugs/query/widget.ts @@ -5,13 +5,13 @@ import { findNodeMatching, findNodeOfType, findParentMatching, - ParseTree, + type ParseTree, removeParentPointers, renderToText, } from "$sb/lib/tree.ts"; import { parseQuery } from "$sb/lib/parse-query.ts"; import { loadPageObject, replaceTemplateVars } from "../template/page.ts"; -import { CodeWidgetContent } from "../../plug-api/types.ts"; +import type { CodeWidgetContent } from "../../plug-api/types.ts"; import { jsonToMDTable } from "../template/util.ts"; import { renderQuery } from "./api.ts"; import type { ChangeSpec } from "@codemirror/state"; diff --git a/plugs/search/search.ts b/plugs/search/search.ts index 61e915c1..27d0dc98 100644 --- a/plugs/search/search.ts +++ b/plugs/search/search.ts @@ -1,8 +1,8 @@ -import { IndexTreeEvent, QueryProviderEvent } from "../../plug-api/types.ts"; +import type { IndexTreeEvent, QueryProviderEvent } from "../../plug-api/types.ts"; import { renderToText } from "$sb/lib/tree.ts"; import { applyQuery, liftAttributeFilter } from "$sb/lib/query.ts"; import { editor } from "$sb/syscalls.ts"; -import { FileMeta } from "../../plug-api/types.ts"; +import type { FileMeta } from "../../plug-api/types.ts"; import { ftsIndexPage, ftsSearch } from "./engine.ts"; import { evalQueryExpression } from "$sb/lib/query_expression.ts"; import { PromiseQueue } from "$lib/async.ts"; diff --git a/plugs/share/publish.ts b/plugs/share/publish.ts index 76129780..476f7983 100644 --- a/plugs/share/publish.ts +++ b/plugs/share/publish.ts @@ -1,6 +1,6 @@ import { editor, events, markdown } from "$sb/syscalls.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; -import { PublishEvent } from "../../plug-api/types.ts"; +import type { PublishEvent } from "../../plug-api/types.ts"; export async function publishShareOptions() { const text = await editor.getText(); diff --git a/plugs/share/share.ts b/plugs/share/share.ts index bc353828..4b0d315f 100644 --- a/plugs/share/share.ts +++ b/plugs/share/share.ts @@ -1,7 +1,7 @@ import { editor, events, markdown, system } from "$sb/syscalls.ts"; import { findNodeOfType, renderToText } from "../../plug-api/lib/tree.ts"; import { replaceNodesMatching } from "../../plug-api/lib/tree.ts"; -import { ParseTree } from "../../plug-api/lib/tree.ts"; +import type { ParseTree } from "../../plug-api/lib/tree.ts"; import { parsePageRef } from "$sb/lib/page_ref.ts"; type ShareOption = { diff --git a/plugs/tasks/complete.ts b/plugs/tasks/complete.ts index c5154ba0..8ee43859 100644 --- a/plugs/tasks/complete.ts +++ b/plugs/tasks/complete.ts @@ -1,6 +1,6 @@ -import { CompleteEvent } from "../../plug-api/types.ts"; +import type { CompleteEvent } from "../../plug-api/types.ts"; import { queryObjects } from "../index/plug_api.ts"; -import { TaskStateObject } from "./task.ts"; +import type { TaskStateObject } from "./task.ts"; export async function completeTaskState(completeEvent: CompleteEvent) { const taskMatch = /([\-\*]\s+\[)([^\[\]]+)$/.exec( diff --git a/plugs/tasks/task.ts b/plugs/tasks/task.ts index 3edf29c0..803a046a 100644 --- a/plugs/tasks/task.ts +++ b/plugs/tasks/task.ts @@ -9,7 +9,7 @@ import { findNodeOfType, findParentMatching, nodeAtPos, - ParseTree, + type ParseTree, renderToText, replaceNodesMatching, traverseTreeAsync, @@ -17,7 +17,7 @@ import { import { niceDate } from "$lib/dates.ts"; import { extractAttributes } from "$sb/lib/attribute.ts"; import { rewritePageRefs } from "$sb/lib/resolve.ts"; -import { ObjectValue } from "../../plug-api/types.ts"; +import type { ObjectValue } from "../../plug-api/types.ts"; import { indexObjects, queryObjects } from "../index/plug_api.ts"; import { updateITags } from "$sb/lib/tags.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; diff --git a/plugs/template/api.ts b/plugs/template/api.ts index f82311a8..d9fc51ec 100644 --- a/plugs/template/api.ts +++ b/plugs/template/api.ts @@ -1,6 +1,6 @@ import { markdown, template, YAML } from "$sb/syscalls.ts"; import { extractFrontmatter } from "$sb/lib/frontmatter.ts"; -import { TemplateObject } from "./types.ts"; +import type { TemplateObject } from "./types.ts"; import { renderToText } from "$sb/lib/tree.ts"; /** diff --git a/plugs/template/page.ts b/plugs/template/page.ts index 0d8251c1..02f30c49 100644 --- a/plugs/template/page.ts +++ b/plugs/template/page.ts @@ -1,7 +1,7 @@ import { editor, space, template } from "$sb/syscalls.ts"; -import { PageMeta } from "../../plug-api/types.ts"; +import type { PageMeta } from "../../plug-api/types.ts"; import { getObjectByRef, queryObjects } from "../index/plug_api.ts"; -import { FrontmatterConfig, TemplateObject } from "./types.ts"; +import { FrontmatterConfig, type TemplateObject } from "./types.ts"; import { renderTemplate } from "./api.ts"; export async function newPageCommand( diff --git a/plugs/template/snippet.ts b/plugs/template/snippet.ts index bf19bed6..9605c4e0 100644 --- a/plugs/template/snippet.ts +++ b/plugs/template/snippet.ts @@ -1,4 +1,4 @@ -import { +import type { CompleteEvent, SlashCompletionOption, SlashCompletions, @@ -6,7 +6,7 @@ import { import { editor, markdown, space, YAML } from "$sb/syscalls.ts"; import type { AttributeCompletion } from "../index/attributes.ts"; import { queryObjects } from "../index/plug_api.ts"; -import { TemplateObject } from "./types.ts"; +import type { TemplateObject } from "./types.ts"; import { loadPageObject } from "./page.ts"; import { renderTemplate } from "./api.ts"; import { diff --git a/plugs/template/types.ts b/plugs/template/types.ts index 4bc76b67..45c698b1 100644 --- a/plugs/template/types.ts +++ b/plugs/template/types.ts @@ -1,5 +1,5 @@ -import { ObjectValue } from "../../plug-api/types.ts"; -import { z, ZodEffects } from "zod"; +import type { ObjectValue } from "../../plug-api/types.ts"; +import { z, type ZodEffects } from "zod"; export const CommandConfig = z.object({ command: z.string().optional(), diff --git a/plugs/template/util.ts b/plugs/template/util.ts index 8365d699..6bf4ce3f 100644 --- a/plugs/template/util.ts +++ b/plugs/template/util.ts @@ -1,4 +1,4 @@ -import { PageMeta } from "../../plug-api/types.ts"; +import type { PageMeta } from "../../plug-api/types.ts"; import { space, template } from "$sb/syscalls.ts"; import { cleanTemplate } from "./plug_api.ts"; diff --git a/plugs/template/var.ts b/plugs/template/var.ts index 27078101..d3814810 100644 --- a/plugs/template/var.ts +++ b/plugs/template/var.ts @@ -1,7 +1,7 @@ -import { CompleteEvent } from "../../plug-api/types.ts"; +import type { CompleteEvent } from "../../plug-api/types.ts"; import { datastore, events } from "$sb/syscalls.ts"; -import { +import type { AttributeCompleteEvent, AttributeCompletion, } from "../index/attributes.ts"; diff --git a/plugs/template/widget.ts b/plugs/template/widget.ts index 6bdce24b..f1fb89eb 100644 --- a/plugs/template/widget.ts +++ b/plugs/template/widget.ts @@ -1,6 +1,6 @@ import { markdown, space, YAML } from "$sb/syscalls.ts"; import { loadPageObject, replaceTemplateVars } from "./page.ts"; -import { CodeWidgetContent, PageMeta } from "../../plug-api/types.ts"; +import type { CodeWidgetContent, PageMeta } from "../../plug-api/types.ts"; import { renderTemplate } from "./plug_api.ts"; import { renderToText } from "$sb/lib/tree.ts"; import { rewritePageRefs, rewritePageRefsInString } from "$sb/lib/resolve.ts"; diff --git a/scripts/generate_fs_list.ts b/scripts/generate_fs_list.ts index 6c99d533..a4999fbc 100644 --- a/scripts/generate_fs_list.ts +++ b/scripts/generate_fs_list.ts @@ -1,7 +1,7 @@ import { walk } from "@std/fs/walk"; import { resolve } from "@std/path"; import { mime } from "mimetypes"; -import { FileMeta } from "../plug-api/types.ts"; +import type { FileMeta } from "../plug-api/types.ts"; const rootDir = resolve("website_build"); diff --git a/server/db_backend.ts b/server/db_backend.ts index b0fd10f5..2bf3d6fa 100644 --- a/server/db_backend.ts +++ b/server/db_backend.ts @@ -1,5 +1,5 @@ import { DenoKvPrimitives } from "$lib/data/deno_kv_primitives.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { MemoryKvPrimitives } from "$lib/data/memory_kv_primitives.ts"; import { resolve } from "@std/path"; diff --git a/server/instance.ts b/server/instance.ts index 98392e02..f82c2e1a 100644 --- a/server/instance.ts +++ b/server/instance.ts @@ -1,4 +1,4 @@ -import { SilverBulletHooks } from "../lib/manifest.ts"; +import type { SilverBulletHooks } from "../lib/manifest.ts"; import { ensureAndLoadSettingsAndIndex, updateObjectDecorators, @@ -6,20 +6,20 @@ import { import { AssetBundlePlugSpacePrimitives } from "$common/spaces/asset_bundle_space_primitives.ts"; import { FilteredSpacePrimitives } from "$common/spaces/filtered_space_primitives.ts"; import { ReadOnlySpacePrimitives } from "$common/spaces/ro_space_primitives.ts"; -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; -import { AssetBundle } from "../lib/asset_bundle/bundle.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { AssetBundle } from "../lib/asset_bundle/bundle.ts"; import { EventHook } from "../common/hooks/event.ts"; import { DataStore } from "$lib/data/datastore.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { DataStoreMQ } from "$lib/data/mq.datastore.ts"; -import { System } from "$lib/plugos/system.ts"; +import type { System } from "$lib/plugos/system.ts"; import { JWTIssuer } from "./crypto.ts"; import { compile as gitIgnoreCompiler } from "gitignore-parser"; import { ServerSystem } from "./server_system.ts"; import { determineShellBackend, NotSupportedShell } from "./shell_backend.ts"; -import { ShellBackend } from "./shell_backend.ts"; +import type { ShellBackend } from "./shell_backend.ts"; import { determineStorageBackend } from "./storage_backend.ts"; -import { BuiltinSettings } from "$type/settings.ts"; +import type { BuiltinSettings } from "$type/settings.ts"; export type SpaceServerConfig = { hostname: string; diff --git a/server/server_system.ts b/server/server_system.ts index c58b6e3f..22e28226 100644 --- a/server/server_system.ts +++ b/server/server_system.ts @@ -1,10 +1,10 @@ import { PlugNamespaceHook } from "$common/hooks/plug_namespace.ts"; -import { SilverBulletHooks } from "../lib/manifest.ts"; +import type { SilverBulletHooks } from "../lib/manifest.ts"; import { EventedSpacePrimitives } from "$common/spaces/evented_space_primitives.ts"; import { PlugSpacePrimitives } from "$common/spaces/plug_space_primitives.ts"; import { createSandbox } from "../lib/plugos/sandboxes/web_worker_sandbox.ts"; import { CronHook } from "../lib/plugos/hooks/cron.ts"; -import { EventHook } from "../common/hooks/event.ts"; +import type { EventHook } from "../common/hooks/event.ts"; import { MQHook } from "../lib/plugos/hooks/mq.ts"; import assetSyscalls from "../lib/plugos/syscalls/asset.ts"; import { eventSyscalls } from "../lib/plugos/syscalls/event.ts"; @@ -17,8 +17,8 @@ import { systemSyscalls } from "$common/syscalls/system.ts"; import { yamlSyscalls } from "$common/syscalls/yaml.ts"; import { sandboxFetchSyscalls } from "../lib/plugos/syscalls/fetch.ts"; import { shellSyscalls } from "./syscalls/shell.ts"; -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; -import { Plug } from "../lib/plugos/plug.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { Plug } from "../lib/plugos/plug.ts"; import { DataStore } from "$lib/data/datastore.ts"; import { dataStoreReadSyscalls, @@ -29,13 +29,13 @@ import { templateSyscalls } from "$common/syscalls/template.ts"; import { codeWidgetSyscalls } from "../web/syscalls/code_widget.ts"; import { CodeWidgetHook } from "../web/hooks/code_widget.ts"; import { KVPrimitivesManifestCache } from "$lib/plugos/manifest_cache.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; -import { ShellBackend } from "./shell_backend.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { ShellBackend } from "./shell_backend.ts"; import { ensureSpaceIndex } from "$common/space_index.ts"; -import { FileMeta } from "../plug-api/types.ts"; +import type { FileMeta } from "../plug-api/types.ts"; import { CommandHook } from "$common/hooks/command.ts"; import { CommonSystem } from "$common/common_system.ts"; -import { DataStoreMQ } from "$lib/data/mq.datastore.ts"; +import type { DataStoreMQ } from "$lib/data/mq.datastore.ts"; import { plugPrefix } from "$common/spaces/constants.ts"; import { base64EncodedDataUrl } from "$lib/crypto.ts"; diff --git a/server/shell_backend.ts b/server/shell_backend.ts index dd0ebce6..c3425fc4 100644 --- a/server/shell_backend.ts +++ b/server/shell_backend.ts @@ -1,5 +1,5 @@ import type { SpaceServerConfig } from "./instance.ts"; -import { ShellRequest, ShellResponse } from "../type/rpc.ts"; +import type { ShellRequest, ShellResponse } from "../type/rpc.ts"; /** * Configuration via environment variables: diff --git a/server/storage_backend.ts b/server/storage_backend.ts index 613c77d8..19ca149e 100644 --- a/server/storage_backend.ts +++ b/server/storage_backend.ts @@ -1,8 +1,8 @@ import { DiskSpacePrimitives } from "$common/spaces/disk_space_primitives.ts"; -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; import { resolve } from "@std/path"; import { S3SpacePrimitives } from "$common/spaces/s3_space_primitives.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { ChunkedKvStoreSpacePrimitives } from "$common/spaces/chunked_datastore_space_primitives.ts"; import { HttpSpacePrimitives } from "$common/spaces/http_space_primitives.ts"; diff --git a/server/syscalls/shell.ts b/server/syscalls/shell.ts index 90ead351..51cf0cc3 100644 --- a/server/syscalls/shell.ts +++ b/server/syscalls/shell.ts @@ -1,6 +1,6 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; -import { ShellResponse } from "../../type/rpc.ts"; -import { ShellBackend } from "../shell_backend.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { ShellResponse } from "../../type/rpc.ts"; +import type { ShellBackend } from "../shell_backend.ts"; export function shellSyscalls(shellBackend: ShellBackend): SysCallMapping { return { diff --git a/server/syscalls/space.ts b/server/syscalls/space.ts index 8623fbbf..05de4301 100644 --- a/server/syscalls/space.ts +++ b/server/syscalls/space.ts @@ -1,5 +1,5 @@ -import { AttachmentMeta, FileMeta, PageMeta } from "../../plug-api/types.ts"; -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { AttachmentMeta, FileMeta, PageMeta } from "../../plug-api/types.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import type { Space } from "../../common/space.ts"; /** diff --git a/type/settings.ts b/type/settings.ts index 6b9df0de..89f1e91f 100644 --- a/type/settings.ts +++ b/type/settings.ts @@ -1,5 +1,5 @@ -import { ActionButton, EmojiConfig, Shortcut } from "$lib/web.ts"; -import { Manifest } from "$lib/manifest.ts"; +import type { ActionButton, EmojiConfig, Shortcut } from "$lib/web.ts"; +import type { Manifest } from "$lib/manifest.ts"; export type ObjectDecorator = { // The expression to match against the object diff --git a/type/web.ts b/type/web.ts index 4e72bc37..713c1536 100644 --- a/type/web.ts +++ b/type/web.ts @@ -1,8 +1,8 @@ -import { AppCommand } from "../lib/command.ts"; +import type { AppCommand } from "../lib/command.ts"; import { defaultSettings } from "$common/settings.ts"; -import { FilterOption, Notification, PanelMode } from "$lib/web.ts"; -import { BuiltinSettings } from "$type/settings.ts"; -import { PageMeta } from "$sb/types.ts"; +import type { FilterOption, Notification, PanelMode } from "$lib/web.ts"; +import type { BuiltinSettings } from "$type/settings.ts"; +import type { PageMeta } from "$sb/types.ts"; export type PanelConfig = { mode?: PanelMode; diff --git a/web/client.ts b/web/client.ts index ce43178a..d9558190 100644 --- a/web/client.ts +++ b/web/client.ts @@ -1,38 +1,38 @@ -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; +import type { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; import type { Compartment } from "@codemirror/state"; import { EditorView } from "@codemirror/view"; import { syntaxTree } from "@codemirror/language"; import { compile as gitIgnoreCompiler } from "gitignore-parser"; -import { SyntaxNode } from "@lezer/common"; +import type { SyntaxNode } from "@lezer/common"; import { Space } from "../common/space.ts"; -import { FilterOption } from "$lib/web.ts"; +import type { FilterOption } from "$lib/web.ts"; import { EventHook } from "../common/hooks/event.ts"; -import { AppCommand } from "$lib/command.ts"; +import type { AppCommand } from "$lib/command.ts"; import { - PageState, + type PageState, parsePageRefFromURI, PathPageNavigator, } from "./navigator.ts"; -import { AppViewState } from "../type/web.ts"; +import type { AppViewState } from "../type/web.ts"; import type { AppEvent, CompleteEvent, SlashCompletions, } from "../plug-api/types.ts"; -import { StyleObject } from "../plugs/index/style.ts"; +import type { StyleObject } from "../plugs/index/style.ts"; import { throttle } from "$lib/async.ts"; import { PlugSpacePrimitives } from "$common/spaces/plug_space_primitives.ts"; import { EventedSpacePrimitives } from "$common/spaces/evented_space_primitives.ts"; import { - ISyncService, + type ISyncService, NoSyncSyncService, pageSyncInterval, SyncService, } from "./sync_service.ts"; import { simpleHash } from "$lib/crypto.ts"; -import { SyncStatus } from "$common/spaces/sync.ts"; +import type { SyncStatus } from "$common/spaces/sync.ts"; import { HttpSpacePrimitives } from "$common/spaces/http_space_primitives.ts"; import { FallbackSpacePrimitives } from "$common/spaces/fallback_space_primitives.ts"; import { FilteredSpacePrimitives } from "$common/spaces/filtered_space_primitives.ts"; @@ -41,8 +41,8 @@ import { ClientSystem } from "./client_system.ts"; import { createEditorState } from "./editor_state.ts"; import { MainUI } from "./editor_ui.tsx"; import { cleanPageRef } from "$sb/lib/resolve.ts"; -import { SpacePrimitives } from "$common/spaces/space_primitives.ts"; -import { CodeWidgetButton, FileMeta, PageMeta } from "../plug-api/types.ts"; +import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; +import type { CodeWidgetButton, FileMeta, PageMeta } from "../plug-api/types.ts"; import { DataStore } from "$lib/data/datastore.ts"; import { IndexedDBKvPrimitives } from "$lib/data/indexeddb_kv_primitives.ts"; import { DataStoreMQ } from "$lib/data/mq.datastore.ts"; @@ -50,9 +50,9 @@ import { DataStoreSpacePrimitives } from "$common/spaces/datastore_space_primiti import { ensureSpaceIndex } from "$common/space_index.ts"; import { renderTheTemplate } from "$common/syscalls/template.ts"; -import { PageRef } from "../plug-api/lib/page_ref.ts"; +import type { PageRef } from "../plug-api/lib/page_ref.ts"; import { ReadOnlySpacePrimitives } from "$common/spaces/ro_space_primitives.ts"; -import { KvPrimitives } from "$lib/data/kv_primitives.ts"; +import type { KvPrimitives } from "$lib/data/kv_primitives.ts"; import { builtinFunctions } from "$lib/builtin_query_functions.ts"; import { ensureAndLoadSettingsAndIndex, @@ -63,7 +63,7 @@ import { plugPrefix } from "$common/spaces/constants.ts"; import { lezerToParseTree } from "$common/markdown_parser/parse_tree.ts"; import { findNodeMatching } from "$sb/lib/tree.ts"; import type { LinkObject } from "../plugs/index/page_links.ts"; -import { BuiltinSettings } from "$type/settings.ts"; +import type { BuiltinSettings } from "$type/settings.ts"; const frontMatterRegex = /^---\n(([^\n]|\n)*?)---\n/; diff --git a/web/client_system.ts b/web/client_system.ts index 4ef6c068..a52445ae 100644 --- a/web/client_system.ts +++ b/web/client_system.ts @@ -1,7 +1,7 @@ import { PlugNamespaceHook } from "$common/hooks/plug_namespace.ts"; -import { SilverBulletHooks } from "../lib/manifest.ts"; +import type { SilverBulletHooks } from "../lib/manifest.ts"; import { CronHook } from "../lib/plugos/hooks/cron.ts"; -import { EventHook } from "../common/hooks/event.ts"; +import type { EventHook } from "../common/hooks/event.ts"; import { createSandbox } from "../lib/plugos/sandboxes/web_worker_sandbox.ts"; import assetSyscalls from "../lib/plugos/syscalls/asset.ts"; @@ -21,7 +21,7 @@ import { spaceReadSyscalls, spaceWriteSyscalls } from "./syscalls/space.ts"; import { syncSyscalls } from "./syscalls/sync.ts"; import { systemSyscalls } from "$common/syscalls/system.ts"; import { yamlSyscalls } from "$common/syscalls/yaml.ts"; -import { Space } from "../common/space.ts"; +import type { Space } from "../common/space.ts"; import { MQHook } from "../lib/plugos/hooks/mq.ts"; import { mqSyscalls } from "../lib/plugos/syscalls/mq.ts"; import { mqProxySyscalls } from "./syscalls/mq.proxy.ts"; @@ -30,18 +30,18 @@ import { dataStoreReadSyscalls, dataStoreWriteSyscalls, } from "../lib/plugos/syscalls/datastore.ts"; -import { DataStore } from "$lib/data/datastore.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; import { languageSyscalls } from "$common/syscalls/language.ts"; import { templateSyscalls } from "$common/syscalls/template.ts"; import { codeWidgetSyscalls } from "./syscalls/code_widget.ts"; import { clientCodeWidgetSyscalls } from "./syscalls/client_code_widget.ts"; import { KVPrimitivesManifestCache } from "$lib/plugos/manifest_cache.ts"; import { deepObjectMerge } from "../plug-api/lib/json.ts"; -import { Query } from "../plug-api/types.ts"; +import type { Query } from "../plug-api/types.ts"; import { PanelWidgetHook } from "./hooks/panel_widget.ts"; import { createKeyBindings } from "./editor_state.ts"; import { CommonSystem } from "$common/common_system.ts"; -import { DataStoreMQ } from "$lib/data/mq.datastore.ts"; +import type { DataStoreMQ } from "$lib/data/mq.datastore.ts"; import { plugPrefix } from "$common/spaces/constants.ts"; const plugNameExtractRegex = /\/(.+)\.plug\.js$/; diff --git a/web/cm_plugins/admonition.ts b/web/cm_plugins/admonition.ts index 0d81e065..48f67e33 100644 --- a/web/cm_plugins/admonition.ts +++ b/web/cm_plugins/admonition.ts @@ -1,7 +1,7 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; -import { SyntaxNodeRef } from "@lezer/common"; +import type { SyntaxNodeRef } from "@lezer/common"; import { decoratorStateField, isCursorInRange } from "./util.ts"; const ADMONITION_REGEX = diff --git a/web/cm_plugins/block.ts b/web/cm_plugins/block.ts index a17167d0..d1503351 100644 --- a/web/cm_plugins/block.ts +++ b/web/cm_plugins/block.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { diff --git a/web/cm_plugins/block_quote.ts b/web/cm_plugins/block_quote.ts index cedf927b..64c72cbc 100644 --- a/web/cm_plugins/block_quote.ts +++ b/web/cm_plugins/block_quote.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { diff --git a/web/cm_plugins/code_copy.ts b/web/cm_plugins/code_copy.ts index 60db661c..2f1a5333 100644 --- a/web/cm_plugins/code_copy.ts +++ b/web/cm_plugins/code_copy.ts @@ -1,12 +1,12 @@ -import { Client } from "../client.ts"; -import { Range } from "@codemirror/state"; +import type { Client } from "../client.ts"; +import type { Range } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration, - DecorationSet, - EditorView, + type DecorationSet, + type EditorView, ViewPlugin, - ViewUpdate, + type ViewUpdate, WidgetType, } from "@codemirror/view"; diff --git a/web/cm_plugins/command_link.ts b/web/cm_plugins/command_link.ts index b0b87737..d2537f93 100644 --- a/web/cm_plugins/command_link.ts +++ b/web/cm_plugins/command_link.ts @@ -1,7 +1,7 @@ -import { ClickEvent } from "../../plug-api/types.ts"; +import type { ClickEvent } from "../../plug-api/types.ts"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; import { ButtonWidget, decoratorStateField, diff --git a/web/cm_plugins/editor_paste.ts b/web/cm_plugins/editor_paste.ts index 4aae988c..94750c6a 100644 --- a/web/cm_plugins/editor_paste.ts +++ b/web/cm_plugins/editor_paste.ts @@ -1,7 +1,7 @@ import { syntaxTree } from "@codemirror/language"; -import { EditorView, ViewPlugin, ViewUpdate } from "@codemirror/view"; -import { Client } from "../client.ts"; -import { UploadFile } from "$sb/types.ts"; +import { EditorView, ViewPlugin, type ViewUpdate } from "@codemirror/view"; +import type { Client } from "../client.ts"; +import type { UploadFile } from "$sb/types.ts"; // We use turndown to convert HTML to Markdown import TurndownService from "turndown"; diff --git a/web/cm_plugins/escapes.ts b/web/cm_plugins/escapes.ts index 30b8edcd..cbdc3fa3 100644 --- a/web/cm_plugins/escapes.ts +++ b/web/cm_plugins/escapes.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { diff --git a/web/cm_plugins/fenced_code.ts b/web/cm_plugins/fenced_code.ts index d95ffd15..3891c73b 100644 --- a/web/cm_plugins/fenced_code.ts +++ b/web/cm_plugins/fenced_code.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import type { Client } from "../client.ts"; diff --git a/web/cm_plugins/frontmatter.ts b/web/cm_plugins/frontmatter.ts index b728a703..701c9782 100644 --- a/web/cm_plugins/frontmatter.ts +++ b/web/cm_plugins/frontmatter.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { foldedRanges, syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { decoratorStateField, HtmlWidget, isCursorInRange } from "./util.ts"; diff --git a/web/cm_plugins/hide_mark.ts b/web/cm_plugins/hide_mark.ts index 20f27bf2..0cceb714 100644 --- a/web/cm_plugins/hide_mark.ts +++ b/web/cm_plugins/hide_mark.ts @@ -2,7 +2,7 @@ // Original author: Pranav Karawale // License: Apache License 2.0. -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { diff --git a/web/cm_plugins/iframe_widget.ts b/web/cm_plugins/iframe_widget.ts index 25762588..c0c0052c 100644 --- a/web/cm_plugins/iframe_widget.ts +++ b/web/cm_plugins/iframe_widget.ts @@ -1,4 +1,4 @@ -import { CodeWidgetCallback, WidgetContent } from "../../plug-api/types.ts"; +import type { CodeWidgetCallback, WidgetContent } from "../../plug-api/types.ts"; import { WidgetType } from "@codemirror/view"; import type { Client } from "../client.ts"; import { createWidgetSandboxIFrame } from "../components/widget_sandbox_iframe.ts"; diff --git a/web/cm_plugins/inline_content.ts b/web/cm_plugins/inline_content.ts index 153eaf8d..6a714944 100644 --- a/web/cm_plugins/inline_content.ts +++ b/web/cm_plugins/inline_content.ts @@ -1,4 +1,4 @@ -import { EditorState, Range } from "@codemirror/state"; +import type { EditorState, Range } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration, WidgetType } from "@codemirror/view"; import { MarkdownWidget } from "./markdown_widget.ts"; diff --git a/web/cm_plugins/line_wrapper.ts b/web/cm_plugins/line_wrapper.ts index e99851ad..e91ed242 100644 --- a/web/cm_plugins/line_wrapper.ts +++ b/web/cm_plugins/line_wrapper.ts @@ -1,4 +1,4 @@ -import { EditorState, Range } from "@codemirror/state"; +import type { EditorState, Range } from "@codemirror/state"; import { Decoration } from "@codemirror/view"; import { syntaxTree } from "@codemirror/language"; import { decoratorStateField } from "./util.ts"; diff --git a/web/cm_plugins/link.ts b/web/cm_plugins/link.ts index 3a4367c4..20c73259 100644 --- a/web/cm_plugins/link.ts +++ b/web/cm_plugins/link.ts @@ -1,5 +1,5 @@ import { isLocalPath, resolvePath } from "$sb/lib/resolve.ts"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; import { diff --git a/web/cm_plugins/lint.ts b/web/cm_plugins/lint.ts index 856203d8..b0e12626 100644 --- a/web/cm_plugins/lint.ts +++ b/web/cm_plugins/lint.ts @@ -1,7 +1,7 @@ -import { Diagnostic, linter } from "@codemirror/lint"; +import { type Diagnostic, linter } from "@codemirror/lint"; import type { Client } from "../client.ts"; import { parse } from "$common/markdown_parser/parse_tree.ts"; -import { LintEvent } from "../../plug-api/types.ts"; +import type { LintEvent } from "../../plug-api/types.ts"; import { extendedMarkdownLanguage } from "$common/markdown_parser/parser.ts"; export function plugLinter(client: Client) { diff --git a/web/cm_plugins/smart_quotes.ts b/web/cm_plugins/smart_quotes.ts index ec97fc07..2aa18164 100644 --- a/web/cm_plugins/smart_quotes.ts +++ b/web/cm_plugins/smart_quotes.ts @@ -1,7 +1,7 @@ -import { KeyBinding } from "@codemirror/view"; +import type { KeyBinding } from "@codemirror/view"; import { syntaxTree } from "@codemirror/language"; import { EditorSelection } from "@codemirror/state"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; const straightQuoteContexts = [ "CommentBlock", diff --git a/web/cm_plugins/table.ts b/web/cm_plugins/table.ts index 163edcb5..a46152bd 100644 --- a/web/cm_plugins/table.ts +++ b/web/cm_plugins/table.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { syntaxTree } from "@codemirror/language"; import { Decoration, WidgetType } from "@codemirror/view"; import { @@ -8,7 +8,7 @@ import { } from "./util.ts"; import { renderMarkdownToHtml } from "../../plugs/markdown/markdown_render.ts"; -import { ParseTree, renderToText } from "../../plug-api/lib/tree.ts"; +import { type ParseTree, renderToText } from "../../plug-api/lib/tree.ts"; import { lezerToParseTree } from "$common/markdown_parser/parse_tree.ts"; import type { Client } from "../client.ts"; import { isLocalPath, resolvePath } from "$sb/lib/resolve.ts"; diff --git a/web/cm_plugins/task.ts b/web/cm_plugins/task.ts index 345afb25..9609e833 100644 --- a/web/cm_plugins/task.ts +++ b/web/cm_plugins/task.ts @@ -1,6 +1,6 @@ import { syntaxTree } from "@codemirror/language"; import { Decoration, WidgetType } from "@codemirror/view"; -import { NodeType } from "@lezer/common"; +import type { NodeType } from "@lezer/common"; import { decoratorStateField, isCursorInRange } from "./util.ts"; /** diff --git a/web/cm_plugins/top_bottom_panels.ts b/web/cm_plugins/top_bottom_panels.ts index 52dcd185..dfde5e70 100644 --- a/web/cm_plugins/top_bottom_panels.ts +++ b/web/cm_plugins/top_bottom_panels.ts @@ -1,4 +1,4 @@ -import { EditorState } from "@codemirror/state"; +import type { EditorState } from "@codemirror/state"; import { Decoration } from "@codemirror/view"; import type { Client } from "../client.ts"; import { decoratorStateField } from "./util.ts"; diff --git a/web/cm_plugins/util.ts b/web/cm_plugins/util.ts index 007e1c4c..012376a5 100644 --- a/web/cm_plugins/util.ts +++ b/web/cm_plugins/util.ts @@ -1,8 +1,8 @@ // Forked from https://codeberg.org/retronav/ixora // Original author: Pranav Karawale // License: Apache License 2.0. -import { EditorState, StateField, Transaction } from "@codemirror/state"; -import { DecorationSet } from "@codemirror/view"; +import { type EditorState, StateField, type Transaction } from "@codemirror/state"; +import type { DecorationSet } from "@codemirror/view"; import { Decoration, EditorView, WidgetType } from "@codemirror/view"; type LinkOptions = { text: string; diff --git a/web/cm_plugins/wiki_link.ts b/web/cm_plugins/wiki_link.ts index 15506172..f457ae45 100644 --- a/web/cm_plugins/wiki_link.ts +++ b/web/cm_plugins/wiki_link.ts @@ -1,7 +1,7 @@ -import { ClickEvent } from "$sb/types.ts"; +import type { ClickEvent } from "$sb/types.ts"; import { syntaxTree } from "@codemirror/language"; import { Decoration } from "@codemirror/view"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; import { decoratorStateField, isCursorInRange, LinkWidget } from "./util.ts"; import { resolvePath } from "$sb/lib/resolve.ts"; import { encodePageRef, parsePageRef } from "$sb/lib/page_ref.ts"; diff --git a/web/commands.ts b/web/commands.ts index 7184b3ea..8a714641 100644 --- a/web/commands.ts +++ b/web/commands.ts @@ -1,4 +1,4 @@ -import { EditorSelection, StateCommand, Transaction } from "@codemirror/state"; +import { EditorSelection, type StateCommand, Transaction } from "@codemirror/state"; import { Text } from "@codemirror/state"; export function insertMarker(marker: string): StateCommand { diff --git a/web/components/basic_modals.tsx b/web/components/basic_modals.tsx index 211c7857..d79cd50f 100644 --- a/web/components/basic_modals.tsx +++ b/web/components/basic_modals.tsx @@ -1,7 +1,10 @@ -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; +import type { + CompletionContext, + CompletionResult, +} from "@codemirror/autocomplete"; import { useEffect, useRef, useState } from "preact/hooks"; import { MiniEditor } from "./mini_editor.tsx"; -import { ComponentChildren, Ref } from "preact"; +import type { ComponentChildren, Ref } from "preact"; export function Prompt({ message, diff --git a/web/components/command_palette.tsx b/web/components/command_palette.tsx index 1e40a256..09db6f92 100644 --- a/web/components/command_palette.tsx +++ b/web/components/command_palette.tsx @@ -1,10 +1,10 @@ import { FilterList } from "./filter.tsx"; -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; +import type { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; import { Terminal } from "preact-feather"; -import { AppCommand } from "../../lib/command.ts"; -import { FilterOption } from "$lib/web.ts"; +import type { AppCommand } from "../../lib/command.ts"; +import type { FilterOption } from "$lib/web.ts"; import { parseCommand } from "$common/command.ts"; -import { BuiltinSettings } from "$type/settings.ts"; +import type { BuiltinSettings } from "$type/settings.ts"; export function CommandPalette({ commands, diff --git a/web/components/filter.tsx b/web/components/filter.tsx index 5a9261e8..f70b5ebc 100644 --- a/web/components/filter.tsx +++ b/web/components/filter.tsx @@ -1,8 +1,11 @@ -import { FeatherProps } from "preact-feather/types"; -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; -import { FunctionalComponent } from "preact"; +import type { FeatherProps } from "preact-feather/types"; +import type { + CompletionContext, + CompletionResult, +} from "@codemirror/autocomplete"; +import type { FunctionalComponent } from "preact"; import { useEffect, useRef, useState } from "preact/hooks"; -import { FilterOption } from "$lib/web.ts"; +import type { FilterOption } from "$lib/web.ts"; import { MiniEditor } from "./mini_editor.tsx"; import { fuzzySearchAndSort } from "../fuse_search.ts"; import { deepEqual } from "../../plug-api/lib/json.ts"; diff --git a/web/components/mini_editor.tsx b/web/components/mini_editor.tsx index 6ae8996f..5d0a7991 100644 --- a/web/components/mini_editor.tsx +++ b/web/components/mini_editor.tsx @@ -3,9 +3,9 @@ import { history, historyKeymap, standardKeymap } from "@codemirror/commands"; import { autocompletion, closeBracketsKeymap, - CompletionContext, + type CompletionContext, completionKeymap, - CompletionResult, + type CompletionResult, } from "@codemirror/autocomplete"; import { EditorState } from "@codemirror/state"; import { @@ -14,7 +14,7 @@ import { keymap, placeholder, ViewPlugin, - ViewUpdate, + type ViewUpdate, } from "@codemirror/view"; import { getCM as vimGetCm, Vim, vim } from "@replit/codemirror-vim"; import { createCommandKeyBindings } from "../editor_state.ts"; diff --git a/web/components/page_navigator.tsx b/web/components/page_navigator.tsx index 33080b3a..3a5a3c20 100644 --- a/web/components/page_navigator.tsx +++ b/web/components/page_navigator.tsx @@ -1,7 +1,7 @@ import { FilterList } from "./filter.tsx"; -import { FilterOption } from "$lib/web.ts"; -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; -import { PageMeta } from "../../plug-api/types.ts"; +import type { FilterOption } from "$lib/web.ts"; +import type { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; +import type { PageMeta } from "../../plug-api/types.ts"; import { tagRegex as mdTagRegex } from "$common/markdown_parser/parser.ts"; const tagRegex = new RegExp(mdTagRegex.source, "g"); diff --git a/web/components/panel.tsx b/web/components/panel.tsx index 3f25fce3..c1a3dfd8 100644 --- a/web/components/panel.tsx +++ b/web/components/panel.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef } from "preact/hooks"; -import { Client } from "../client.ts"; -import { PanelConfig } from "../../type/web.ts"; +import type { Client } from "../client.ts"; +import type { PanelConfig } from "../../type/web.ts"; import { panelHtml } from "./panel_html.ts"; export function Panel({ diff --git a/web/components/top_bar.tsx b/web/components/top_bar.tsx index 233029f4..d082ec0d 100644 --- a/web/components/top_bar.tsx +++ b/web/components/top_bar.tsx @@ -1,8 +1,11 @@ -import { CompletionContext, CompletionResult } from "@codemirror/autocomplete"; +import type { + CompletionContext, + CompletionResult, +} from "@codemirror/autocomplete"; import type { ComponentChildren, FunctionalComponent } from "preact"; -import { Notification } from "$lib/web.ts"; -import { FeatherProps } from "preact-feather/types"; -import { IconBaseProps } from "react-icons/types"; +import type { Notification } from "$lib/web.ts"; +import type { FeatherProps } from "preact-feather/types"; +import type { IconBaseProps } from "react-icons/types"; import { MiniEditor } from "./mini_editor.tsx"; export type ActionButton = { diff --git a/web/components/widget_sandbox_iframe.ts b/web/components/widget_sandbox_iframe.ts index 1628affb..46d7d942 100644 --- a/web/components/widget_sandbox_iframe.ts +++ b/web/components/widget_sandbox_iframe.ts @@ -1,5 +1,5 @@ -import { WidgetContent } from "../../plug-api/types.ts"; -import { Client } from "../client.ts"; +import type { WidgetContent } from "../../plug-api/types.ts"; +import type { Client } from "../client.ts"; import { panelHtml } from "./panel_html.ts"; /** diff --git a/web/editor_state.ts b/web/editor_state.ts index 357fb49d..722a0ad6 100644 --- a/web/editor_state.ts +++ b/web/editor_state.ts @@ -19,28 +19,28 @@ import { dropCursor, EditorView, highlightSpecialChars, - KeyBinding, + type KeyBinding, keymap, ViewPlugin, - ViewUpdate, + type ViewUpdate, } from "@codemirror/view"; import { vim } from "@replit/codemirror-vim"; import { markdown } from "@codemirror/lang-markdown"; -import { Client } from "./client.ts"; +import type { Client } from "./client.ts"; import { inlineImagesPlugin } from "./cm_plugins/inline_content.ts"; import { cleanModePlugins } from "./cm_plugins/clean.ts"; import { lineWrapper } from "./cm_plugins/line_wrapper.ts"; import { createSmartQuoteKeyBindings } from "./cm_plugins/smart_quotes.ts"; -import { ClickEvent } from "../plug-api/types.ts"; +import type { ClickEvent } from "../plug-api/types.ts"; import { attachmentExtension, pasteLinkExtension, } from "./cm_plugins/editor_paste.ts"; -import { TextChange } from "./change.ts"; +import type { TextChange } from "./change.ts"; import { postScriptPrefacePlugin } from "./cm_plugins/top_bottom_panels.ts"; import { languageFor } from "$common/languages.ts"; import { plugLinter } from "./cm_plugins/lint.ts"; -import { Compartment, Extension } from "@codemirror/state"; +import { Compartment, type Extension } from "@codemirror/state"; import { extendedMarkdownLanguage } from "$common/markdown_parser/parser.ts"; import { parseCommand } from "$common/command.ts"; import { safeRun } from "$lib/async.ts"; diff --git a/web/editor_ui.tsx b/web/editor_ui.tsx index ef994026..ce65aec1 100644 --- a/web/editor_ui.tsx +++ b/web/editor_ui.tsx @@ -4,7 +4,11 @@ import { FilterList } from "./components/filter.tsx"; import { PageNavigator } from "./components/page_navigator.tsx"; import { TopBar } from "./components/top_bar.tsx"; import reducer from "./reducer.ts"; -import { Action, AppViewState, initialViewState } from "../type/web.ts"; +import { + type Action, + type AppViewState, + initialViewState, +} from "../type/web.ts"; import * as featherIcons from "preact-feather"; import * as mdi from "./filtered_material_icons.ts"; import { h, render as preactRender } from "preact"; diff --git a/web/fuse_search.test.ts b/web/fuse_search.test.ts index a8056cf1..905d079f 100644 --- a/web/fuse_search.test.ts +++ b/web/fuse_search.test.ts @@ -1,4 +1,4 @@ -import { FilterOption } from "$lib/web.ts"; +import type { FilterOption } from "$lib/web.ts"; import { assertEquals } from "@std/assert"; import { fuzzySearchAndSort } from "./fuse_search.ts"; diff --git a/web/fuse_search.ts b/web/fuse_search.ts index 7003a51f..d864c653 100644 --- a/web/fuse_search.ts +++ b/web/fuse_search.ts @@ -1,6 +1,6 @@ // @deno-types="https://deno.land/x/fuse@v6.4.1/dist/fuse.d.ts" import Fuse from "fuse"; -import { FilterOption } from "$lib/web.ts"; +import type { FilterOption } from "$lib/web.ts"; type FuseOption = FilterOption & { baseName: string; diff --git a/web/hooks/code_widget.ts b/web/hooks/code_widget.ts index fedf5fc7..7608c697 100644 --- a/web/hooks/code_widget.ts +++ b/web/hooks/code_widget.ts @@ -1,7 +1,7 @@ -import { Hook, Manifest } from "../../lib/plugos/types.ts"; -import { System } from "../../lib/plugos/system.ts"; -import { CodeWidgetCallback } from "../../plug-api/types.ts"; -import { CodeWidgetT } from "$lib/manifest.ts"; +import type { Hook, Manifest } from "../../lib/plugos/types.ts"; +import type { System } from "../../lib/plugos/system.ts"; +import type { CodeWidgetCallback } from "../../plug-api/types.ts"; +import type { CodeWidgetT } from "$lib/manifest.ts"; export class CodeWidgetHook implements Hook { codeWidgetCallbacks = new Map(); diff --git a/web/hooks/panel_widget.ts b/web/hooks/panel_widget.ts index f99ece0b..89a5fc67 100644 --- a/web/hooks/panel_widget.ts +++ b/web/hooks/panel_widget.ts @@ -1,7 +1,7 @@ -import { Hook, Manifest } from "../../lib/plugos/types.ts"; -import { System } from "../../lib/plugos/system.ts"; -import { CodeWidgetCallback } from "../../plug-api/types.ts"; -import { PanelWidgetT } from "$lib/manifest.ts"; +import type { Hook, Manifest } from "../../lib/plugos/types.ts"; +import type { System } from "../../lib/plugos/system.ts"; +import type { CodeWidgetCallback } from "../../plug-api/types.ts"; +import type { PanelWidgetT } from "$lib/manifest.ts"; export class PanelWidgetHook implements Hook { callbacks = new Map(); diff --git a/web/hooks/slash_command.ts b/web/hooks/slash_command.ts index 92575640..8ff900a8 100644 --- a/web/hooks/slash_command.ts +++ b/web/hooks/slash_command.ts @@ -1,18 +1,18 @@ -import { Hook, Manifest } from "$lib/plugos/types.ts"; -import { System } from "$lib/plugos/system.ts"; -import { +import type { Hook, Manifest } from "$lib/plugos/types.ts"; +import type { System } from "$lib/plugos/system.ts"; +import type { Completion, CompletionContext, CompletionResult, } from "@codemirror/autocomplete"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; import { syntaxTree } from "@codemirror/language"; -import { +import type { SlashCompletionOption, SlashCompletions, } from "../../plug-api/types.ts"; import { safeRun } from "$lib/async.ts"; -import { SlashCommandDef, SlashCommandHookT } from "$lib/manifest.ts"; +import type { SlashCommandDef, SlashCommandHookT } from "$lib/manifest.ts"; import { parseCommand } from "$common/command.ts"; export type AppSlashCommand = { diff --git a/web/navigator.ts b/web/navigator.ts index 5131b1ec..3dcbbfa8 100644 --- a/web/navigator.ts +++ b/web/navigator.ts @@ -1,5 +1,5 @@ -import { PageRef, parsePageRef } from "../plug-api/lib/page_ref.ts"; -import { Client } from "./client.ts"; +import { type PageRef, parsePageRef } from "../plug-api/lib/page_ref.ts"; +import type { Client } from "./client.ts"; import { cleanPageRef } from "$sb/lib/resolve.ts"; import { renderTheTemplate } from "$common/syscalls/template.ts"; import { safeRun } from "../lib/async.ts"; diff --git a/web/reducer.ts b/web/reducer.ts index 7aacfd1e..5c0f2b87 100644 --- a/web/reducer.ts +++ b/web/reducer.ts @@ -1,5 +1,5 @@ -import { PageMeta } from "../plug-api/types.ts"; -import { Action, AppViewState } from "../type/web.ts"; +import type { PageMeta } from "../plug-api/types.ts"; +import type { Action, AppViewState } from "../type/web.ts"; export default function reducer( state: AppViewState, diff --git a/web/sync_service.ts b/web/sync_service.ts index e5486d6a..87d91491 100644 --- a/web/sync_service.ts +++ b/web/sync_service.ts @@ -1,10 +1,10 @@ import { plugPrefix } from "$common/spaces/constants.ts"; import type { SpacePrimitives } from "$common/spaces/space_primitives.ts"; -import { SpaceSync, SyncStatus, SyncStatusItem } from "$common/spaces/sync.ts"; +import { SpaceSync, type SyncStatus, type SyncStatusItem } from "$common/spaces/sync.ts"; import { sleep } from "$lib/async.ts"; -import { EventHook } from "../common/hooks/event.ts"; -import { DataStore } from "$lib/data/datastore.ts"; -import { Space } from "../common/space.ts"; +import type { EventHook } from "../common/hooks/event.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; +import type { Space } from "../common/space.ts"; // Keeps the current sync snapshot const syncSnapshotKey = ["sync", "snapshot"]; diff --git a/web/syscalls/clientStore.ts b/web/syscalls/clientStore.ts index 52f11a3e..07d8a344 100644 --- a/web/syscalls/clientStore.ts +++ b/web/syscalls/clientStore.ts @@ -1,6 +1,6 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; -import { DataStore } from "$lib/data/datastore.ts"; -import { KvKey } from "../../plug-api/types.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { DataStore } from "$lib/data/datastore.ts"; +import type { KvKey } from "../../plug-api/types.ts"; export function clientStoreSyscalls( ds: DataStore, diff --git a/web/syscalls/client_code_widget.ts b/web/syscalls/client_code_widget.ts index 578e56de..fd3e42d3 100644 --- a/web/syscalls/client_code_widget.ts +++ b/web/syscalls/client_code_widget.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import { reloadAllMarkdownWidgets } from "../cm_plugins/markdown_widget.ts"; import { broadcastReload } from "../components/widget_sandbox_iframe.ts"; diff --git a/web/syscalls/code_widget.ts b/web/syscalls/code_widget.ts index d7d3de5d..ca5af768 100644 --- a/web/syscalls/code_widget.ts +++ b/web/syscalls/code_widget.ts @@ -1,6 +1,6 @@ -import { CodeWidgetContent } from "../../plug-api/types.ts"; -import { SysCallMapping } from "../../lib/plugos/system.ts"; -import { CodeWidgetHook } from "../hooks/code_widget.ts"; +import type { CodeWidgetContent } from "../../plug-api/types.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { CodeWidgetHook } from "../hooks/code_widget.ts"; export function codeWidgetSyscalls( codeWidgetHook: CodeWidgetHook, diff --git a/web/syscalls/debug.ts b/web/syscalls/debug.ts index 6e525ae4..3df09fce 100644 --- a/web/syscalls/debug.ts +++ b/web/syscalls/debug.ts @@ -1,6 +1,6 @@ -import { KvKey } from "../../plug-api/types.ts"; +import type { KvKey } from "../../plug-api/types.ts"; import type { SysCallMapping } from "../../lib/plugos/system.ts"; -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; export function debugSyscalls(client: Client): SysCallMapping { return { diff --git a/web/syscalls/editor.ts b/web/syscalls/editor.ts index b122fb4b..f16e4b51 100644 --- a/web/syscalls/editor.ts +++ b/web/syscalls/editor.ts @@ -1,4 +1,4 @@ -import { Client } from "../client.ts"; +import type { Client } from "../client.ts"; import { foldAll, foldCode, @@ -7,13 +7,13 @@ import { unfoldCode, } from "@codemirror/language"; import { deleteLine, redo, undo } from "@codemirror/commands"; -import { Transaction } from "@codemirror/state"; +import type { Transaction } from "@codemirror/state"; import { EditorView } from "@codemirror/view"; import { getCM as vimGetCm, Vim } from "@replit/codemirror-vim"; -import { SysCallMapping } from "$lib/plugos/system.ts"; +import type { SysCallMapping } from "$lib/plugos/system.ts"; import type { FilterOption } from "$lib/web.ts"; -import { UploadFile } from "../../plug-api/types.ts"; -import { PageRef } from "$sb/lib/page_ref.ts"; +import type { UploadFile } from "../../plug-api/types.ts"; +import type { PageRef } from "$sb/lib/page_ref.ts"; import { openSearchPanel } from "@codemirror/search"; import { diffAndPrepareChanges } from "../cm_util.ts"; diff --git a/web/syscalls/fetch.ts b/web/syscalls/fetch.ts index b51f69df..13ed2a04 100644 --- a/web/syscalls/fetch.ts +++ b/web/syscalls/fetch.ts @@ -1,8 +1,8 @@ import type { SysCallMapping } from "$lib/plugos/system.ts"; import { performLocalFetch, - ProxyFetchRequest, - ProxyFetchResponse, + type ProxyFetchRequest, + type ProxyFetchResponse, } from "../../lib/proxy_fetch.ts"; import type { Client } from "../client.ts"; import { base64Decode, base64Encode } from "$lib/crypto.ts"; diff --git a/web/syscalls/mq.proxy.ts b/web/syscalls/mq.proxy.ts index b81f66fb..31ebdcd7 100644 --- a/web/syscalls/mq.proxy.ts +++ b/web/syscalls/mq.proxy.ts @@ -1,5 +1,5 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; -import { Client } from "../client.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { Client } from "../client.ts"; import { proxySyscalls } from "./util.ts"; export function mqProxySyscalls(client: Client): SysCallMapping { diff --git a/web/syscalls/shell.ts b/web/syscalls/shell.ts index ca469b01..4e07671c 100644 --- a/web/syscalls/shell.ts +++ b/web/syscalls/shell.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import type { Client } from "../client.ts"; export function shellSyscalls( diff --git a/web/syscalls/space.ts b/web/syscalls/space.ts index 16fa4ad0..e8531d5b 100644 --- a/web/syscalls/space.ts +++ b/web/syscalls/space.ts @@ -1,6 +1,6 @@ -import { Client } from "../client.ts"; -import { SysCallMapping } from "../../lib/plugos/system.ts"; -import { AttachmentMeta, FileMeta, PageMeta } from "../../plug-api/types.ts"; +import type { Client } from "../client.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { AttachmentMeta, FileMeta, PageMeta } from "../../plug-api/types.ts"; export function spaceReadSyscalls(editor: Client): SysCallMapping { return { diff --git a/web/syscalls/sync.ts b/web/syscalls/sync.ts index 41be99bb..e7f02a75 100644 --- a/web/syscalls/sync.ts +++ b/web/syscalls/sync.ts @@ -1,4 +1,4 @@ -import { SysCallMapping } from "../../lib/plugos/system.ts"; +import type { SysCallMapping } from "../../lib/plugos/system.ts"; import type { Client } from "../client.ts"; export function syncSyscalls(editor: Client): SysCallMapping { diff --git a/web/syscalls/util.ts b/web/syscalls/util.ts index 410fbf6a..2b2a8531 100644 --- a/web/syscalls/util.ts +++ b/web/syscalls/util.ts @@ -1,6 +1,6 @@ -import { HttpSpacePrimitives } from "$common/spaces/http_space_primitives.ts"; -import { SyscallContext, SysCallMapping } from "../../lib/plugos/system.ts"; -import { Client } from "../client.ts"; +import type { HttpSpacePrimitives } from "$common/spaces/http_space_primitives.ts"; +import type { SyscallContext, SysCallMapping } from "../../lib/plugos/system.ts"; +import type { Client } from "../client.ts"; export function proxySyscalls(client: Client, names: string[]): SysCallMapping { const syscalls: SysCallMapping = {};