Skip to content

Commit 9c7d7b2

Browse files
authored
Merge pull request #34 from supabase/refactor-crates
fix: use prefix for custom crates
2 parents 37f9671 + e7c1818 commit 9c7d7b2

File tree

16 files changed

+68
-72
lines changed

16 files changed

+68
-72
lines changed

Cargo.lock

Lines changed: 38 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ members = [
33
"./crates/base",
44
"./crates/cli",
55
"./crates/module_fetcher",
6-
"./crates/supa_workers",
7-
"./crates/supa_worker_context",
8-
"./crates/supa_env",
6+
"./crates/sb_workers",
7+
"./crates/sb_worker_context",
8+
"./crates/sb_env",
99
"./crates/sb_core"
1010
]
1111
resolver = "2"

crates/base/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ serde = { version = "1.0.149", features = ["derive"] }
3333
tokio.workspace = true
3434
url = { version = "2.3.1" }
3535
v8 = { version = "0.60.1", default-features = false }
36-
supabase_edge_worker_context = { version = "0.1.0", path = "../supa_worker_context" }
37-
supabase_edge_workers = { version = "0.1.0", path = "../supa_workers" }
38-
supabase_edge_env = { version = "0.1.0", path = "../supa_env" }
36+
sb_worker_context = { version = "0.1.0", path = "../sb_worker_context" }
37+
sb_workers = { version = "0.1.0", path = "../sb_workers" }
38+
sb_env = { version = "0.1.0", path = "../sb_env" }
3939
sb_core = { version = "0.1.0", path = "../sb_core" }
4040
uuid.workspace = true
4141

@@ -66,7 +66,7 @@ serde = { version = "1.0.149", features = ["derive"] }
6666
tokio.workspace = true
6767
url = { version = "2.3.1" }
6868
v8 = { version = "0.60.1", default-features = false }
69-
supabase_edge_worker_context = { version = "0.1.0", path = "../supa_worker_context" }
70-
supabase_edge_workers = { version = "0.1.0", path = "../supa_workers" }
71-
supabase_edge_env = { version = "0.1.0", path = "../supa_env" }
69+
sb_worker_context = { version = "0.1.0", path = "../sb_worker_context" }
70+
sb_workers = { version = "0.1.0", path = "../sb_workers" }
71+
sb_env = { version = "0.1.0", path = "../sb_env" }
7272
sb_core = { version = "0.1.0", path = "../sb_core" }

crates/base/src/js_worker.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ use sb_core::net::sb_core_net;
2929
use sb_core::permissions::{sb_core_permissions, Permissions};
3030
use sb_core::runtime::sb_core_runtime;
3131
use sb_core::sb_core_main;
32-
use supabase_edge_env::supabase_env;
33-
use supabase_edge_worker_context::essentials::UserWorkerMsgs;
34-
use supabase_edge_workers::supabase_user_workers;
32+
use sb_env::sb_env;
33+
use sb_worker_context::essentials::UserWorkerMsgs;
34+
use sb_workers::sb_user_workers;
3535

3636
fn load_import_map(maybe_path: Option<String>) -> Result<Option<ImportMap>, Error> {
3737
if let Some(path_str) = maybe_path {
@@ -66,7 +66,7 @@ fn print_import_map_diagnostics(diagnostics: &[ImportMapDiagnostic]) {
6666
pub struct MainWorker {
6767
js_runtime: JsRuntime,
6868
main_module_url: ModuleSpecifier,
69-
worker_pool_tx: mpsc::UnboundedSender<supabase_edge_worker_context::essentials::UserWorkerMsgs>,
69+
worker_pool_tx: mpsc::UnboundedSender<UserWorkerMsgs>,
7070
}
7171

7272
impl MainWorker {
@@ -122,8 +122,8 @@ impl MainWorker {
122122
),
123123
deno_http::deno_http::init_ops_and_esm(),
124124
deno_tls::deno_tls::init_ops_and_esm(),
125-
supabase_env::init_ops_and_esm(),
126-
supabase_user_workers::init_ops_and_esm(),
125+
sb_env::init_ops_and_esm(),
126+
sb_user_workers::init_ops_and_esm(),
127127
sb_core_main::init_ops_and_esm(),
128128
sb_core_net::init_ops_and_esm(),
129129
sb_core_http::init_ops_and_esm(),
@@ -269,8 +269,8 @@ impl UserWorker {
269269
),
270270
deno_http::deno_http::init_ops_and_esm(),
271271
deno_tls::deno_tls::init_ops_and_esm(),
272-
supabase_env::init_ops_and_esm(),
273-
supabase_user_workers::init_ops_and_esm(),
272+
sb_env::init_ops_and_esm(),
273+
sb_user_workers::init_ops_and_esm(),
274274
sb_core_main::init_ops_and_esm(),
275275
sb_core_net::init_ops_and_esm(),
276276
sb_core_http::init_ops_and_esm(),

crates/base/src/worker_ctx.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ use crate::js_worker::{MainWorker, UserWorker};
33
use anyhow::{bail, Error};
44
use hyper::{Body, Request, Response};
55
use log::{debug, error};
6+
use sb_worker_context::essentials::{CreateUserWorkerResult, UserWorkerMsgs, UserWorkerOptions};
67
use std::collections::HashMap;
78
use std::path::Path;
89
use std::path::PathBuf;
910
use std::sync::Arc;
1011
use std::thread;
11-
use supabase_edge_worker_context::essentials::{
12-
CreateUserWorkerResult, UserWorkerMsgs, UserWorkerOptions,
13-
};
1412
use tokio::net::UnixStream;
1513
use tokio::sync::oneshot::Receiver;
1614
use tokio::sync::RwLock;

crates/sb_core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ deno_http.workspace = true
2222
hyper.workspace = true
2323
serde.workspace = true
2424
bytes.workspace = true
25-
supabase_edge_worker_context = { version = "0.1.0", path = "../supa_worker_context" }
25+
sb_worker_context = { version = "0.1.0", path = "../sb_worker_context" }

crates/sb_core/js/bootstrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import * as tls from "ext:deno_net/02_tls.js";
2222
import * as net from "ext:deno_net/01_net.js";
2323
import * as response from "ext:deno_fetch/23_response.js";
2424
import * as request from "ext:deno_fetch/23_request.js";
25-
import { SUPABASE_USER_WORKERS } from "ext:supabase_user_workers/user_workers.js";
26-
import { SUPABASE_ENV } from "ext:supabase_env/env.js";
25+
import { SUPABASE_USER_WORKERS } from "ext:sb_user_workers/user_workers.js";
26+
import { SUPABASE_ENV } from "ext:sb_env/env.js";
2727

2828

2929
const core = globalThis.Deno.core;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "supabase_edge_env"
2+
name = "sb_env"
33
version = "0.1.0"
44
authors = ["Supabase <team@supabase.com>"]
55
edition = "2021"
@@ -13,4 +13,4 @@ path = "lib.rs"
1313
[dependencies]
1414
deno_core.workspace = true
1515
deno_node.workspace = true
16-
sb_core = { version = "0.1.0", path = "../sb_core" }
16+
sb_core = { version = "0.1.0", path = "../sb_core" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::path::Path;
1212
pub type EnvVars = HashMap<String, String>;
1313

1414
deno_core::extension!(
15-
supabase_env,
15+
sb_env,
1616
ops = [op_set_env, op_env, op_get_env, op_delete_env],
1717
esm = ["env.js"]
1818
);

0 commit comments

Comments
 (0)