Skip to content

Commit c763646

Browse files
committed
chore: cargo fmt + add stripe webhook_secret to config
- Run cargo fmt --all to fix CI formatting failures - Add webhook_secret field to StripeConfig - Add warpgrid.toml to .gitignore (contains secrets)
1 parent 958e58c commit c763646

File tree

589 files changed

+3563
-2251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

589 files changed

+3563
-2251
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ __pycache__/
1717
/test-results
1818
docs/GTM-BETA-LAUNCH-PLAN.md
1919
docs/IMPLEMENTATION-PLAN-PHASE2.md
20+
warpgrid.toml

crates/warp-analyzer/src/analyzers/bun.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ mod tests {
128128
#[test]
129129
fn test_bun_lockb_detection() {
130130
let tmp = TempDir::new().unwrap();
131-
create_package_json(
132-
tmp.path(),
133-
r#"{"dependencies": {"hono": "4.7.4"}}"#,
134-
);
131+
create_package_json(tmp.path(), r#"{"dependencies": {"hono": "4.7.4"}}"#);
135132
// Create a bun.lockb file (binary, but we only check existence)
136133
fs::write(tmp.path().join("bun.lockb"), b"\x00binary").unwrap();
137134

crates/warp-analyzer/src/analyzers/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pub mod bun;
2-
pub mod rust;
2+
pub mod dockerfile;
33
pub mod go;
4+
pub mod rust;
45
pub mod typescript;
5-
pub mod dockerfile;
66

77
use anyhow::{Result, bail};
88
use std::path::Path;
@@ -23,7 +23,9 @@ pub fn detect_language(path: &Path) -> Result<String> {
2323
} else if path.join("Dockerfile").exists() {
2424
dockerfile::detect_language_from_dockerfile(&path.join("Dockerfile"))
2525
} else {
26-
bail!("Could not detect project language. No Cargo.toml, go.mod, bunfig.toml, package.json, or Dockerfile found.")
26+
bail!(
27+
"Could not detect project language. No Cargo.toml, go.mod, bunfig.toml, package.json, or Dockerfile found."
28+
)
2729
}
2830
}
2931

crates/warp-analyzer/src/analyzers/rust.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ pub fn analyze_cargo_toml(project_path: &Path) -> Result<Vec<DependencyVerdict>>
1919
for (name, value) in dep_table {
2020
let version = match value {
2121
toml::Value::String(v) => Some(v.clone()),
22-
toml::Value::Table(t) => t.get("version").and_then(|v| v.as_str()).map(String::from),
22+
toml::Value::Table(t) => {
23+
t.get("version").and_then(|v| v.as_str()).map(String::from)
24+
}
2325
_ => None,
2426
};
2527
deps.push(DependencyVerdict {
@@ -36,7 +38,9 @@ pub fn analyze_cargo_toml(project_path: &Path) -> Result<Vec<DependencyVerdict>>
3638
for (name, value) in dep_table {
3739
let version = match value {
3840
toml::Value::String(v) => Some(v.clone()),
39-
toml::Value::Table(t) => t.get("version").and_then(|v| v.as_str()).map(String::from),
41+
toml::Value::Table(t) => {
42+
t.get("version").and_then(|v| v.as_str()).map(String::from)
43+
}
4044
_ => None,
4145
};
4246
deps.push(DependencyVerdict {

crates/warp-analyzer/src/db/mod.rs

Lines changed: 142 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -32,61 +32,154 @@ fn builtin_rules() -> HashMap<String, CompatEntry> {
3232
("tracing", "compatible", None, None, None),
3333
("sqlx", "compatible", None, None, None),
3434
("rustls", "compatible", None, None, None),
35-
("openssl-sys", "incompatible", Some("FFI to native OpenSSL"), Some("rustls"), None),
36-
("openssl", "incompatible", Some("FFI to native OpenSSL"), Some("rustls"), None),
37-
("libz-sys", "incompatible", Some("FFI to native zlib"), Some("flate2 with rust backend"), None),
38-
("ring", "incompatible", Some("Contains platform-specific assembly"), Some("aws-lc-rs or rustls"), None),
39-
("nix", "incompatible", Some("Direct Unix syscall wrappers"), None, None),
35+
(
36+
"openssl-sys",
37+
"incompatible",
38+
Some("FFI to native OpenSSL"),
39+
Some("rustls"),
40+
None,
41+
),
42+
(
43+
"openssl",
44+
"incompatible",
45+
Some("FFI to native OpenSSL"),
46+
Some("rustls"),
47+
None,
48+
),
49+
(
50+
"libz-sys",
51+
"incompatible",
52+
Some("FFI to native zlib"),
53+
Some("flate2 with rust backend"),
54+
None,
55+
),
56+
(
57+
"ring",
58+
"incompatible",
59+
Some("Contains platform-specific assembly"),
60+
Some("aws-lc-rs or rustls"),
61+
None,
62+
),
63+
(
64+
"nix",
65+
"incompatible",
66+
Some("Direct Unix syscall wrappers"),
67+
None,
68+
None,
69+
),
4070
("libc", "shim_compatible", None, None, Some("filesystem")),
4171
];
4272
for (name, verdict, reason, alt, shim) in rust_rules {
43-
rules.insert(name.to_string(), CompatEntry {
44-
name: name.to_string(),
45-
verdict: verdict.to_string(),
46-
reason: reason.map(String::from),
47-
alternative: alt.map(String::from),
48-
shim: shim.map(String::from),
49-
migration_guide: None,
50-
});
73+
rules.insert(
74+
name.to_string(),
75+
CompatEntry {
76+
name: name.to_string(),
77+
verdict: verdict.to_string(),
78+
reason: reason.map(String::from),
79+
alternative: alt.map(String::from),
80+
shim: shim.map(String::from),
81+
migration_guide: None,
82+
},
83+
);
5184
}
5285

5386
// Go ecosystem
5487
let go_rules = vec![
55-
("github.com/gin-gonic/gin", "incompatible", Some("Uses net/http extensively"), Some("TinyGo-compatible HTTP framework"), None),
56-
("github.com/lib/pq", "shim_compatible", Some("Raw TCP via net.Dial"), None, Some("database_proxy")),
57-
("github.com/jackc/pgx", "shim_compatible", Some("TCP sockets"), None, Some("database_proxy")),
58-
("github.com/go-sql-driver/mysql", "shim_compatible", Some("TCP sockets via net.Dial"), None, Some("database_proxy")),
59-
("github.com/redis/go-redis/v9", "shim_compatible", Some("TCP sockets via net.Dial"), None, Some("database_proxy")),
88+
(
89+
"github.com/gin-gonic/gin",
90+
"incompatible",
91+
Some("Uses net/http extensively"),
92+
Some("TinyGo-compatible HTTP framework"),
93+
None,
94+
),
95+
(
96+
"github.com/lib/pq",
97+
"shim_compatible",
98+
Some("Raw TCP via net.Dial"),
99+
None,
100+
Some("database_proxy"),
101+
),
102+
(
103+
"github.com/jackc/pgx",
104+
"shim_compatible",
105+
Some("TCP sockets"),
106+
None,
107+
Some("database_proxy"),
108+
),
109+
(
110+
"github.com/go-sql-driver/mysql",
111+
"shim_compatible",
112+
Some("TCP sockets via net.Dial"),
113+
None,
114+
Some("database_proxy"),
115+
),
116+
(
117+
"github.com/redis/go-redis/v9",
118+
"shim_compatible",
119+
Some("TCP sockets via net.Dial"),
120+
None,
121+
Some("database_proxy"),
122+
),
60123
];
61124
for (name, verdict, reason, alt, shim) in go_rules {
62-
rules.insert(name.to_string(), CompatEntry {
63-
name: name.to_string(),
64-
verdict: verdict.to_string(),
65-
reason: reason.map(String::from),
66-
alternative: alt.map(String::from),
67-
shim: shim.map(String::from),
68-
migration_guide: None,
69-
});
125+
rules.insert(
126+
name.to_string(),
127+
CompatEntry {
128+
name: name.to_string(),
129+
verdict: verdict.to_string(),
130+
reason: reason.map(String::from),
131+
alternative: alt.map(String::from),
132+
shim: shim.map(String::from),
133+
migration_guide: None,
134+
},
135+
);
70136
}
71137

72138
// TypeScript ecosystem
73139
let ts_rules = vec![
74140
("express", "compatible", None, None, None),
75141
("hono", "compatible", None, None, None),
76-
("sharp", "incompatible", Some("Native C++ binding (libvips)"), Some("wasm-vips"), None),
77-
("bcrypt", "incompatible", Some("Native C binding"), Some("bcryptjs"), None),
78-
("better-sqlite3", "incompatible", Some("Native C binding"), Some("sql.js"), None),
79-
("pg", "shim_compatible", Some("TCP sockets"), None, Some("database_proxy")),
142+
(
143+
"sharp",
144+
"incompatible",
145+
Some("Native C++ binding (libvips)"),
146+
Some("wasm-vips"),
147+
None,
148+
),
149+
(
150+
"bcrypt",
151+
"incompatible",
152+
Some("Native C binding"),
153+
Some("bcryptjs"),
154+
None,
155+
),
156+
(
157+
"better-sqlite3",
158+
"incompatible",
159+
Some("Native C binding"),
160+
Some("sql.js"),
161+
None,
162+
),
163+
(
164+
"pg",
165+
"shim_compatible",
166+
Some("TCP sockets"),
167+
None,
168+
Some("database_proxy"),
169+
),
80170
];
81171
for (name, verdict, reason, alt, shim) in ts_rules {
82-
rules.insert(name.to_string(), CompatEntry {
83-
name: name.to_string(),
84-
verdict: verdict.to_string(),
85-
reason: reason.map(String::from),
86-
alternative: alt.map(String::from),
87-
shim: shim.map(String::from),
88-
migration_guide: None,
89-
});
172+
rules.insert(
173+
name.to_string(),
174+
CompatEntry {
175+
name: name.to_string(),
176+
verdict: verdict.to_string(),
177+
reason: reason.map(String::from),
178+
alternative: alt.map(String::from),
179+
shim: shim.map(String::from),
180+
migration_guide: None,
181+
},
182+
);
90183
}
91184

92185
rules
@@ -149,7 +242,9 @@ pub fn evaluate_dependencies(
149242
blockers.push(Blocker {
150243
dependency: dep.name.clone(),
151244
reason: entry.reason.clone().unwrap_or_default(),
152-
fix: entry.alternative.as_ref()
245+
fix: entry
246+
.alternative
247+
.as_ref()
153248
.map(|a| format!("Replace with: {a}"))
154249
.unwrap_or_else(|| "No known alternative".to_string()),
155250
effort_hours: Some(2.0),
@@ -239,7 +334,10 @@ mod tests {
239334
let rules = bun_compat_rules();
240335
assert!(!rules.is_empty(), "Bun compat rules should not be empty");
241336
assert!(rules.contains_key("hono"), "Should contain hono");
242-
assert!(rules.contains_key("marked"), "Should contain marked (failing)");
337+
assert!(
338+
rules.contains_key("marked"),
339+
"Should contain marked (failing)"
340+
);
243341
}
244342

245343
#[test]
@@ -270,10 +368,10 @@ mod tests {
270368
#[test]
271369
fn test_bun_mixed_deps() {
272370
let deps = vec![
273-
make_dep("hono"), // pass
274-
make_dep("zod"), // pass
275-
make_dep("marked"), // fail
276-
make_dep("unknown"), // not in DB
371+
make_dep("hono"), // pass
372+
make_dep("zod"), // pass
373+
make_dep("marked"), // fail
374+
make_dep("unknown"), // not in DB
277375
];
278376
let (blockers, _) = evaluate_dependencies(&deps, "bun");
279377
assert_eq!(blockers.len(), 1);

crates/warp-analyzer/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ pub fn analyze(path: &Path, lang_override: Option<&str>) -> Result<AnalysisRepor
6262
);
6363

6464
Ok(AnalysisReport {
65-
project_name: path.file_name()
65+
project_name: path
66+
.file_name()
6667
.and_then(|n| n.to_str())
6768
.unwrap_or("unknown")
6869
.to_string(),

crates/warp-analyzer/src/report.rs

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ pub fn format_report(report: &AnalysisReport) -> String {
1010
out.push_str(&format!("╠══════════════════════════════════════════╣\n"));
1111
out.push_str(&format!("║ Project: {:<29}║\n", report.project_name));
1212
out.push_str(&format!("║ Language: {:<29}║\n", report.language));
13-
out.push_str(&format!("║ Verdict: {:<29}║\n", report.overall_verdict.label()));
13+
out.push_str(&format!(
14+
"║ Verdict: {:<29}║\n",
15+
report.overall_verdict.label()
16+
));
1417
out.push_str(&format!("╚══════════════════════════════════════════╝\n\n"));
1518

1619
let total = report.dependencies.len();
@@ -74,17 +77,37 @@ fn format_bun_compat_table(out: &mut String, report: &AnalysisReport) {
7477
.collect();
7578

7679
out.push_str("Bun Compatibility Table:\n\n");
77-
out.push_str(" ┌──────────────────────────┬──────────┬──────────────┬─────────────────────────┐\n");
78-
out.push_str(" │ Package │ Version │ Status │ Notes │\n");
79-
out.push_str(" ├──────────────────────────┼──────────┼──────────────┼─────────────────────────┤\n");
80+
out.push_str(
81+
" ┌──────────────────────────┬──────────┬──────────────┬─────────────────────────┐\n",
82+
);
83+
out.push_str(
84+
" │ Package │ Version │ Status │ Notes │\n",
85+
);
86+
out.push_str(
87+
" ├──────────────────────────┼──────────┼──────────────┼─────────────────────────┤\n",
88+
);
8089

8190
for dep in &report.dependencies {
8291
let version = dep.version.as_deref().unwrap_or("-");
8392
let (status, notes) = if let Some(entry) = bun_db.get(&dep.name) {
8493
if entry.status == "pass" {
85-
("✅ pass", format!("bundle:{} componentize:{}", ok_str(entry.bundle_ok), ok_str(entry.componentize_ok)))
94+
(
95+
"✅ pass",
96+
format!(
97+
"bundle:{} componentize:{}",
98+
ok_str(entry.bundle_ok),
99+
ok_str(entry.componentize_ok)
100+
),
101+
)
86102
} else {
87-
("❌ fail", format!("bundle:{} componentize:{}", ok_str(entry.bundle_ok), ok_str(entry.componentize_ok)))
103+
(
104+
"❌ fail",
105+
format!(
106+
"bundle:{} componentize:{}",
107+
ok_str(entry.bundle_ok),
108+
ok_str(entry.componentize_ok)
109+
),
110+
)
88111
}
89112
} else if blocker_set.contains(dep.name.as_str()) {
90113
("❌ fail", "blocked".to_string())
@@ -101,7 +124,9 @@ fn format_bun_compat_table(out: &mut String, report: &AnalysisReport) {
101124
));
102125
}
103126

104-
out.push_str(" └──────────────────────────┴──────────┴──────────────┴─────────────────────────┘\n\n");
127+
out.push_str(
128+
" └──────────────────────────┴──────────┴──────────────┴─────────────────────────┘\n\n",
129+
);
105130
}
106131

107132
fn ok_str(ok: bool) -> &'static str {
@@ -134,5 +159,8 @@ struct BunTableFile {
134159
fn load_bun_table_entries() -> std::collections::HashMap<String, BunTableEntry> {
135160
const BUN_JSON: &str = include_str!("../../../compat-db/bun/results.json");
136161
let file: BunTableFile = serde_json::from_str(BUN_JSON).expect("invalid results.json");
137-
file.results.into_iter().map(|e| (e.name.clone(), e)).collect()
162+
file.results
163+
.into_iter()
164+
.map(|e| (e.name.clone(), e))
165+
.collect()
138166
}

0 commit comments

Comments
 (0)