diff --git a/.taplo.toml b/.taplo.toml index e884656992..5b26aabcd1 100644 --- a/.taplo.toml +++ b/.taplo.toml @@ -1,9 +1,7 @@ -exclude = ["node_modules/**/*.toml"] +include = ["./*.toml", "./packages/**/*.toml"] -[[rule]] -keys = ["dependencies", "*-dependencies"] - -[rule.formatting] -align_entries = true -indent_tables = true -reorder_keys = true +[formatting] +align_entries = true +column_width = 180 +reorder_arrays = true +reorder_keys = true diff --git a/Cargo.lock b/Cargo.lock index 4f42f91a68..138ed34d4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1008,19 +1008,17 @@ dependencies = [ [[package]] name = "napi" -version = "2.16.6" +version = "3.0.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc300228808a0e6aea5a58115c82889240bcf8dab16fc25ad675b33e454b368" +checksum = "99d38fbf4cbfd7d2785d153f4dcce374d515d3dabd688504dd9093f8135829d0" dependencies = [ "anyhow", "bitflags 2.5.0", "chrono", "ctor", - "napi-derive", "napi-sys", "once_cell", "serde", - "serde_json", "tokio", ] @@ -1032,9 +1030,9 @@ checksum = "e1c0f5d67ee408a4685b61f5ab7e58605c8ae3f2b4189f0127d804ff13d5560a" [[package]] name = "napi-derive" -version = "2.16.4" +version = "3.0.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb613535cde46cff231e53cd819c1694a32d48946bc2dda6b41174ace52ac08" +checksum = "c230c813bfd4d6c7aafead3c075b37f0cf7fecb38be8f4cf5cfcee0b2c273ad0" dependencies = [ "cfg-if", "convert_case", @@ -1046,9 +1044,9 @@ dependencies = [ [[package]] name = "napi-derive-backend" -version = "1.0.66" +version = "2.0.0-alpha.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da041b19246ab4240998774e987fd9a7d92cc7406b91b5eddb6691e81feac044" +checksum = "4370cc24c2e58d0f3393527b282eb00f1158b304248f549e1ec81bd2927db5fe" dependencies = [ "convert_case", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index b7dae09ff6..9307cad17f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,34 @@ [workspace] +members = ["./packages/backend/native", "./packages/frontend/native", "./packages/frontend/native/schema"] resolver = "2" -members = [ - "./packages/frontend/native", - "./packages/frontend/native/schema", - "./packages/backend/native", -] [workspace.dependencies] -mimalloc = "0.1" +anyhow = "1" +chrono = "0.4" +dotenv = "0.15" +file-format = { version = "0.25", features = ["reader"] } +mimalloc = "0.1" +napi = { version = "3.0.0-alpha.1", features = ["async", "chrono_date", "error_anyhow", "napi9", "serde"] } +napi-build = { version = "2" } +napi-derive = { version = "3.0.0-alpha.1" } +notify = { version = "6", features = ["serde"] } +once_cell = "1" +parking_lot = "0.12" +rand = "0.8" +serde = "1" +serde_json = "1" +sha3 = "0.10" +sqlx = { version = "0.7", default-features = false, features = ["chrono", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] } +tiktoken-rs = "0.5" +tokio = "1.37" +uuid = "1.8" +y-octo = { git = "https://github.com/y-crdt/y-octo.git", branch = "main" } [profile.dev.package.sqlx-macros] opt-level = 3 [profile.release] -lto = true codegen-units = 1 -opt-level = 3 -strip = "symbols" +lto = true +opt-level = 3 +strip = "symbols" diff --git a/packages/backend/native/Cargo.toml b/packages/backend/native/Cargo.toml index 06abeb8ac8..948b2e66f1 100644 --- a/packages/backend/native/Cargo.toml +++ b/packages/backend/native/Cargo.toml @@ -1,23 +1,20 @@ [package] -name = "affine_server_native" -version = "1.0.0" edition = "2021" +name = "affine_server_native" +version = "1.0.0" [lib] crate-type = ["cdylib"] [dependencies] -chrono = "0.4" -file-format = { version = "0.25", features = ["reader"] } -napi = { version = "2", default-features = false, features = [ - "napi6", - "async", -] } -napi-derive = { version = "2", features = ["type-def"] } -rand = "0.8" -sha3 = "0.10" -tiktoken-rs = "0.5.9" -y-octo = { git = "https://github.com/y-crdt/y-octo.git", branch = "main" } +chrono = { workspace = true } +file-format = { workspace = true } +napi = { workspace = true } +napi-derive = { workspace = true } +rand = { workspace = true } +sha3 = { workspace = true } +tiktoken-rs = { workspace = true } +y-octo = { workspace = true } [target.'cfg(not(target_os = "linux"))'.dependencies] mimalloc = { workspace = true } @@ -29,4 +26,4 @@ mimalloc = { workspace = true, features = ["local_dynamic_tls"] } tokio = "1" [build-dependencies] -napi-build = "2" +napi-build = { workspace = true } diff --git a/packages/backend/server/migrations/migration_lock.toml b/packages/backend/server/migrations/migration_lock.toml index fbffa92c2b..99e4f20090 100644 --- a/packages/backend/server/migrations/migration_lock.toml +++ b/packages/backend/server/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually # It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file +provider = "postgresql" diff --git a/packages/frontend/native/Cargo.toml b/packages/frontend/native/Cargo.toml index f0611a6287..204e9be6de 100644 --- a/packages/frontend/native/Cargo.toml +++ b/packages/frontend/native/Cargo.toml @@ -1,6 +1,6 @@ [package] edition = "2021" -name = "affine_native" +name = "affine_native" version = "0.0.0" [lib] @@ -8,49 +8,24 @@ crate-type = ["cdylib"] [dependencies] affine_schema = { path = "./schema" } -anyhow = "1" -chrono = "0.4" -napi = { version = "2", default-features = false, features = [ - "napi5", - "tokio_rt", - "serde-json", - "error_anyhow", - "chrono_date", -] } -napi-derive = "2" -notify = { version = "6", features = ["serde"] } -once_cell = "1" -parking_lot = "0.12" -rand = "0.8" -serde = "1" -serde_json = "1" -sha3 = "0.10" -sqlx = { version = "0.7.4", default-features = false, features = [ - "sqlite", - "migrate", - "runtime-tokio", - "tls-rustls", - "chrono", - "macros", -] } -tokio = { version = "1", features = ["full"] } -uuid = { version = "1", default-features = false, features = [ - "serde", - "v4", - "fast-rng", -] } +anyhow = { workspace = true } +chrono = { workspace = true } +napi = { workspace = true } +napi-derive = { workspace = true } +notify = { workspace = true, features = ["serde"] } +once_cell = { workspace = true } +parking_lot = { workspace = true } +rand = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +sha3 = { workspace = true } +sqlx = { workspace = true, default-features = false, features = ["chrono", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] } +tokio = { workspace = true, features = ["full"] } +uuid = { workspace = true, features = ["fast-rng", "serde", "v4"] } [build-dependencies] affine_schema = { path = "./schema" } -dotenv = "0.15" -napi-build = "2" -sqlx = { version = "0.7.4", default-features = false, features = [ - "sqlite", - "runtime-tokio", - "tls-rustls", - "chrono", - "macros", - "migrate", - "json", -] } -tokio = { version = "1", features = ["full"] } +dotenv = { workspace = true } +napi-build = { workspace = true } +sqlx = { workspace = true, default-features = false, features = ["chrono", "json", "macros", "migrate", "runtime-tokio", "sqlite", "tls-rustls"] } +tokio = { workspace = true, features = ["full"] } diff --git a/packages/frontend/native/schema/Cargo.toml b/packages/frontend/native/schema/Cargo.toml index 303ee3ba17..6a51d5789b 100644 --- a/packages/frontend/native/schema/Cargo.toml +++ b/packages/frontend/native/schema/Cargo.toml @@ -1,4 +1,4 @@ [package] edition = "2021" -name = "affine_schema" +name = "affine_schema" version = "0.0.0" diff --git a/rustfmt.toml b/rustfmt.toml index cb160519e2..543f822040 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,10 +1,10 @@ max_width = 100 +hard_tabs = false tab_spaces = 2 -hard_tabs = false format_strings = true -wrap_comments = true +wrap_comments = true +group_imports = "StdExternalCrate" imports_granularity = "Crate" -group_imports = "StdExternalCrate" diff --git a/tools/workers/wrangler.toml b/tools/workers/wrangler.toml index 09bd635ecf..ed3aa158ac 100644 --- a/tools/workers/wrangler.toml +++ b/tools/workers/wrangler.toml @@ -1,3 +1,3 @@ -name = "workers" -main = "./src/index.ts" compatibility_date = "2023-07-11" +main = "./src/index.ts" +name = "workers"