Repository navigation
Expand file tree
/
Copy pathExampleApp.swift
More file actions
52 lines (49 loc) · 2.13 KB
/
Copy pathExampleApp.swift
File metadata and controls
52 lines (49 loc) · 2.13 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
// The example application: the Storybook (//storybook), compiled for
// every platform. The Storybook apps (com.LoganShire.Storybook,
// "Storybook") are its one cell per platform, each with that platform's
// renderer:
// * examples/apple/storybook_{ios,macos}_application (Apple's SwiftUI)
// * examples/web/storybook_web_application (React)
// * examples/android/storybook_android_application (Compose)
// * examples/linux/storybook_linux_application (OpenGL)
// * examples/windows/storybook_windows_application (DirectX)
// The rest compile the same source as test cells: delivered as wasm
// (example_full_wasm_*, example_full_feature), the web's GPU renderer
// (example_full_webgpu_*), Electron.
#if canImport(ShireworksKit)
import ShireworksKit
#endif
import Storybook
import SwiftUI
@main
struct ExampleApplication: App {
init() {
// The example's host-side dependency injection for compiled cells
// (PlatformServicesInstall.swift); a no-op wherever the host injected first.
installPlatformDependenciesIfNeeded()
}
var body: some Scene {
// The title reaches the host as the document/window/task title.
WindowGroup("Storybook") {
StorybookView()
#if canImport(ShireworksKit)
// Shireworks' kit: the build it is, written for Applications
// at each launch, its update sheet, crash reports, and a
// shake to file an issue for someone signed in to the shared
// GitHub sign-in, where the build carries its keys (CI's:
// ShireworksRepository and the rest, //tools/signing). Only
// the iPhone's and the Mac's Storybook link it: elsewhere
// Applications learns the version otherwise (Android's
// package manager), or not.
.shireworks()
#endif
}
#if os(macOS)
.defaultSize(width: 1280, height: 820)
#endif
#if canImport(ShireworksKit)
// Help › Report a Bug… (⌥⌘B), the shake's twin on the Mac.
.commands { ShakeKitCommands() }
#endif
}
}