@smbcloud / cli / commits / f35486f

add monorepo runner

Seto committed Jan 5, 2026 at 19:40 UTC f35486feb071d62b24a222524c11388429471e29
3 files changed +20 -7
.smb/config.toml
+1
@@ -5,6 +5,7 @@ description = 'smbCloud CLI monorepo'
5 id = 28
6 name = "smbcloud-cli"
7 repository = "smbcloud-cli"
8 +runner = 255
9 description = "smbcloud cli monorepo"
10 created_at = "2025-05-29T16:41:20.350Z"
11 updated_at = "2025-05-29T16:41:20.350Z"
crates/cli/src/deploy/detect_runner.rs
+7 -3
@@ -17,9 +17,7 @@ pub(crate) async fn detect_runner() -> Result<Runner> {
17 Err(_) => {
18 spinner.stop_and_persist(
19 &fail_symbol(),
20 - fail_message(
21 - "Could not detect project runner: no package.json, Gemfile, or Package.swift found",
22 - ),
20 + fail_message("Could not get the current path."),
21 );
22 anyhow::bail!(
23 "Could not detect project runner: no package.json, Gemfile, or Package.swift found"
@@ -42,6 +40,12 @@ pub(crate) async fn detect_runner() -> Result<Runner> {
40 };
41
42 match runner {
43 + Runner::Monorepo => {
44 + spinner.stop_and_persist(
45 + &succeed_symbol(),
46 + succeed_message("Monorepo universal runner"),
47 + );
48 + }
49 Runner::NodeJs => {
50 spinner.stop_and_persist(
51 &succeed_symbol(),
crates/smbcloud-model/src/runner.rs
+12 -4
@@ -16,6 +16,7 @@ pub enum Runner {
16 NodeJs,
17 Ruby,
18 Swift,
19 + Monorepo = 255,
20 }
21
22 impl Display for Runner {
@@ -45,6 +46,7 @@ pub enum SwiftFramework {
46
47 impl Runner {
48 pub fn from(repo_path: &PathBuf) -> Result<Runner, ErrorResponse> {
49 + // See if we have a framework-based config.
50 if repo_path.join("package.json").exists()
51 && (next_config_exists(repo_path) || astro_config_exists(repo_path))
52 {
@@ -57,10 +59,8 @@ impl Runner {
59 if repo_path.join("Package.swift").exists() {
60 return Ok(Runner::Swift);
61 }
60 - Err(ErrorResponse::Error {
61 - error_code: UnsupportedRunner,
62 - message: UnsupportedRunner.message(None).to_string(),
63 - })
62 + // See if we have a monorepo setup.
63 + non_framework_runner()
64 }
65
66 pub fn git_host(&self) -> String {
@@ -69,12 +69,20 @@ impl Runner {
69
70 fn api(&self) -> &str {
71 match self {
72 + Runner::Monorepo => "monorepo",
73 Runner::NodeJs => "api",
74 Runner::Ruby | Runner::Swift => "api-1",
75 }
76 }
77 }
78
79 +fn non_framework_runner() -> Result<Runner, ErrorResponse> {
80 + Err(ErrorResponse::Error {
81 + error_code: UnsupportedRunner,
82 + message: UnsupportedRunner.message(None).to_string(),
83 + })
84 +}
85 +
86 // Helper function to detect any next.config.* file
87 fn next_config_exists(repo_path: &PathBuf) -> bool {
88 if let Ok(entries) = fs::read_dir(repo_path) {