diff --git a/.gitignore b/.gitignore index d4738ab..98f2bef 100644 --- a/.gitignore +++ b/.gitignore @@ -12,9 +12,5 @@ target # MSVC Windows builds of rustc generate these, which store debugging information *.pdb - - -# Added by cargo - /target /ZettelKasten diff --git a/Cargo.lock b/Cargo.lock index 2e38b83..2d0ab33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ checksum = "90e549dd7c6562b6a2ea807b44726e6241707db054a817dc4c7e2b8d3b39bfac" dependencies = [ "accesskit", "accesskit_atspi_common", - "async-channel 2.5.0", + "async-channel", "async-executor", "async-task", "atspi", @@ -281,7 +281,7 @@ dependencies = [ "objc2-foundation 0.3.2", "parking_lot", "percent-encoding", - "windows-sys 0.52.0", + "windows-sys 0.60.2", "x11rb", ] @@ -480,39 +480,18 @@ dependencies = [ "libloading", ] -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "async-broadcast" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.5.0" @@ -539,22 +518,6 @@ dependencies = [ "slab", ] -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.5.0", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", - "tokio", -] - [[package]] name = "async-io" version = "2.6.0" @@ -579,7 +542,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -590,14 +553,14 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-io", "async-lock", "async-signal", "async-task", "blocking", "cfg-if", - "event-listener 5.4.1", + "event-listener", "futures-lite", "rustix 1.1.4", ] @@ -631,33 +594,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-attributes", - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-stream" version = "0.3.6" @@ -973,7 +909,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-task", "futures-io", "futures-lite", @@ -1844,7 +1780,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -1916,7 +1852,7 @@ version = "0.1.0" dependencies = [ "anyhow", "migration", - "rand 0.10.0", + "rand 0.10.1", "sea-orm", "thiserror 2.0.18", "tokio", @@ -2182,7 +2118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2211,12 +2147,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.4.1" @@ -2234,7 +2164,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.1", + "event-listener", "pin-project-lite", ] @@ -2333,7 +2263,7 @@ dependencies = [ "notify", "nucleo-matcher", "pulldown-cmark", - "rand 0.10.0", + "rand 0.10.1", "ratatui", "ratatui-textarea", "rayon", @@ -3440,18 +3370,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "glow" version = "0.17.0" @@ -4004,7 +3922,7 @@ dependencies = [ "portable-atomic", "portable-atomic-util", "serde_core", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -4179,15 +4097,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lab" version = "0.11.0" @@ -4370,9 +4279,6 @@ name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -dependencies = [ - "value-bag", -] [[package]] name = "lru" @@ -4471,13 +4377,13 @@ dependencies = [ name = "migration" version = "0.1.0" dependencies = [ - "async-std", "nanoid", - "rand 0.10.0", + "rand 0.10.1", "rgb", "sea-orm", "sea-orm-migration", "serde", + "tokio", ] [[package]] @@ -4654,7 +4560,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -5437,12 +5343,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "piper" version = "0.2.5" @@ -5773,9 +5673,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" +checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" dependencies = [ "chacha20", "getrandom 0.4.2", @@ -6197,7 +6097,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.12.1", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -6850,7 +6750,7 @@ dependencies = [ "crc", "crossbeam-queue", "either", - "event-listener 5.4.1", + "event-listener", "futures-core", "futures-intrusive", "futures-io", @@ -7174,7 +7074,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix 1.1.4", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -7811,12 +7711,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "value-bag" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" - [[package]] name = "vcpkg" version = "0.2.15" @@ -8496,7 +8390,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -9118,7 +9012,7 @@ dependencies = [ "async-trait", "blocking", "enumflags2", - "event-listener 5.4.1", + "event-listener", "futures-core", "futures-lite", "hex", diff --git a/Cargo.toml b/Cargo.toml index b1bdbf9..58fc83b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,11 +11,10 @@ version = "0.1.0" edition = "2024" authors = ["suri.codes "] description = "Personal-Knowledge-System, with deeply integrated task tracking and long term goal planning capabilities." -license = "GNU GPLv3" +license = "GPL-3.0-only" repository = "https://tangled.org/suri-codes/filaments" -# once we have this up on my website -# homepage = "" -# documentation = "" +homepage = "https://suri.codes/projects/filaments" +documentation = "https://suri.codes/projects/filaments" readme = "README.md" keywords = ["PKS", "todo", "personal tools"] rust-version = "1.94.0" @@ -29,9 +28,9 @@ pedantic = "deny" nursery = "deny" [workspace.dependencies] -snafu = "0.9.0" serde = "1.0.228" tracing = "0.1.44" +rand = "0.10.1" tokio = { version = "1.51.1", features = ["full"] } tree = {path = "crates/tree"} @@ -43,8 +42,8 @@ authors.workspace = true description.workspace = true license.workspace = true repository.workspace = true -# homepage.workspace = true -# documentation.workspace = true +homepage.workspace = true +documentation.workspace = true readme.workspace = true keywords.workspace = true @@ -77,7 +76,7 @@ eframe = "0.34.1" async-trait = "0.1.89" egui_graphs = "0.30.0" rayon = "1.11.0" -rand = "0.10.0" +rand = {workspace = true} pulldown-cmark = { version = "0.13.3", features = ["simd"] } ratatui-textarea = "0.8.0" nucleo-matcher = "0.3.1" @@ -95,13 +94,12 @@ vergen-gix = {version = "9.1.0", features = ["build", "cargo"]} [dev-dependencies] tempfile = "3" -# patch egui_graphs to have egui 0.34.1 +# Patch `egui_graphs` to have `egui` 0.34.1 [patch.crates-io] egui_graphs = { git = "https://github.com/suri-codes/egui_graphs", rev = "3327417007520300782574e3d6bc377bbafa8b5a" } [profile.release] codegen-units = 1 lto = true -opt-level = "s" +opt-level = 3 strip = true - diff --git a/crates/dto/migration/Cargo.toml b/crates/dto/migration/Cargo.toml index 2a2abef..1d2c32b 100644 --- a/crates/dto/migration/Cargo.toml +++ b/crates/dto/migration/Cargo.toml @@ -1,21 +1,25 @@ [package] name = "migration" version = "0.1.0" -edition = "2024" -publish = false +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +repository.workspace = true +license.workspace = true + [lib] name = "migration" path = "src/lib.rs" [dependencies] -async-std = { version = "1", features = ["attributes", "tokio1"] } nanoid = "0.4.0" sea-orm = "2.0.0-rc.38" rgb = "0.8.53" +tokio = { workspace = true } serde = {workspace = true} -rand = "0.10.0" +rand = {workspace = true} [dependencies.sea-orm-migration] version = "2.0.0-rc.38" diff --git a/crates/dto/migration/src/main.rs b/crates/dto/migration/src/main.rs index c6b6e48..f054dea 100644 --- a/crates/dto/migration/src/main.rs +++ b/crates/dto/migration/src/main.rs @@ -1,6 +1,6 @@ use sea_orm_migration::prelude::*; -#[async_std::main] +#[tokio::main] async fn main() { cli::run_cli(migration::Migrator).await; } diff --git a/deny.toml b/deny.toml new file mode 100644 index 0000000..a8409ad --- /dev/null +++ b/deny.toml @@ -0,0 +1,250 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "Unicode-3.0", + "BSD-2-Clause", + "BSD-3-Clause", + "Zlib", + "GPL-3.0-only", + "MPL-2.0", + "CC0-1.0", + "ISC", + "BSL-1.0", + "OFL-1.1", + "Ubuntu-font-1.0" +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = false +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# If true, workspace members are automatically allowed even when using deny-by-default +# This is useful for organizations that want to deny all external dependencies by default +# but allow their own workspace crates without having to explicitly list them +allow-workspace = false +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [] + +[sources.allow-org] +# github.com organizations to allow git sources for +github = [] +# gitlab.com organizations to allow git sources for +gitlab = [] +# bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/doc/cleanup.md b/doc/cleanup.md new file mode 100644 index 0000000..842e682 --- /dev/null +++ b/doc/cleanup.md @@ -0,0 +1,7 @@ +# TODO: once we have this up on my website + +homepage = "https://suri.codes/projects/filaments" +documentation = "https://suri.codes/projects/filaments" + +I need to rework my website to have a place for filaments, but then again, I don't really care about +other people using my project, so i guess it really depends diff --git a/flake.nix b/flake.nix index 351dc15..046cd7f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Filaments dev flake"; + description = "Filaments Flake"; # Flake inputs inputs = { @@ -11,7 +11,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - crane.url = "github:ipetkov/crane"; # add this + crane.url = "github:ipetkov/crane"; }; # Flake outputs @@ -19,15 +19,13 @@ { self, ... }@inputs: let - # The systems supported for this flake supportedSystems = [ - "x86_64-linux" # 64-bit Intel/AMD Linux - "aarch64-linux" # 64-bit ARM Linux - "x86_64-darwin" # 64-bit Intel macOS - "aarch64-darwin" # 64-bit ARM macOS + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" ]; - # Helper to provide system-specific attributes forEachSupportedSystem = f: inputs.nixpkgs.lib.genAttrs supportedSystems ( @@ -46,27 +44,25 @@ { overlays.default = final: prev: { - + # Need this specific `sea-orm-cli` sea-orm-cli = final.rustPlatform.buildRustPackage rec { pname = "sea-orm-cli"; version = "2.0.0-rc.37"; src = final.fetchCrate { inherit pname version; - sha256 = "sha256-YbP85rVO41S7ZPWSpVz3jICLAEU8H/a2axJBtdFRuWY="; }; cargoHash = "sha256-6lOXyaNxrIfCI3T9nIPR76rhQXvRzSVQUsPRjo5abmI="; - nativeBuildInputs = [ final.pkg-config ]; buildInputs = [ final.openssl ]; - doCheck = false; # Skip tests to speed up the build + doCheck = true; }; rustToolchain = @@ -112,12 +108,12 @@ } ); + # Needed developer tools. devShells = forEachSupportedSystem ( { pkgs }: { default = pkgs.mkShellNoCC { - # The Nix packages provided in the environment - # Add any you need here + packages = with pkgs; [ rustToolchain @@ -127,21 +123,19 @@ cargo-edit cargo-watch cargo-nextest - rust-analyzer - sea-orm-cli - bacon ]; - # Set any environment variables for your dev shell env = { + # needed for rust-analyzer RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library"; FIL_LOG_LEVEL = "DEBUG"; }; + # Need to do this like this because these have to be set at runtime shellHook = '' export FIL_CONFIG="$(pwd)/.config" export FIL_DATA="$(pwd)/.data" diff --git a/justfile b/justfile index 4c4d8e8..e73a1ae 100644 --- a/justfile +++ b/justfile @@ -3,23 +3,23 @@ default: @just --list -# release mode by default +# debug mode by default mode := "debug" -_cargo_flags := if mode == "release" { "--release" } else { "" } +cargo_flags := if mode == "release" { "--release" } else { "" } # Builds everything in the workspace build: - cargo build {{_cargo_flags}} + cargo build {{ cargo_flags }} # Runs Filaments run: - cargo run {{_cargo_flags}} + cargo run {{ cargo_flags }} # Run all tests test: - cargo nextest r {{_cargo_flags}} -reset: + cargo nextest r {{ cargo_flags }} +reset: rm -rf ./ZettelKasten rm -rf ./.data cargo run -- init @@ -30,40 +30,31 @@ dev-db := justfile_directory() + "/target/dev.db" dev-db-url := "sqlite:///" + dev-db # build entities from migrations -[working-directory:"crates/dto"] +[working-directory("crates/dto")] entity: - # create the dev db - rm -f {{dev-db}} - touch {{dev-db}} + # remove dev db if it exists, and create a new one + rm -f {{ dev-db }} + touch {{ dev-db }} # run the migration - cd migration && cargo run -- -u {{dev-db-url}} + cd migration && cargo run -- -u {{ dev-db-url }} # generate entity files based off the migraiton sea-orm-cli generate entity \ - --database-url {{dev-db-url}} \ + --database-url {{ dev-db-url }} \ --output-dir ./src/entity \ --experimental-preserve-user-modifications \ --entity-format=dense # add flag if expanded format is needed for debugging - + # replace elementary types with specific ones sed -i 's/pub nano_id: String/pub nano_id: NanoId/g' ./src/entity/*.rs sed -i 's/pub priority: String/pub priority: Priority/g' ./src/entity/*.rs sed -i 's/pub color: i64/pub color: Color/g' ./src/entity/*.rs - + # replace parent_group_id with proper nano_id sed -i 's/pub parent_group_id: Option/pub parent_group_id: Option/g' ./src/entity/*.rs - + # replace foregin key id's with nano_id sed -i 's/pub group_id: String/pub group_id: NanoId/g' ./src/entity/*.rs sed -i 's/pub zettel_id: String/pub zettel_id: NanoId/g' ./src/entity/*.rs - - - - - - - - - diff --git a/src/main.rs b/src/main.rs index 96a5486..f88de6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ //! Filaments -//! My (suri.codes) personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities. -//! +//! My personal-knowledge-system, with deeply integrated task tracking and long term goal planning capabilities. use std::{process, sync::Arc}; @@ -11,6 +10,7 @@ use crate::{ types::{Deimos, Kasten, KastenHandle}, viz::FilViz, }; + use clap::Parser; use tokio::sync::{RwLock, mpsc}; use tracing::debug; @@ -55,24 +55,20 @@ fn main() -> color_eyre::Result<()> { // then we spawn the tui on its own thread let tui_handle = std::thread::spawn({ - // arc stuff let tui_rt = rt.clone(); let kh = kh.clone(); let signal_tx = signal_tx.clone(); - // closure to run the tui move || -> color_eyre::Result<()> { - // block the tui on the same runtime as above tui_rt.block_on(async { let mut tui = TuiApp::new(args.tick_rate, args.frame_rate, kh, signal_tx)?; tui.run().await?; - // just close everything as soon as the tui is done running + // Force close everything once TUI is done. process::exit(0); }) } }); - // if they asked for the visualizer, we give them the visualizer if args.visualizer { // enter the guard so egui_async works properly let _rt_guard = rt.enter();