1
0
This commit is contained in:
Zef Hemel 2022-08-01 18:27:50 +02:00
parent 538ae95dc4
commit b29b175b40
12 changed files with 35 additions and 29 deletions

View File

@ -65,5 +65,5 @@
"prettier": "^2.5.1",
"typescript": "^4.6.2"
},
"version": "0.0.28"
"version": "0.0.29"
}

32
package-lock.json generated
View File

@ -28,7 +28,7 @@
},
"mattermost-plugin/webapp": {
"name": "silverbullet-mattermost-plugin",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.0.1",
@ -9778,7 +9778,7 @@
},
"packages/common": {
"name": "@silverbulletmd/common",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.0.1",
@ -9802,7 +9802,7 @@
},
"packages/plugos": {
"name": "@plugos/plugos",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@jest/globals": "^27.5.1",
@ -9858,12 +9858,12 @@
},
"packages/plugos-silverbullet-syscall": {
"name": "@silverbulletmd/plugos-silverbullet-syscall",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT"
},
"packages/plugos-syscall": {
"name": "@plugos/plugos-syscall",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT"
},
"packages/plugos/node_modules/@lezer/common": {
@ -12303,13 +12303,13 @@
},
"packages/plugs": {
"name": "@silverbulletmd/plugs",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@jest/globals": "^27.5.1",
"@lezer/generator": "1.0.0",
"@lezer/lr": "1.0.0",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@types/yaml": "^1.9.7",
"handlebars": "^4.7.7",
"markdown-it": "^12.3.2",
@ -12341,7 +12341,7 @@
},
"packages/server": {
"name": "@silverbulletmd/server",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@codemirror/lang-javascript": "6.0.0",
@ -12349,9 +12349,9 @@
"@codemirror/legacy-modes": "6.0.0",
"@jest/globals": "^27.5.1",
"@lezer/markdown": "1.0.1",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/plugs": "^0.0.28",
"@silverbulletmd/web": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@silverbulletmd/plugs": "^0.0.29",
"@silverbulletmd/web": "^0.0.29",
"better-sqlite3": "^7.5.0",
"body-parser": "^1.19.2",
"buffer": "^6.0.3",
@ -13645,7 +13645,7 @@
},
"packages/web": {
"name": "@silverbulletmd/web",
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.0.1",
@ -18315,7 +18315,7 @@
"@jest/globals": "^27.5.1",
"@lezer/generator": "1.0.0",
"@lezer/lr": "1.0.0",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@types/markdown-it": "^12.2.3",
"@types/yaml": "^1.9.7",
"handlebars": "^4.7.7",
@ -18354,9 +18354,9 @@
"@parcel/transformer-sass": "2.5.0",
"@parcel/transformer-webmanifest": "2.5.0",
"@parcel/validator-typescript": "2.5.0",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/plugs": "^0.0.28",
"@silverbulletmd/web": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@silverbulletmd/plugs": "^0.0.29",
"@silverbulletmd/web": "^0.0.29",
"@types/cors": "^2.8.12",
"@types/events": "^3.0.0",
"@types/express": "^4.17.13",

View File

@ -4,7 +4,7 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.0.1",

View File

@ -4,6 +4,6 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT"
}

View File

@ -4,6 +4,6 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT"
}

View File

@ -4,7 +4,7 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"bin": {
"plugos-bundle": "./dist/plugos/plugos-bundle.js",

View File

@ -21,6 +21,7 @@ export async function editorInit() {
let spaceIndexed = await get("$spaceIndexed");
console.log("Space indexed", spaceIndexed);
if (!spaceIndexed) {
await set("$spaceIndexed", true);
await invokeFunction("client", "reindexSpaceCommand");
// Resetting this, because part of the reindex will be to wipe this too
await set("$silverBulletVersion", currentVersion);

View File

@ -2,6 +2,7 @@ import {
flashNotification,
getText,
} from "@silverbulletmd/plugos-silverbullet-syscall/editor";
import { listPages } from "@silverbulletmd/plugos-silverbullet-syscall/space";
function countWords(str: string): number {
const matches = str.match(/[\w\d\'-]+/gi);
@ -15,7 +16,10 @@ function readingTime(wordCount: number): number {
export async function statsCommand() {
const text = await getText();
const allPages = await listPages();
const wordCount = countWords(text);
const time = readingTime(wordCount);
await flashNotification(`${wordCount} words, ${time} minutes to read.`);
await flashNotification(
`${wordCount} words; ${time} minutes read; ${allPages.length} total pages in space.`
);
}

View File

@ -4,7 +4,7 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"scripts": {
"generate": "lezer-generator query/query.grammar -o query/parse-query.js",
@ -34,7 +34,7 @@
"@jest/globals": "^27.5.1",
"@lezer/generator": "1.0.0",
"@lezer/lr": "1.0.0",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@types/yaml": "^1.9.7",
"handlebars": "^4.7.7",
"markdown-it": "^12.3.2",

View File

@ -4,7 +4,7 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"bin": {
"silverbullet": "./dist/server/server.js"
@ -39,9 +39,9 @@
"@codemirror/legacy-modes": "6.0.0",
"@jest/globals": "^27.5.1",
"@lezer/markdown": "1.0.1",
"@silverbulletmd/common": "^0.0.28",
"@silverbulletmd/plugs": "^0.0.28",
"@silverbulletmd/web": "^0.0.28",
"@silverbulletmd/common": "^0.0.29",
"@silverbulletmd/plugs": "^0.0.29",
"@silverbulletmd/web": "^0.0.29",
"better-sqlite3": "^7.5.0",
"body-parser": "^1.19.2",
"buffer": "^6.0.3",

View File

@ -4,7 +4,7 @@
"name": "Zef Hemel",
"email": "zef@zef.me"
},
"version": "0.0.28",
"version": "0.0.29",
"license": "MIT",
"scripts": {
"watch": "rm -rf .parcel-cache && parcel watch",

View File

@ -12,3 +12,4 @@ An attempt at documenting of the changes/new features introduced in each (pre) r
4. The currently open page (at the bottom)
* Filter boxes (used for the page switching and command palette among other things) now also support PgUp, PgDown, Home and End and have some visual glitches fixed as well.
* Reverted exposing an empty `window` object to sandboxes running in workers and node.js (introduced in 0.0.28)
* Renamed Markdown-preview related commands to something more consistent