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
+2 -2
View File
@@ -2,8 +2,8 @@ import * as plugos from "../plugos/types";
import { EndpointHookT } from "../plugos/hooks/endpoint";
import { CronHookT } from "../plugos/hooks/node_cron";
import { EventHookT } from "../plugos/hooks/event";
import { CommandHookT } from "../silverbullet-webapp/hooks/command";
import { SlashCommandHookT } from "../silverbullet-webapp/hooks/slash_command";
import { CommandHookT } from "@silverbulletmd/web/hooks/command";
import { SlashCommandHookT } from "@silverbulletmd/web/hooks/slash_command";
export type SilverBulletHooks = CommandHookT &
SlashCommandHookT &
+1 -1
View File
@@ -1,10 +1,10 @@
import { SpacePrimitives } from "./space_primitives";
import { safeRun } from "@silverbulletmd/web/util";
import { PageMeta } from "../types";
import { EventEmitter } from "../event";
import { Plug } from "../../plugos/plug";
import { Manifest } from "../manifest";
import { plugPrefix, trashPrefix } from "./constants";
import { safeRun } from "../util";
const pageWatchInterval = 2000;
+1 -1
View File
@@ -9,7 +9,7 @@ import {
renderToText,
replaceNodesMatching
} from "./tree";
import wikiMarkdownLang from "../silverbullet-webapp/parser";
import wikiMarkdownLang from "@silverbulletmd/web/parser";
const mdTest1 = `
# Heading
+31
View File
@@ -0,0 +1,31 @@
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);
}
};
}