mirror of
https://github.com/storytold/craft-launcher.git
synced 2026-11-16 15:14:56 +00:00
Merge main into release
This commit is contained in:
6 files changed
+33
-61
No files matched your search
@@ -15,7 +15,7 @@
|
||||
|
||||
<p align="center">
|
||||
<b>One place to install, update and open every app in the Craft App Suite, rebuilt in pure Rust.</b><br>
|
||||
ArtCraft Studio, PhotoCraft, LightCraft, FilmCraft, DesignCraft, VectorCraft, PdfCraft, EffectCraft, WordCraft,<br>
|
||||
PhotoCraft, LightCraft, FilmCraft, DesignCraft, VectorCraft, PdfCraft, EffectCraft, WordCraft,<br>
|
||||
DeckCraft, GridCraft, CADCraft, SoundCraft, FigCraft, Craft Anything, TextureCraft, MaterialCraft and the community app SolidCraft: the right build for your computer, kept up to date.
|
||||
</p>
|
||||
|
||||
@@ -266,7 +266,6 @@ stand on its own.
|
||||
|
||||
| | App | What it's for | Code | Learn more |
|
||||
|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------|:------------------------------------------------------|:------------------------------------------------------|:-----------------------------------------------------------|
|
||||
| <img src="https://raw.githubusercontent.com/storytold/artcraft/main/crates/desktop/artcraft/icons/64x64.png" alt="" width="32" height="32"> | **ArtCraft Studio** | AI image and video creation | [GitHub](https://github.com/storytold/artcraft) | [Website](https://getartcraft.com) |
|
||||
| <img src="https://raw.githubusercontent.com/storytold/photocraft/main/assets/app-icon/hicolor/64x64/apps/ai.storyteller.photocraft.png" alt="" width="32" height="32"> | **PhotoCraft** | Image editing: layers, masks, type and real PSD files | [GitHub](https://github.com/storytold/photocraft) | [Website](https://getartcraft.com/apps/photocraft) |
|
||||
| <img src="https://raw.githubusercontent.com/storytold/vectorcraft/main/assets/app-icon/hicolor/64x64/apps/ai.storyteller.vectorcraft.png" alt="" width="32" height="32"> | **VectorCraft** | Vector illustration | [GitHub](https://github.com/storytold/vectorcraft) | [Website](https://getartcraft.com/apps/vectorcraft) |
|
||||
| <img src="https://raw.githubusercontent.com/storytold/filmcraft/main/assets/app-icon/hicolor/64x64/apps/ai.storyteller.filmcraft.png" alt="" width="32" height="32"> | **FilmCraft** | Video editing, color and sound | [GitHub](https://github.com/storytold/filmcraft) | [Website](https://getartcraft.com/apps/filmcraft) |
|
||||
|
||||
+27
-23
@@ -147,13 +147,7 @@ const fn app(
|
||||
}
|
||||
|
||||
/// The Craft App Suite, in display order matching getartcraft.com, then the community apps:
|
||||
pub const SUITE: [CraftApp; 18] = [
|
||||
CraftApp {
|
||||
former_names: &["ArtCraft"],
|
||||
mac_bundle_name: Some("ArtCraft"),
|
||||
bundle: Some("ai.artcraft.app"),
|
||||
..app("artcraft", "ArtCraft Studio", "AI image and video creation", [[47, 123, 245], [26, 91, 196], [127, 176, 255]], "storytold/artcraft")
|
||||
},
|
||||
pub const SUITE: [CraftApp; 17] = [
|
||||
app("photocraft", "PhotoCraft", "Image editing", [[0x2f, 0x7b, 0xf5], [0x1a, 0x5b, 0xc4], [0x7f, 0xb0, 0xff]], "storytold/photocraft"),
|
||||
app("vectorcraft", "VectorCraft", "Vector illustration", [[0xe8, 0x57, 0x3f], [0xb8, 0x3a, 0x24], [0xff, 0x8a, 0x70]], "storytold/vectorcraft"),
|
||||
app(
|
||||
@@ -352,17 +346,15 @@ mod tests {
|
||||
|
||||
/// Every catalog entry must have a distinct lookup key.
|
||||
#[test]
|
||||
fn suite_has_eighteen_apps_with_unique_ids() {
|
||||
assert_eq!(SUITE.len(), 18);
|
||||
fn suite_has_seventeen_apps_with_unique_ids() {
|
||||
assert_eq!(SUITE.len(), 17);
|
||||
let mut ids: Vec<_> = SUITE.iter().map(|a| a.id).collect();
|
||||
ids.sort_unstable();
|
||||
ids.dedup();
|
||||
assert_eq!(ids.len(), SUITE.len());
|
||||
for a in &SUITE {
|
||||
// `Craft Anything` is `craft-anything`.
|
||||
if a.id != "artcraft" {
|
||||
assert_eq!(a.name.to_lowercase().replace(' ', "-"), a.id);
|
||||
}
|
||||
assert_eq!(a.name.to_lowercase().replace(' ', "-"), a.id);
|
||||
match a.kind {
|
||||
AppKind::Official => assert_eq!(a.repo, format!("storytold/{}", a.id)),
|
||||
AppKind::Community => assert!(!a.repo.starts_with("storytold/"), "{} is community", a.id),
|
||||
@@ -424,21 +416,33 @@ mod tests {
|
||||
assert_eq!(CraftApp::by_id("wordcraft").unwrap().website(), "https://getartcraft.com/apps/wordcraft");
|
||||
}
|
||||
|
||||
/// ArtCraft Studio is first in the suite, uses `ArtCraft` as its release macOS bundle stem, and skips FreeBSD.
|
||||
/// Apps can specify custom macOS bundle names and platform support.
|
||||
#[test]
|
||||
fn artcraft_studio_does_not_run_on_freebsd() {
|
||||
assert_eq!(SUITE[0].id, "artcraft");
|
||||
let studio = CraftApp::by_id("artcraft").unwrap();
|
||||
assert_eq!(studio.mac_bundle_name(), "ArtCraft");
|
||||
assert_eq!(studio.mac_bundle_names().collect::<Vec<_>>(), ["ArtCraft", "ArtCraft Studio"]);
|
||||
assert!(!studio.runs_on(crate::Os::FreeBsd));
|
||||
assert!(studio.runs_on(crate::Os::Linux));
|
||||
assert!(studio.runs_on(crate::Os::MacOs));
|
||||
assert!(studio.runs_on(crate::Os::Windows));
|
||||
|
||||
fn mac_bundle_names_and_platform_support() {
|
||||
let photo = CraftApp::by_id("photocraft").unwrap();
|
||||
assert_eq!(photo.mac_bundle_name(), "PhotoCraft");
|
||||
assert_eq!(photo.mac_bundle_names().collect::<Vec<_>>(), ["PhotoCraft"]);
|
||||
assert!(photo.runs_on(crate::Os::FreeBsd));
|
||||
assert!(photo.runs_on(crate::Os::Linux));
|
||||
assert!(photo.runs_on(crate::Os::MacOs));
|
||||
assert!(photo.runs_on(crate::Os::Windows));
|
||||
|
||||
let custom = CraftApp {
|
||||
former_names: &["ArtCraft"],
|
||||
mac_bundle_name: Some("ArtCraft"),
|
||||
..app(
|
||||
"artcraft",
|
||||
"ArtCraft Studio",
|
||||
"AI image and video creation",
|
||||
[[47, 123, 245], [26, 91, 196], [127, 176, 255]],
|
||||
"storytold/artcraft",
|
||||
)
|
||||
};
|
||||
assert_eq!(custom.mac_bundle_name(), "ArtCraft");
|
||||
assert_eq!(custom.mac_bundle_names().collect::<Vec<_>>(), ["ArtCraft", "ArtCraft Studio"]);
|
||||
assert!(!custom.runs_on(crate::Os::FreeBsd));
|
||||
assert!(custom.runs_on(crate::Os::Linux));
|
||||
assert!(custom.runs_on(crate::Os::MacOs));
|
||||
assert!(custom.runs_on(crate::Os::Windows));
|
||||
}
|
||||
}
|
||||
@@ -139,15 +139,7 @@ pub fn screenshot_within_budget(bytes: &[u8]) -> bool {
|
||||
/// Where every Craft App runs (getartcraft.com lists the same for each of them).
|
||||
const PLATFORMS: &str = "macOS, Windows, Linux, FreeBSD, web";
|
||||
|
||||
pub const DETAILS: [AppDetails; 18] = [
|
||||
AppDetails {
|
||||
id: "artcraft",
|
||||
headline: "Create images and video with AI.",
|
||||
about: "ArtCraft Studio brings AI image and video generation into a desktop workspace.",
|
||||
features: &[feature("Images and video", "Generate artwork with ArtCraft's connected AI providers.")],
|
||||
shots: &[],
|
||||
platforms: "macOS, Windows, Linux",
|
||||
},
|
||||
pub const DETAILS: [AppDetails; 17] = [
|
||||
AppDetails {
|
||||
id: "photocraft",
|
||||
headline: "The image editor you already know how to use.",
|
||||
|
||||
@@ -2592,15 +2592,15 @@ mod tests {
|
||||
let old = record("0.5.0", PackageKind::PortableZip, dir.path().join("photocraft/photocraft.exe"), vec![], false);
|
||||
assert_eq!(is_occupied(Some(&old)), None);
|
||||
|
||||
let studio = CraftApp::by_id("artcraft").unwrap();
|
||||
let studio = CraftApp { name: "ArtCraft Studio", former_names: &["ArtCraft"], mac_bundle_name: Some("ArtCraft"), ..*app };
|
||||
let dmg_asset = Asset { name: "ArtCraft_0.41.1_universal.dmg".into(), ..Default::default() };
|
||||
assert_eq!(occupied(studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(), None);
|
||||
assert_eq!(occupied(&studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(), None);
|
||||
std::fs::create_dir(dir.path().join("ArtCraft.app")).unwrap();
|
||||
assert_eq!(occupied(studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(), Some(dir.path().join("ArtCraft.app")));
|
||||
assert_eq!(occupied(&studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(), Some(dir.path().join("ArtCraft.app")));
|
||||
std::fs::remove_dir(dir.path().join("ArtCraft.app")).unwrap();
|
||||
std::fs::create_dir(dir.path().join("ArtCraft Studio.app")).unwrap();
|
||||
assert_eq!(
|
||||
occupied(studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(),
|
||||
occupied(&studio, &dmg_asset, PackageKind::Dmg, None, None, &locations, &paths).unwrap(),
|
||||
Some(dir.path().join("ArtCraft Studio.app"))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,9 +19,6 @@ use crate::widgets::{self, Kind};
|
||||
/// The byline that says who makes an app: "by ArtCraft" or "by <publisher>". Official apps take
|
||||
/// the accent colour, community apps the muted one.
|
||||
fn kind_badge(ui: &mut Ui, app: &artcraft_launcher_core::CraftApp, t: &Tokens) {
|
||||
if app.id == "artcraft" {
|
||||
return;
|
||||
}
|
||||
let text = fmt(tl!("by {name}"), &[("name", app.publisher)]);
|
||||
let color = match app.kind {
|
||||
AppKind::Official => t.accent_ink,
|
||||
|
||||
@@ -788,26 +788,6 @@ fn a_freebsd_version_row_sizes_the_tarball() {
|
||||
assert!(facts.ends_with(", 2026 · 140 MB"), "{facts:?}");
|
||||
}
|
||||
|
||||
/// FreeBSD hides ArtCraft Studio while keeping supported Craft Apps visible.
|
||||
#[test]
|
||||
fn freebsd_skips_artcraft_studio() {
|
||||
let freebsd = Platform { os: Os::FreeBsd, arch: Arch::X64 };
|
||||
let (h, _) = harness_full(
|
||||
events(),
|
||||
ViewMode::Grid,
|
||||
egui::Theme::Dark,
|
||||
true,
|
||||
1.0,
|
||||
artcraft_launcher_ui_egui::TitleBar::Native,
|
||||
Rc::default(),
|
||||
Some(freebsd),
|
||||
None,
|
||||
);
|
||||
let ids = h.state().as_ref().unwrap().visible_ids_for_test();
|
||||
assert!(!ids.contains(&"artcraft"), "ArtCraft Studio must be skipped on FreeBSD: {ids:?}");
|
||||
assert!(ids.contains(&"photocraft"), "PhotoCraft remains visible on FreeBSD");
|
||||
}
|
||||
|
||||
/// The launcher's own list in Settings sizes the launcher's download for this machine.
|
||||
#[test]
|
||||
fn the_launcher_version_list_sizes_the_launchers_download() {
|
||||
|
||||
Reference in new issue
Block a user