Monorepo with yarn workspaces requires yarn 3.2

This commit is contained in:
Zef Hemel
2022-04-21 14:16:40 +02:00
parent 68d110a081
commit 3a135d1a5c
13 changed files with 16 additions and 15 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { Editor } from "./editor";
import { safeRun } from "./util";
import { safeRun } from "../silverbullet-common/util";
import { Space } from "@silverbulletmd/common/spaces/space";
import { HttpSpacePrimitives } from "@silverbulletmd/common/spaces/http_space_primitives";
@@ -1,4 +1,4 @@
import { isMacLike } from "../util";
import { isMacLike } from "../../silverbullet-common/util";
import { FilterList } from "./filter";
import { faPersonRunning } from "@fortawesome/free-solid-svg-icons";
import { AppCommand } from "../hooks/command";
@@ -1,5 +1,5 @@
import { EditorView } from "@codemirror/view";
import * as util from "../util";
import * as util from "../../silverbullet-common/util";
export function StatusBar({ editorView }: { editorView?: EditorView }) {
let wordCount = 0,
+1 -1
View File
@@ -37,7 +37,7 @@ import { indexerSyscalls } from "./syscalls";
import { spaceSyscalls } from "./syscalls/space";
import { Action, AppViewState, initialViewState } from "./types";
import { SilverBulletHooks } from "@silverbulletmd/common/manifest";
import { safeRun, throttle } from "./util";
import { safeRun, throttle } from "../silverbullet-common/util";
import { System } from "../plugos/system";
import { EventHook } from "../plugos/hooks/event";
import { systemSyscalls } from "./syscalls/system";
@@ -2,7 +2,7 @@ import { Hook, Manifest } from "../../plugos/types";
import { System } from "../../plugos/system";
import { Completion, CompletionContext, CompletionResult } from "@codemirror/autocomplete";
import { slashCommandRegexp } from "../types";
import { safeRun } from "../util";
import { safeRun } from "../../silverbullet-common/util";
import { Editor } from "../editor";
export type SlashCommandDef = {
+1 -1
View File
@@ -1,4 +1,4 @@
import { safeRun } from "./util";
import { safeRun } from "../silverbullet-common/util";
function encodePageUrl(name: string): string {
return name.replaceAll(" ", "_");
-31
View File
@@ -1,31 +0,0 @@
export function countWords(str: string): number {
const matches = str.match(/[\w\d\'-]+/gi);
return matches ? matches.length : 0;
}
export function readingTime(wordCount: number): number {
// 225 is average word reading speed for adults
return Math.ceil(wordCount / 225);
}
export function safeRun(fn: () => Promise<void>) {
fn().catch((e) => {
console.error(e);
});
}
export function isMacLike() {
return /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
}
export function throttle(func: () => void, limit: number) {
let timer: any = null;
return function () {
if (!timer) {
timer = setTimeout(() => {
func();
timer = null;
}, limit);
}
};
}