-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCargo.toml
More file actions
103 lines (93 loc) · 5.58 KB
/
Copy pathCargo.toml
File metadata and controls
103 lines (93 loc) · 5.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[package]
name = "{{project-name}}"
version = "0.1.0"
edition = "2021"
description = "An omakase native desktop app starter (macOS + Linux) on GPUI + gpui-component. Fork it, rename it, ship it."
license = "0BSD"
default-run = "{{project-name}}"
[[bin]]
name = "{{project-name}}"
path = "src/main.rs"
# Lint policy lives in the manifest (not just CI flags) so rust-analyzer and `cargo check` surface
# the same rules CI enforces — zero feedback latency for an agent. Deck is a SINGLE crate (no
# [workspace]), so these go directly under the package as [lints.rust] / [lints.clippy] — NOT
# [workspace.lints] and NOT `[lints] workspace = true` (that indirection is only for multi-crate
# workspaces). Rationale + the deliberately-rejected lints: docs/AGENTIC-ENGINEERING.md.
[lints.rust]
unused_must_use = "deny" # an ignored Result from a fallible IO/serde call is a silent bug
# deny, NOT forbid: Deck has zero unsafe today; deny still compiles and leaves a reviewed escape
# hatch (// SAFETY: + scoped #[allow(unsafe_code)]) if a future objc2 bump needs raw unsafe in the
# tray path. forbid cannot be locally overridden, so it would brick that build with no way out.
unsafe_code = "deny"
[lints.clippy]
# priority = -1 is REQUIRED on a lint *group* so the individual lints below can still override it.
# warn here (not deny) + `-D warnings` in CI is the reth/alloy convention: a toolchain bump that
# adds new clippy lints then can't brick local `cargo build` — only CI goes red.
all = { level = "warn", priority = -1 }
todo = "deny" # a stray todo!() left on a code path panics in production
dbg_macro = "deny" # dbg! debug noise left behind by an agent
[dependencies]
# Fresh GPUI, straight from Zed's git — the DEFAULT channel (Metal on macOS, wgpu on
# Linux). `gpui-component` is developed against Zed's gpui HEAD, so the only way to pair
# fresh gpui with the component kit is this matched git pair. Reproducibility comes from
# the committed Cargo.lock (it pins exact commits); bump on a cadence with `just bump-gpui`.
# Prefer the simpler-but-stale pure-crates.io pair instead? See docs/UPGRADING.md.
gpui = { git = "https://github.com/zed-industries/zed" }
# After Zed split gpui into multiple crates, the windowing + renderer backend (and the
# `Application` bootstrap) live in `gpui_platform`.
gpui_platform = { git = "https://github.com/zed-industries/zed", features = ["font-kit"] }
gpui-component = { git = "https://github.com/longbridge/gpui-component" }
# Prebuilt asset source: all gpui-component icon SVGs + bundled fonts.
# Register it with `.with_assets(...)` so `IconName::*` renders.
gpui-component-assets = { git = "https://github.com/longbridge/gpui-component" }
# Preferences: serialize a Settings struct to the platform config dir.
serde = { version = "1", features = ["derive"] }
serde_json = "1"
directories = "5"
# --- Optional: menu-bar / tray apps (`--features tray`) — cross-platform ---
# tray-icon draws a native status item on every OS: NSStatusItem (macOS),
# libappindicator / StatusNotifierItem (Linux), Shell_NotifyIcon (Windows).
# There is no second renderer — your windows stay GPUI everywhere.
tray-icon = { version = "0.24", optional = true }
[features]
default = []
tray = ["dep:tray-icon", "dep:objc2", "dep:objc2-app-kit", "dep:objc2-foundation"]
# Floating overlay surfaces (transparent always-on-top PopUp window). macOS-only
# in v1; on Linux it compiles to a no-op (no LayerShell yet). Reuses the SAME
# objc2 stack as `tray` (no new compiled crate) and adds raw-window-handle (rwh
# 0.6 is already in the tree via gpui, so this is a `dep:` surfacing, not a new dep).
overlay = ["dep:objc2", "dep:objc2-app-kit", "dep:objc2-foundation", "dep:raw-window-handle"]
# objc2 is only used to hide the macOS dock icon (tray) and harden the overlay
# panel — pull it on macOS only, so a Linux/Windows `--features tray`/`overlay`
# build never tries to compile Apple crates.
[target.'cfg(target_os = "macos")'.dependencies]
objc2 = { version = "0.6", optional = true }
objc2-app-kit = { version = "0.3", optional = true }
objc2-foundation = { version = "0.3", optional = true }
# Recover the raw NSView from a gpui Window to harden the overlay panel (objc2
# bridge). rwh 0.6.2 is already in Cargo.lock via gpui — no new compiled crate.
raw-window-handle = { version = "0.6", optional = true }
[profile.release]
strip = true
lto = "thin"
codegen-units = 1
# ---------------------------------------------------------------------------
# `cargo bundle` config (batteries included). On macOS → Deck.app; cargo
# bundle can also emit `deb` on Linux. Run `just bundle`.
# cargo install cargo-bundle
# Rebrand: drop a 1024x1024 image at assets/icon-source.png, run `just icon`
# (bakes the macOS squircle + builds icon.icns), then re-bundle.
# ---------------------------------------------------------------------------
[package.metadata.bundle]
name = "{{project-name | title_case}}"
identifier = "{{bundle_qualifier}}.{{bundle_org}}.{{project-name}}"
icon = ["assets/icon.icns"]
category = "public.app-category.productivity"
short_description = "A small, snappy native desktop app starter built on GPUI."
long_description = "{{project-name | title_case}} — a native desktop app built on GPUI + gpui-component for macOS and Linux."
osx_minimum_system_version = "11.0"
# Ship the notices alongside the binary: Apache-2.0 §4 and ISC require their
# notices to travel with redistributed binaries, so cargo-bundle copies these
# into the .app / .deb.
resources = ["NOTICE", "LICENSE"]
copyright = "Copyright (c) 2026 {{project-name | title_case}} contributors. 0BSD. Bundles Apache-2.0/ISC/GPL-3.0-or-later third-party code; see NOTICE."