diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..826f5a6 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +export DATABASE_URL=sqlite://$(pwd)/test.db diff --git a/Cargo.lock b/Cargo.lock index 5dc7c04..c90ca40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,6 +129,9 @@ name = "anyhow" version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +dependencies = [ + "backtrace", +] [[package]] name = "arbitrary" @@ -452,19 +455,10 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.32.2", "rustc-demangle", ] -[[package]] -name = "backtrace-ext" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" -dependencies = [ - "backtrace", -] - [[package]] name = "base64" version = "0.21.7" @@ -776,6 +770,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "cocoa" version = "0.25.0" @@ -806,16 +806,6 @@ dependencies = [ "objc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "colorchoice" version = "1.0.1" @@ -930,6 +920,16 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-entity" +version = "0.109.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8cfdc315e5d18997093e040a8d234bea1ac1e118a716d3e30f40d449e78207b" +dependencies = [ + "serde", + "serde_derive", +] + [[package]] name = "crc" version = "3.2.1" @@ -954,12 +954,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "critical-section" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" - [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -1354,6 +1348,12 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + [[package]] name = "encoding_rs" version = "0.8.34" @@ -2025,6 +2025,7 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", + "serde", ] [[package]] @@ -2340,17 +2341,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is-terminal" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is-wsl" version = "0.4.0" @@ -2361,12 +2351,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "is_ci" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" - [[package]] name = "is_terminal_polyfill" version = "1.70.0" @@ -2671,6 +2655,15 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -2741,6 +2734,15 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + [[package]] name = "memmap2" version = "0.9.4" @@ -2759,38 +2761,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "miette" -version = "5.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" -dependencies = [ - "backtrace", - "backtrace-ext", - "is-terminal", - "miette-derive", - "once_cell", - "owo-colors", - "supports-color", - "supports-hyperlinks", - "supports-unicode", - "terminal_size", - "textwrap", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "5.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - [[package]] name = "mime" version = "0.3.17" @@ -2859,45 +2829,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" -[[package]] -name = "musli" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c21124dd24833900879114414b877f2136f4b7b7a3b49756ecc5c36eca332bb" -dependencies = [ - "musli-macros", -] - -[[package]] -name = "musli-common" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "178446623aa62978aa0f894b2081bc11ea77c2119ccfe35be428ab9ddb495dfc" -dependencies = [ - "musli", -] - -[[package]] -name = "musli-macros" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1ab0e4ac2721bc4fa3528a6a2640c1c30c36c820f8c85159252fbf6c2fac24" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "musli-storage" -version = "0.0.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fc1f80b166f611c462e1344220e9b3a9ad37c885e43039d5d2e6887445937c" -dependencies = [ - "musli", - "musli-common", -] - [[package]] name = "ndk" version = "0.7.0" @@ -2971,30 +2902,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" -dependencies = [ - "num-integer", - "num-traits", -] - [[package]] name = "num-bigint-dig" version = "0.8.4" @@ -3012,15 +2919,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - [[package]] name = "num-conv" version = "0.1.0" @@ -3047,17 +2945,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -3256,15 +3143,20 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -dependencies = [ - "critical-section", - "portable-atomic", -] [[package]] name = "oneshot" @@ -3327,12 +3219,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "owo-colors" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" - [[package]] name = "pango" version = "0.18.3" @@ -3380,22 +3266,23 @@ dependencies = [ name = "panorama-core" version = "0.1.0" dependencies = [ + "anyhow", "async-imap", "backoff", "bimap", "chrono", "futures", "itertools 0.13.0", - "miette", - "rune", "serde", "serde_json", + "serde_yaml", "sqlx", "sugars", "tantivy", "tokio", "uuid", "walkdir", + "wasmtime", ] [[package]] @@ -3410,7 +3297,6 @@ dependencies = [ "dirs", "futures", "itertools 0.13.0", - "miette", "panorama-core", "serde", "serde_json", @@ -3733,10 +3619,15 @@ dependencies = [ ] [[package]] -name = "portable-atomic" -version = "1.6.0" +name = "postcard" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" +dependencies = [ + "cobs", + "embedded-io", + "serde", +] [[package]] name = "powerfmt" @@ -3821,6 +3712,15 @@ version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + [[package]] name = "publicsuffix" version = "2.2.3" @@ -4129,78 +4029,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rune" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f1ad3981e4bf4d336b913b33cab141192f7ce196b6faf3f489ce454e94c55f" -dependencies = [ - "anyhow", - "codespan-reporting", - "futures-core", - "futures-util", - "itoa 1.0.11", - "musli", - "musli-storage", - "num", - "once_cell", - "pin-project", - "rune-alloc", - "rune-core", - "rune-macros", - "ryu", - "serde", - "tracing", -] - -[[package]] -name = "rune-alloc" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd786d0d250e5768210ab54b57841e5fc48e2c96a2b7e43104dabe47348ee221" -dependencies = [ - "ahash", - "pin-project", - "rune-alloc-macros", - "serde", -] - -[[package]] -name = "rune-alloc-macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6a9c787416444401172f875c1361c9b78d21fecf10206e9a996693ee2d1023" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", -] - -[[package]] -name = "rune-core" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22249f328286279daf0f991dd04c09c30c8b7fda12fbb20391e3c041ba2dad22" -dependencies = [ - "byteorder", - "musli", - "rune-alloc", - "serde", - "twox-hash", -] - -[[package]] -name = "rune-macros" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d7decd5a5f44e2e351f03f4d7dc6beab0c656baefd70528bfc375c1ab49b8d" -dependencies = [ - "proc-macro2", - "quote", - "rune-core", - "syn 2.0.66", -] - [[package]] name = "rust-embed" version = "8.4.0" @@ -4708,12 +4536,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -4800,6 +4625,12 @@ dependencies = [ "der", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + [[package]] name = "sqlformat" version = "0.2.4" @@ -5104,34 +4935,6 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc0db74f9ee706e039d031a560bd7d110c7022f016051b3d33eeff9583e3e67a" -[[package]] -name = "supports-color" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" -dependencies = [ - "is-terminal", - "is_ci", -] - -[[package]] -name = "supports-hyperlinks" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" -dependencies = [ - "is-terminal", -] - -[[package]] -name = "supports-unicode" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" -dependencies = [ - "is-terminal", -] - [[package]] name = "swift-rs" version = "1.0.6" @@ -5739,36 +5542,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "terminal_size" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "textwrap" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" -dependencies = [ - "smawk", - "unicode-linebreak", - "unicode-width", -] - [[package]] name = "thin-slice" version = "0.1.1" @@ -6108,16 +5881,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "static_assertions", -] - [[package]] name = "typenum" version = "1.17.0" @@ -6197,12 +5960,6 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-linebreak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" - [[package]] name = "unicode-normalization" version = "0.1.23" @@ -6224,12 +5981,6 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" -[[package]] -name = "unicode-width" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" - [[package]] name = "unicode_categories" version = "0.1.1" @@ -6520,6 +6271,129 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07035cc9a9b41e62d3bb3a3815a66ab87c993c06fe1cf6b2a3f2a18499d937db" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "semver", + "serde", +] + +[[package]] +name = "wasmtime" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786d8b5e7a4d54917c5ebe555b9667337e5f93383f49bddaaeec2eba68093b45" +dependencies = [ + "anyhow", + "bumpalo", + "cc", + "cfg-if", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "libc", + "libm", + "log", + "mach2", + "memfd", + "memoffset", + "object 0.36.0", + "once_cell", + "paste", + "postcard", + "psm", + "rustix", + "serde", + "serde_derive", + "smallvec", + "sptr", + "target-lexicon", + "wasmparser", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d697d99c341d4a9ffb72f3af7a02124d233eeb59aee010f36d88e97cca553d5e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-environ" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f444e900e848b884d8a8a2949b6f5b92af642a3e663ff8fbe78731143a55be61" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli", + "indexmap 2.2.6", + "log", + "object 0.36.0", + "postcard", + "serde", + "serde_derive", + "target-lexicon", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5afe2f0499542f9a4bcfa1b55bfdda803b6ade4e7c93c6b99e0f39dba44b0a91" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-slab" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7de1f2bec5bbb35d532e61c85c049dc84ae671df60492f90b954ecf21169e7" + +[[package]] +name = "wasmtime-types" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "412463e9000e14cf6856be48628d2213c20c153e29ffc22b036980c892ea6964" +dependencies = [ + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de5a9bc4f44ceeb168e9e8e3be4e0b4beb9095b468479663a9e24c667e36826f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "wayland-sys" version = "0.31.2" diff --git a/apps/journal/asconfig.json b/apps/journal/asconfig.json new file mode 100644 index 0000000..8776597 --- /dev/null +++ b/apps/journal/asconfig.json @@ -0,0 +1,22 @@ +{ + "targets": { + "debug": { + "outFile": "build/debug.wasm", + "textFile": "build/debug.wat", + "sourceMap": true, + "debug": true + }, + "release": { + "outFile": "build/release.wasm", + "textFile": "build/release.wat", + "sourceMap": true, + "optimizeLevel": 3, + "shrinkLevel": 0, + "converge": false, + "noAssert": false + } + }, + "options": { + "bindings": "esm" + } +} \ No newline at end of file diff --git a/apps/journal/assembly/index.ts b/apps/journal/assembly/index.ts new file mode 100644 index 0000000..66a9aaf --- /dev/null +++ b/apps/journal/assembly/index.ts @@ -0,0 +1,5 @@ +// The entry file of your WebAssembly module. + +export function add(a: i32, b: i32): i32 { + return a + b; +} diff --git a/apps/journal/assembly/tsconfig.json b/apps/journal/assembly/tsconfig.json new file mode 100644 index 0000000..b134b92 --- /dev/null +++ b/apps/journal/assembly/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../../node_modules/.pnpm/assemblyscript@0.27.27/node_modules/assemblyscript/std/assembly.json", + "include": [ + "./**/*.ts" + ] +} \ No newline at end of file diff --git a/apps/journal/build/.gitignore b/apps/journal/build/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/apps/journal/build/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/apps/journal/index.html b/apps/journal/index.html new file mode 100644 index 0000000..c170dde --- /dev/null +++ b/apps/journal/index.html @@ -0,0 +1,10 @@ + + +
+ + + + diff --git a/apps/journal/manifest.yml b/apps/journal/manifest.yml index df4ef0b..0f4c027 100644 --- a/apps/journal/manifest.yml +++ b/apps/journal/manifest.yml @@ -1,4 +1,6 @@ name: journal version: 0.1.0 panorama_version: 0.1.0 -description: Note taking app \ No newline at end of file +description: Note taking app + +installer_path: build/release.wasm \ No newline at end of file diff --git a/apps/journal/package.json b/apps/journal/package.json new file mode 100644 index 0000000..154d5a1 --- /dev/null +++ b/apps/journal/package.json @@ -0,0 +1,26 @@ +{ + "name": "journal", + "version": "0.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "node tests", + "asbuild:debug": "asc assembly/index.ts --target debug", + "asbuild:release": "asc assembly/index.ts --target release", + "asbuild": "npm run asbuild:debug && npm run asbuild:release", + "start": "npx serve ." + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "assemblyscript": "^0.27.27" + }, + "type": "module", + "exports": { + ".": { + "import": "./build/release.js", + "types": "./build/release.d.ts" + } + } +} \ No newline at end of file diff --git a/apps/journal/tests/index.js b/apps/journal/tests/index.js new file mode 100644 index 0000000..769a0b0 --- /dev/null +++ b/apps/journal/tests/index.js @@ -0,0 +1,4 @@ +import assert from "assert"; +import { add } from "../build/debug.js"; +assert.strictEqual(add(1, 2), 3); +console.log("ok"); diff --git a/crates/panorama-core/Cargo.toml b/crates/panorama-core/Cargo.toml index 00764a2..1dc0363 100644 --- a/crates/panorama-core/Cargo.toml +++ b/crates/panorama-core/Cargo.toml @@ -4,21 +4,22 @@ version = "0.1.0" edition = "2021" [dependencies] +anyhow = { version = "1.0.86", features = ["backtrace"] } backoff = { version = "0.4.0", features = ["tokio"] } bimap = "0.6.3" chrono = { version = "0.4.38", features = ["serde"] } futures = "0.3.30" itertools = "0.13.0" -miette = { version = "5.5.0", features = ["fancy", "backtrace"] } -rune = "0.13.2" serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.117" +serde_yaml = "0.9.34" sqlx = { version = "0.7.4", features = ["runtime-tokio", "tls-rustls", "macros", "sqlite", "uuid", "chrono", "regexp"] } sugars = "3.0.1" tantivy = { version = "0.22.0", features = ["zstd"] } tokio = { version = "1.38.0", features = ["full"] } uuid = { version = "1.8.0", features = ["v7"] } walkdir = "2.5.0" +wasmtime = { version = "22.0.0", default-features = false, features = ["runtime"] } [dependencies.async-imap] version = "0.9.7" diff --git a/crates/panorama-core/migrations/00001_initial.sql b/crates/panorama-core/migrations/00001_initial.sql index a1ce6a2..5fb1424 100644 --- a/crates/panorama-core/migrations/00001_initial.sql +++ b/crates/panorama-core/migrations/00001_initial.sql @@ -37,4 +37,4 @@ CREATE TABLE key_mapping ( app_table_name TEXT NOT NULL, app_table_field TEXT NOT NULL, is_fts_enabled BOOLEAN NOT NULL DEFAULT FALSE -); \ No newline at end of file +); diff --git a/crates/panorama-core/src/lib.rs b/crates/panorama-core/src/lib.rs index bffa430..95a222d 100644 --- a/crates/panorama-core/src/lib.rs +++ b/crates/panorama-core/src/lib.rs @@ -17,7 +17,7 @@ use std::fmt; pub use crate::state::AppState; -use miette::{bail, IntoDiagnostic, Result}; +use anyhow::{bail, Result}; use serde_json::Value; use uuid::Uuid; @@ -31,7 +31,7 @@ impl fmt::Display for NodeId { } pub fn ensure_ok(s: &str) -> Result<()> { - let status: Value = serde_json::from_str(&s).into_diagnostic()?; + let status: Value = serde_json::from_str(&s)?; let status = status.as_object().unwrap(); let ok = status.get("ok").unwrap().as_bool().unwrap_or(false); if !ok { diff --git a/crates/panorama-core/src/mail.rs b/crates/panorama-core/src/mail.rs index b98207a..d33301f 100644 --- a/crates/panorama-core/src/mail.rs +++ b/crates/panorama-core/src/mail.rs @@ -3,11 +3,11 @@ use std::{ time::Duration, }; +use anyhow::{Context as _, Result}; use async_imap::Session; use backoff::{exponential::ExponentialBackoff, SystemClock}; use futures::TryStreamExt; use itertools::Itertools; -use miette::{Context, IntoDiagnostic, Result}; use tokio::{net::TcpStream, time::sleep}; use uuid::Uuid; @@ -60,15 +60,13 @@ impl MailWorker { let stream = TcpStream::connect((config.imap_hostname.as_str(), config.imap_port)) - .await - .into_diagnostic()?; + .await?; let client = async_imap::Client::new(stream); let mut session = client .login(&config.imap_username, &config.imap_password) .await - .map_err(|(err, _)| err) - .into_diagnostic()?; + .map_err(|(err, _)| err)?; let all_mailbox_ids = self .fetch_and_store_all_mailboxes(config.node_id.to_string(), &mut session) @@ -98,11 +96,9 @@ impl MailWorker { // println!("Session: {:?}", session); let mailboxes = session .list(None, Some("*")) - .await - .into_diagnostic()? + .await? .try_collect::