Skip to content

Commit

Permalink
chore: use workspace dependencies (#6964)
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed May 16, 2024
1 parent bf43ba3 commit 6d5d09b
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 90 deletions.
14 changes: 6 additions & 8 deletions .taplo.toml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 6 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 24 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
25 changes: 11 additions & 14 deletions packages/backend/native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 }
Expand All @@ -29,4 +26,4 @@ mimalloc = { workspace = true, features = ["local_dynamic_tls"] }
tokio = "1"

[build-dependencies]
napi-build = "2"
napi-build = { workspace = true }
2 changes: 1 addition & 1 deletion packages/backend/server/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -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"
provider = "postgresql"
63 changes: 19 additions & 44 deletions packages/frontend/native/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,56 +1,31 @@
[package]
edition = "2021"
name = "affine_native"
name = "affine_native"
version = "0.0.0"

[lib]
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"] }
2 changes: 1 addition & 1 deletion packages/frontend/native/schema/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
edition = "2021"
name = "affine_schema"
name = "affine_schema"
version = "0.0.0"
6 changes: 3 additions & 3 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions tools/workers/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name = "workers"
main = "./src/index.ts"
compatibility_date = "2023-07-11"
main = "./src/index.ts"
name = "workers"

0 comments on commit 6d5d09b

Please sign in to comment.