diff --git a/mattermost-plugin/webapp/package.json b/mattermost-plugin/webapp/package.json index 0ebf2e14..58a39461 100644 --- a/mattermost-plugin/webapp/package.json +++ b/mattermost-plugin/webapp/package.json @@ -65,5 +65,5 @@ "prettier": "^2.5.1", "typescript": "^4.6.2" }, - "version": "0.0.32" + "version": "0.0.33" } diff --git a/netlify.toml b/netlify.toml index b2c901c7..7f6c50ef 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,6 @@ [build] publish = "website_build" -command = "./scripts/build_website.sh" \ No newline at end of file +command = "./scripts/build_website.sh" + +[context.demo] + command = "./scripts/build_demo.sh" diff --git a/package-lock.json b/package-lock.json index b73059bb..be0bae33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ }, "mattermost-plugin/webapp": { "name": "silverbullet-mattermost-plugin", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.1", @@ -9784,7 +9784,7 @@ }, "packages/common": { "name": "@silverbulletmd/common", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.1", @@ -9813,7 +9813,7 @@ }, "packages/plugos": { "name": "@plugos/plugos", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@jest/globals": "^27.5.1", @@ -9869,12 +9869,12 @@ }, "packages/plugos-silverbullet-syscall": { "name": "@silverbulletmd/plugos-silverbullet-syscall", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT" }, "packages/plugos-syscall": { "name": "@plugos/plugos-syscall", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT" }, "packages/plugos/node_modules/@lezer/common": { @@ -12314,13 +12314,13 @@ }, "packages/plugs": { "name": "@silverbulletmd/plugs", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@jest/globals": "^27.5.1", "@lezer/generator": "1.0.0", "@lezer/lr": "1.0.0", - "@silverbulletmd/common": "^0.0.32", + "@silverbulletmd/common": "^0.0.33", "@types/yaml": "^1.9.7", "handlebars": "^4.7.7", "markdown-it": "^12.3.2", @@ -12352,7 +12352,7 @@ }, "packages/server": { "name": "@silverbulletmd/server", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@codemirror/lang-javascript": "6.0.0", @@ -12360,9 +12360,9 @@ "@codemirror/legacy-modes": "6.0.0", "@jest/globals": "^27.5.1", "@lezer/markdown": "1.0.1", - "@silverbulletmd/common": "^0.0.32", - "@silverbulletmd/plugs": "^0.0.32", - "@silverbulletmd/web": "^0.0.32", + "@silverbulletmd/common": "^0.0.33", + "@silverbulletmd/plugs": "^0.0.33", + "@silverbulletmd/web": "^0.0.33", "better-sqlite3": "^7.5.0", "body-parser": "^1.19.2", "buffer": "^6.0.3", @@ -13656,7 +13656,7 @@ }, "packages/web": { "name": "@silverbulletmd/web", - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.1", @@ -18329,7 +18329,7 @@ "@jest/globals": "^27.5.1", "@lezer/generator": "1.0.0", "@lezer/lr": "1.0.0", - "@silverbulletmd/common": "^0.0.32", + "@silverbulletmd/common": "^0.0.33", "@types/markdown-it": "^12.2.3", "@types/yaml": "^1.9.7", "handlebars": "^4.7.7", @@ -18368,9 +18368,9 @@ "@parcel/transformer-sass": "2.5.0", "@parcel/transformer-webmanifest": "2.5.0", "@parcel/validator-typescript": "2.5.0", - "@silverbulletmd/common": "^0.0.32", - "@silverbulletmd/plugs": "^0.0.32", - "@silverbulletmd/web": "^0.0.32", + "@silverbulletmd/common": "^0.0.33", + "@silverbulletmd/plugs": "^0.0.33", + "@silverbulletmd/web": "^0.0.33", "@types/cors": "^2.8.12", "@types/events": "^3.0.0", "@types/express": "^4.17.13", diff --git a/packages/common/package.json b/packages/common/package.json index d8c2189a..09432d80 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -4,7 +4,7 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.0.1", diff --git a/packages/plugos-silverbullet-syscall/package.json b/packages/plugos-silverbullet-syscall/package.json index 88fb3557..f943e48d 100644 --- a/packages/plugos-silverbullet-syscall/package.json +++ b/packages/plugos-silverbullet-syscall/package.json @@ -4,6 +4,6 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "license": "MIT" } diff --git a/packages/plugos-silverbullet-syscall/space.ts b/packages/plugos-silverbullet-syscall/space.ts index e67ae7f9..eb23db68 100644 --- a/packages/plugos-silverbullet-syscall/space.ts +++ b/packages/plugos-silverbullet-syscall/space.ts @@ -33,7 +33,7 @@ export async function getAttachmentMeta(name: string): Promise { export async function readAttachment( name: string -): Promise<{ buffer: ArrayBuffer; meta: AttachmentMeta }> { +): Promise<{ data: string; meta: AttachmentMeta }> { return syscall("space.readAttachment", name); } diff --git a/packages/plugos-syscall/package.json b/packages/plugos-syscall/package.json index ffd62b44..6bf2aec0 100644 --- a/packages/plugos-syscall/package.json +++ b/packages/plugos-syscall/package.json @@ -4,6 +4,6 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "license": "MIT" } diff --git a/packages/plugos/package.json b/packages/plugos/package.json index be5c328f..223e75bd 100644 --- a/packages/plugos/package.json +++ b/packages/plugos/package.json @@ -4,7 +4,7 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "bin": { "plugos-bundle": "./dist/plugos/plugos-bundle.js", diff --git a/packages/plugs/package.json b/packages/plugs/package.json index 3e37259d..0ade0944 100644 --- a/packages/plugs/package.json +++ b/packages/plugs/package.json @@ -4,7 +4,7 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "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.32", + "@silverbulletmd/common": "^0.0.33", "@types/yaml": "^1.9.7", "handlebars": "^4.7.7", "markdown-it": "^12.3.2", diff --git a/packages/server/package.json b/packages/server/package.json index 26015060..d1ef6f29 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -4,7 +4,7 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "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.32", - "@silverbulletmd/plugs": "^0.0.32", - "@silverbulletmd/web": "^0.0.32", + "@silverbulletmd/common": "^0.0.33", + "@silverbulletmd/plugs": "^0.0.33", + "@silverbulletmd/web": "^0.0.33", "better-sqlite3": "^7.5.0", "body-parser": "^1.19.2", "buffer": "^6.0.3", diff --git a/packages/web/package.json b/packages/web/package.json index 2881a15b..0522a33c 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -4,7 +4,7 @@ "name": "Zef Hemel", "email": "zef@zef.me" }, - "version": "0.0.32", + "version": "0.0.33", "license": "MIT", "scripts": { "watch": "rm -rf .parcel-cache && parcel watch", diff --git a/scripts/build_demo.sh b/scripts/build_demo.sh new file mode 100644 index 00000000..facacaa1 --- /dev/null +++ b/scripts/build_demo.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +echo "Building silver bullet" +npm run clean-build +echo "Cleaning website build dir" +rm -rf website_build +mkdir -p website_build/page/_plug +echo "Copying silverbullet runtime files" +cp -r packages/web/dist/* website_build/ +echo "Copying netlify config files" +cp website/{_redirects,_headers} website_build/ + +echo "Copying website markdown files" +cp -r website/* website_build/page/ +rm website_build/page/{_redirects,_headers} + +echo "Copying standard set of plugs" +cp packages/plugs/dist/* website_build/page/_plug/ + +echo "Applying rename magic" +find website_build/page/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \; +find website_build/page/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \; + +echo "Generating file listing" +node scripts/generate_fs_list.js > website_build/index.json + +echo > website_build/empty.md + diff --git a/scripts/build_website.sh b/scripts/build_website.sh index 693f6bc2..12d247db 100755 --- a/scripts/build_website.sh +++ b/scripts/build_website.sh @@ -1,27 +1,4 @@ #!/bin/bash -echo "Building silver bullet" -npm run clean-build -echo "Cleaning website build dir" rm -rf website_build -mkdir -p website_build/page/_plug -echo "Copying silverbullet runtime files" -cp -r packages/web/dist/* website_build/ -echo "Copying netlify config files" -cp website/{_redirects,_headers} website_build/ - -echo "Copying website markdown files" -cp -r website/* website_build/page/ -rm website_build/page/{_redirects,_headers} - -echo "Copying standard set of plugs" -cp packages/plugs/dist/* website_build/page/_plug/ - -echo "Applying rename magic" -find website_build/page/ -depth -name "*.md" -exec sh -c 'mv "$1" "${1%.md}"' _ {} \; -find website_build/page/ -depth -name "*.plug.json" -exec sh -c 'mv "$1" "${1%.plug.json}"' _ {} \; - -echo "Generating file listing" -node scripts/generate_fs_list.js > website_build/index.json - -echo > website_build/empty.md \ No newline at end of file +npx --yes @silverbulletmd/publish -o website_build --index website \ No newline at end of file diff --git a/website/test page.md b/website/test page.md new file mode 100644 index 00000000..e119b87f --- /dev/null +++ b/website/test page.md @@ -0,0 +1,4 @@ +Syup + +![](attachment/bla) +kljhaef \ No newline at end of file diff --git a/website/website-footer.md b/website/website-footer.md index 9e40f9f1..adca7a74 100644 --- a/website/website-footer.md +++ b/website/website-footer.md @@ -1,3 +1,4 @@ + --- ©️ [[Silver Bullet]] authors. _Published with [Silver Bullet Publish](https://github.com/silverbulletmd/silverbullet-publish)._ \ No newline at end of file