Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ supabase/.seed/

*storybook.log
.cache/
.dprint-cache/

internal
.turbo
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"@sentry/react": "^8.55.0",
"@supabase/supabase-js": "^2.95.3",
"@t3-oss/env-core": "^0.13.10",
"@tailwindcss/postcss": "^4.1.18",
"@tanstack/react-form": "^1.28.0",
"@tanstack/react-query": "^5.90.20",
"@tanstack/react-router": "^1.159.5",
Expand Down
64 changes: 64 additions & 0 deletions apps/desktop/src-tauri/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,70 @@
fn ensure_permission_files_exist() {
// Handle missing permission files referenced by DEP_* env vars
for (key, value) in std::env::vars_os() {
let key_str = key.to_string_lossy();
if key_str.starts_with("DEP_")
&& (key_str.ends_with("_PERMISSION_FILES_PATH")
|| key_str.ends_with("_GLOBAL_SCOPE_SCHEMA_PATH"))
{
let path = std::path::PathBuf::from(&value);
if !path.exists() {
if let Some(parent) = path.parent() {
let _ = std::fs::create_dir_all(parent);
}
if key_str.ends_with("_PERMISSION_FILES_PATH") {
let _ = std::fs::write(&path, "[]");
} else {
let _ = std::fs::write(&path, "{}");
}
}
}
}

// Also scan the build directory for stale tauri outputs with missing permission files.
// This handles cases where folder renames invalidate cached build artifacts.
let out_dir = match std::env::var("OUT_DIR") {
Ok(d) => std::path::PathBuf::from(d),
Err(_) => return,
};
let build_dir = match out_dir.parent().and_then(|p| p.parent()) {
Some(d) => d.to_path_buf(),
None => return,
};
let entries = match std::fs::read_dir(&build_dir) {
Ok(e) => e,
Err(_) => return,
};
for entry in entries.flatten() {
let name = entry.file_name();
let name_str = name.to_string_lossy();
if !name_str.starts_with("tauri-") || name_str.starts_with("tauri-build-") {
continue;
}
let out_subdir = entry.path().join("out");
if !out_subdir.is_dir() {
continue;
}
// Find expected permission files by checking if the out dir is nearly empty
let has_permission_file = std::fs::read_dir(&out_subdir)
.map(|rd| {
rd.flatten().any(|e| {
e.file_name()
.to_string_lossy()
.ends_with("permission-files")
})
})
.unwrap_or(false);
if !has_permission_file {
// Remove stale build directory to force cargo to re-run the build script
let _ = std::fs::remove_dir_all(entry.path());
}
}
}

fn main() {
#[cfg(target_os = "macos")]
println!("cargo:rustc-link-arg=-fapple-link-rtlib");

ensure_permission_files_exist();
tauri_build::build()
}
12 changes: 0 additions & 12 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@
"permissions": [
"core:default",
"core:window:default",
"core:window:allow-start-dragging",
"core:window:allow-set-fullscreen",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-close",
"core:window:allow-show",
"core:window:allow-center",
"core:window:allow-set-size",
"core:window:allow-set-focus",
"core:window:allow-set-position",
"core:window:allow-is-maximized",
"core:window:allow-toggle-maximize",
"apple-calendar:default",
"apple-contact:default",
"audio-priority:default",
Expand Down
Loading