openuispec 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/cli/index.ts +4 -2
- package/cli/init.ts +23 -8
- package/docs/cli.md +13 -8
- package/drift/index.ts +41 -15
- package/mcp-server/index.ts +155 -116
- package/mcp-server/screenshot.ts +19 -4
- package/package.json +5 -2
- package/prepare/index.ts +16 -0
- package/scripts/take-all-screenshots.ts +507 -0
- package/status/index.ts +2 -2
- package/examples/social-app/.mcp.json +0 -10
- package/examples/social-app/AGENTS.md +0 -124
- package/examples/social-app/CLAUDE.md +0 -124
- package/examples/social-app/backend/.gitkeep +0 -1
- package/examples/social-app/generated/android/social-app/app/.paparazzi-hashes.json +0 -3
- package/examples/social-app/generated/android/social-app/app/build.gradle.kts +0 -94
- package/examples/social-app/generated/android/social-app/app/src/main/AndroidManifest.xml +0 -26
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/AppContainer.kt +0 -20
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/MainActivity.kt +0 -35
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/SocialAppApplication.kt +0 -13
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/data/MockData.kt +0 -98
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/data/preferences/AppPreferences.kt +0 -19
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/data/preferences/DataStorePreferencesRepository.kt +0 -68
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/data/preferences/PreferencesRepository.kt +0 -15
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/model/Models.kt +0 -34
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/MainShell.kt +0 -390
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/components/Components.kt +0 -234
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/components/ContractPrimitives.kt +0 -641
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/navigation/RootComponent.kt +0 -113
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/ChatDetailScreen.kt +0 -212
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/CreatePostScreen.kt +0 -113
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/DiscoverScreen.kt +0 -137
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/EditProfileScreen.kt +0 -180
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/HomeFeedScreen.kt +0 -169
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/MessagesInboxScreen.kt +0 -85
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/NotificationsScreen.kt +0 -74
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/PostDetailScreen.kt +0 -293
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/ProfileSelfScreen.kt +0 -116
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/SearchResultsScreen.kt +0 -161
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/SettingsScreen.kt +0 -164
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/SettingsStore.kt +0 -95
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/screens/UserProfileScreen.kt +0 -123
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/theme/Color.kt +0 -33
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/theme/Shape.kt +0 -41
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/theme/Spacing.kt +0 -20
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/theme/Theme.kt +0 -82
- package/examples/social-app/generated/android/social-app/app/src/main/java/com/social/app/ui/theme/Type.kt +0 -60
- package/examples/social-app/generated/android/social-app/app/src/main/res/drawable/ic_launcher_foreground.xml +0 -9
- package/examples/social-app/generated/android/social-app/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +0 -5
- package/examples/social-app/generated/android/social-app/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +0 -5
- package/examples/social-app/generated/android/social-app/app/src/main/res/values/strings.xml +0 -91
- package/examples/social-app/generated/android/social-app/app/src/main/res/values/themes.xml +0 -10
- package/examples/social-app/generated/android/social-app/app/src/main/res/values-ru/strings.xml +0 -79
- package/examples/social-app/generated/android/social-app/app/src/main/res/values-uz/strings.xml +0 -79
- package/examples/social-app/generated/android/social-app/app/src/main/xml/AndroidManifest.xml +0 -23
- package/examples/social-app/generated/android/social-app/app/src/test/kotlin/com/social/app/screenshots/HomeFeedScreenshotTest.kt +0 -34
- package/examples/social-app/generated/android/social-app/build.gradle.kts +0 -7
- package/examples/social-app/generated/android/social-app/gradle/libs.versions.toml +0 -50
- package/examples/social-app/generated/android/social-app/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/social-app/generated/android/social-app/gradle/wrapper/gradle-wrapper.properties +0 -8
- package/examples/social-app/generated/android/social-app/gradle.properties +0 -11
- package/examples/social-app/generated/android/social-app/gradlew +0 -248
- package/examples/social-app/generated/android/social-app/settings.gradle.kts +0 -27
- package/examples/social-app/generated/web/social-app/index.html +0 -12
- package/examples/social-app/generated/web/social-app/package-lock.json +0 -2517
- package/examples/social-app/generated/web/social-app/package.json +0 -27
- package/examples/social-app/generated/web/social-app/src/app/App.tsx +0 -58
- package/examples/social-app/generated/web/social-app/src/components/Shell.tsx +0 -259
- package/examples/social-app/generated/web/social-app/src/components/cards.tsx +0 -317
- package/examples/social-app/generated/web/social-app/src/components/ui.tsx +0 -340
- package/examples/social-app/generated/web/social-app/src/flows/CreatePostFlow.tsx +0 -86
- package/examples/social-app/generated/web/social-app/src/i18n.tsx +0 -59
- package/examples/social-app/generated/web/social-app/src/lib/icons.tsx +0 -85
- package/examples/social-app/generated/web/social-app/src/lib/tokens.ts +0 -70
- package/examples/social-app/generated/web/social-app/src/lib/utils.ts +0 -97
- package/examples/social-app/generated/web/social-app/src/locales/en.json +0 -67
- package/examples/social-app/generated/web/social-app/src/locales/ru.json +0 -67
- package/examples/social-app/generated/web/social-app/src/locales/uz.json +0 -67
- package/examples/social-app/generated/web/social-app/src/main.tsx +0 -16
- package/examples/social-app/generated/web/social-app/src/screens/ChatDetailScreen.tsx +0 -90
- package/examples/social-app/generated/web/social-app/src/screens/DiscoverScreen.tsx +0 -86
- package/examples/social-app/generated/web/social-app/src/screens/EditProfileScreen.tsx +0 -57
- package/examples/social-app/generated/web/social-app/src/screens/HomeFeedScreen.tsx +0 -103
- package/examples/social-app/generated/web/social-app/src/screens/MessagesInboxScreen.tsx +0 -52
- package/examples/social-app/generated/web/social-app/src/screens/NotificationsScreen.tsx +0 -41
- package/examples/social-app/generated/web/social-app/src/screens/PostDetailScreen.tsx +0 -115
- package/examples/social-app/generated/web/social-app/src/screens/ProfileSelfScreen.tsx +0 -57
- package/examples/social-app/generated/web/social-app/src/screens/ProfileUserScreen.tsx +0 -76
- package/examples/social-app/generated/web/social-app/src/screens/SearchResultsScreen.tsx +0 -96
- package/examples/social-app/generated/web/social-app/src/screens/SettingsScreen.tsx +0 -79
- package/examples/social-app/generated/web/social-app/src/state/store.ts +0 -592
- package/examples/social-app/generated/web/social-app/src/styles.css +0 -125
- package/examples/social-app/generated/web/social-app/src/vite-env.d.ts +0 -1
- package/examples/social-app/generated/web/social-app/tsconfig.json +0 -22
- package/examples/social-app/generated/web/social-app/tsconfig.node.json +0 -13
- package/examples/social-app/generated/web/social-app/tsconfig.node.tsbuildinfo +0 -1
- package/examples/social-app/generated/web/social-app/tsconfig.tsbuildinfo +0 -1
- package/examples/social-app/generated/web/social-app/vite.config.d.ts +0 -2
- package/examples/social-app/generated/web/social-app/vite.config.js +0 -6
- package/examples/social-app/generated/web/social-app/vite.config.ts +0 -7
- package/examples/social-app/package.json +0 -13
- package/examples/social-app/take-web-screenshots.ts +0 -97
- package/examples/taskflow/.codex/config.toml +0 -4
- package/examples/taskflow/.mcp.json +0 -10
- package/examples/taskflow/AGENTS.md +0 -124
- package/examples/taskflow/CLAUDE.md +0 -124
- package/examples/taskflow/backend/.gitkeep +0 -1
- package/examples/taskflow/generated/android/TaskFlow/README.md +0 -43
- package/examples/taskflow/generated/android/TaskFlow/app/build.gradle.kts +0 -76
- package/examples/taskflow/generated/android/TaskFlow/app/proguard-rules.pro +0 -1
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/AndroidManifest.xml +0 -21
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/MainActivity.kt +0 -19
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/TaskFlowApp.kt +0 -283
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/model/DomainModels.kt +0 -106
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/model/SampleData.kt +0 -57
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/components/Common.kt +0 -109
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/screens/HomeScreen.kt +0 -112
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/screens/ProjectsScreen.kt +0 -61
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/screens/SettingsScreen.kt +0 -82
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/screens/TaskDetailScreen.kt +0 -111
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/sheets/Sheets.kt +0 -77
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/theme/Color.kt +0 -30
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/theme/Theme.kt +0 -86
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/java/uz/rsteam/taskflow/ui/theme/Type.kt +0 -57
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/res/values/strings.xml +0 -155
- package/examples/taskflow/generated/android/TaskFlow/app/src/main/res/values/themes.xml +0 -4
- package/examples/taskflow/generated/android/TaskFlow/build.gradle.kts +0 -5
- package/examples/taskflow/generated/android/TaskFlow/gradle/gradle-daemon-jvm.properties +0 -12
- package/examples/taskflow/generated/android/TaskFlow/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/taskflow/generated/android/TaskFlow/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/examples/taskflow/generated/android/TaskFlow/gradle.properties +0 -4
- package/examples/taskflow/generated/android/TaskFlow/gradlew +0 -18
- package/examples/taskflow/generated/android/TaskFlow/gradlew.bat +0 -12
- package/examples/taskflow/generated/android/TaskFlow/settings.gradle.kts +0 -18
- package/examples/taskflow/generated/ios/TaskFlow/README.md +0 -21
- package/examples/taskflow/generated/ios/TaskFlow/Resources/en.lproj/Localizable.strings +0 -115
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/App/TaskFlowApp.swift +0 -24
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Components/AppChrome.swift +0 -150
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Flows/TaskEditorSheet.swift +0 -220
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Models/DomainModels.swift +0 -122
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/CalendarView.swift +0 -21
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/HomeView.swift +0 -201
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/ProfileEditView.swift +0 -48
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/ProjectDetailView.swift +0 -59
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/ProjectsView.swift +0 -63
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/SettingsView.swift +0 -85
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Screens/TaskDetailView.swift +0 -219
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Support/AppModel.swift +0 -320
- package/examples/taskflow/generated/ios/TaskFlow/Sources/TaskFlow/Support/AppSupport.swift +0 -41
- package/examples/taskflow/generated/ios/TaskFlow/project.yml +0 -31
- package/examples/taskflow/generated/web/TaskFlow/README.md +0 -19
- package/examples/taskflow/generated/web/TaskFlow/index.html +0 -12
- package/examples/taskflow/generated/web/TaskFlow/package-lock.json +0 -1908
- package/examples/taskflow/generated/web/TaskFlow/package.json +0 -24
- package/examples/taskflow/generated/web/TaskFlow/src/App.tsx +0 -58
- package/examples/taskflow/generated/web/TaskFlow/src/AppShell.tsx +0 -55
- package/examples/taskflow/generated/web/TaskFlow/src/components/Common.tsx +0 -82
- package/examples/taskflow/generated/web/TaskFlow/src/components/Modals.tsx +0 -191
- package/examples/taskflow/generated/web/TaskFlow/src/components/Nav.tsx +0 -41
- package/examples/taskflow/generated/web/TaskFlow/src/generated/messages.ts +0 -131
- package/examples/taskflow/generated/web/TaskFlow/src/hooks.ts +0 -25
- package/examples/taskflow/generated/web/TaskFlow/src/i18n.ts +0 -39
- package/examples/taskflow/generated/web/TaskFlow/src/locales.en.json +0 -111
- package/examples/taskflow/generated/web/TaskFlow/src/main.tsx +0 -13
- package/examples/taskflow/generated/web/TaskFlow/src/screens/HomeScreen.tsx +0 -111
- package/examples/taskflow/generated/web/TaskFlow/src/screens/ProjectsScreen.tsx +0 -82
- package/examples/taskflow/generated/web/TaskFlow/src/screens/SettingsScreens.tsx +0 -132
- package/examples/taskflow/generated/web/TaskFlow/src/screens/TaskDetail.tsx +0 -105
- package/examples/taskflow/generated/web/TaskFlow/src/store.ts +0 -216
- package/examples/taskflow/generated/web/TaskFlow/src/styles.css +0 -617
- package/examples/taskflow/generated/web/TaskFlow/src/types.ts +0 -64
- package/examples/taskflow/generated/web/TaskFlow/src/utils.ts +0 -78
- package/examples/taskflow/generated/web/TaskFlow/tsconfig.json +0 -21
- package/examples/taskflow/generated/web/TaskFlow/vite.config.ts +0 -6
- package/examples/todo-orbit/.codex/config.toml +0 -4
- package/examples/todo-orbit/.mcp.json +0 -10
- package/examples/todo-orbit/AGENTS.md +0 -124
- package/examples/todo-orbit/CLAUDE.md +0 -124
- package/examples/todo-orbit/backend/.gitkeep +0 -1
- package/examples/todo-orbit/generated/android/Todo Orbit/README.md +0 -14
- package/examples/todo-orbit/generated/android/Todo Orbit/app/build.gradle.kts +0 -58
- package/examples/todo-orbit/generated/android/Todo Orbit/app/proguard-rules.pro +0 -1
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/AndroidManifest.xml +0 -20
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/MainActivity.kt +0 -14
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/TodoOrbitApp.kt +0 -345
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/support/AppLogic.kt +0 -231
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/support/Models.kt +0 -169
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/support/Strings.kt +0 -8
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/components/CommonComponents.kt +0 -236
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/screens/AnalyticsScreen.kt +0 -193
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/screens/SettingsScreen.kt +0 -102
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/screens/TasksScreen.kt +0 -347
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/sheets/EditorSheets.kt +0 -347
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/java/uz/rsteam/todoorbit/ui/theme/TodoOrbitTheme.kt +0 -59
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/res/values/strings.xml +0 -149
- package/examples/todo-orbit/generated/android/Todo Orbit/app/src/main/res/values-ru/strings.xml +0 -155
- package/examples/todo-orbit/generated/android/Todo Orbit/build.gradle.kts +0 -4
- package/examples/todo-orbit/generated/android/Todo Orbit/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/todo-orbit/generated/android/Todo Orbit/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/examples/todo-orbit/generated/android/Todo Orbit/gradle.properties +0 -4
- package/examples/todo-orbit/generated/android/Todo Orbit/gradlew +0 -248
- package/examples/todo-orbit/generated/android/Todo Orbit/gradlew.bat +0 -93
- package/examples/todo-orbit/generated/android/Todo Orbit/settings.gradle.kts +0 -18
- package/examples/todo-orbit/generated/ios/Todo Orbit/.screenshot-uitest/Sources/ScreenshotUITest.swift +0 -36
- package/examples/todo-orbit/generated/ios/Todo Orbit/README.md +0 -29
- package/examples/todo-orbit/generated/ios/Todo Orbit/Resources/en.lproj/Localizable.strings +0 -119
- package/examples/todo-orbit/generated/ios/Todo Orbit/Resources/ru.lproj/Localizable.strings +0 -119
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/App/TodoOrbitApp.swift +0 -50
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Components/OrbitChrome.swift +0 -204
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Components/SchedulePreviewView.swift +0 -126
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Components/TrendChartView.swift +0 -70
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Flows/RecurringRuleSheet.swift +0 -126
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Flows/TaskEditorSheet.swift +0 -61
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Models/DomainModels.swift +0 -238
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Screens/AnalyticsView.swift +0 -94
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Screens/SettingsView.swift +0 -76
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Screens/TasksHomeView.swift +0 -364
- package/examples/todo-orbit/generated/ios/Todo Orbit/Sources/TodoOrbit/Support/AppModel.swift +0 -324
- package/examples/todo-orbit/generated/ios/Todo Orbit/TodoOrbit.xcodeproj/project.pbxproj +0 -439
- package/examples/todo-orbit/generated/ios/Todo Orbit/TodoOrbit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/examples/todo-orbit/generated/ios/Todo Orbit/TodoOrbit.xcodeproj/xcshareddata/xcschemes/TodoOrbit.xcscheme +0 -89
- package/examples/todo-orbit/generated/ios/Todo Orbit/project.yml +0 -32
- package/examples/todo-orbit/generated/web/Todo Orbit/index.html +0 -16
- package/examples/todo-orbit/generated/web/Todo Orbit/package-lock.json +0 -1087
- package/examples/todo-orbit/generated/web/Todo Orbit/package.json +0 -24
- package/examples/todo-orbit/generated/web/Todo Orbit/src/App.tsx +0 -2167
- package/examples/todo-orbit/generated/web/Todo Orbit/src/main.tsx +0 -13
- package/examples/todo-orbit/generated/web/Todo Orbit/src/styles.css +0 -926
- package/examples/todo-orbit/generated/web/Todo Orbit/tsconfig.json +0 -19
- package/examples/todo-orbit/generated/web/Todo Orbit/vite.config.ts +0 -6
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
#!/usr/bin/env npx tsx
|
|
2
|
+
/**
|
|
3
|
+
* Takes screenshots of all generated targets across all example projects.
|
|
4
|
+
* Outputs to artifacts/<project>/screenshots/<platform>-<screen>.png
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* npx tsx scripts/take-all-screenshots.ts # per-screen mode (manual nav)
|
|
8
|
+
* npx tsx scripts/take-all-screenshots.ts --batch # batch mode (build once, capture many)
|
|
9
|
+
*
|
|
10
|
+
* Requires: puppeteer, running Android emulator, booted iOS simulator.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { spawn } from "node:child_process";
|
|
14
|
+
import { exec as execCb } from "node:child_process";
|
|
15
|
+
import { promisify } from "node:util";
|
|
16
|
+
import { mkdirSync, existsSync, readFileSync, writeFileSync, readdirSync } from "node:fs";
|
|
17
|
+
import { join, resolve } from "node:path";
|
|
18
|
+
import type { ChildProcess } from "node:child_process";
|
|
19
|
+
|
|
20
|
+
// Import helpers from mcp-server modules (per-screen mode)
|
|
21
|
+
import {
|
|
22
|
+
findAdb,
|
|
23
|
+
getConnectedEmulator,
|
|
24
|
+
adbShell,
|
|
25
|
+
extractAppInfo as extractAndroidAppInfo,
|
|
26
|
+
buildApk,
|
|
27
|
+
navigateByTaps,
|
|
28
|
+
captureScreenshot as captureAndroidScreenshot,
|
|
29
|
+
cleanEmulatorStorage,
|
|
30
|
+
} from "../mcp-server/screenshot-android.js";
|
|
31
|
+
import {
|
|
32
|
+
type IOSAppInfo,
|
|
33
|
+
extractAppInfo as extractIOSAppInfo,
|
|
34
|
+
findSimulator,
|
|
35
|
+
buildApp as buildIOSApp,
|
|
36
|
+
findAppBundle,
|
|
37
|
+
installAndLaunch as installAndLaunchIOS,
|
|
38
|
+
captureScreenshot as captureIOSScreenshot,
|
|
39
|
+
generateUITestTargetYml,
|
|
40
|
+
insertUITestTarget,
|
|
41
|
+
ensureInfoPlistFlag,
|
|
42
|
+
} from "../mcp-server/screenshot-ios.js";
|
|
43
|
+
|
|
44
|
+
// Import batch functions
|
|
45
|
+
import { takeScreenshotBatch } from "../mcp-server/screenshot.js";
|
|
46
|
+
import { takeAndroidScreenshotBatch } from "../mcp-server/screenshot-android.js";
|
|
47
|
+
import { takeIOSScreenshotBatch } from "../mcp-server/screenshot-ios.js";
|
|
48
|
+
|
|
49
|
+
const exec = promisify(execCb);
|
|
50
|
+
|
|
51
|
+
const ROOT = resolve(import.meta.dirname!, "..");
|
|
52
|
+
const ARTIFACTS = join(ROOT, "artifacts");
|
|
53
|
+
const BATCH_MODE = process.argv.includes("--batch");
|
|
54
|
+
const PLATFORM_FILTER = (() => {
|
|
55
|
+
const idx = process.argv.indexOf("--platform");
|
|
56
|
+
return idx >= 0 ? process.argv[idx + 1]?.toLowerCase() : null;
|
|
57
|
+
})();
|
|
58
|
+
|
|
59
|
+
// ── Project definitions ──────────────────────────────────────────────
|
|
60
|
+
|
|
61
|
+
interface WebScreen { name: string; route: string }
|
|
62
|
+
interface NativeScreen { name: string; route?: string; nav?: string[] }
|
|
63
|
+
|
|
64
|
+
interface ProjectDef {
|
|
65
|
+
name: string;
|
|
66
|
+
web?: { dir: string; screens: WebScreen[] };
|
|
67
|
+
android?: { dir: string; screens: NativeScreen[] };
|
|
68
|
+
ios?: { dir: string; screens: NativeScreen[] };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const PROJECTS: ProjectDef[] = [
|
|
72
|
+
{
|
|
73
|
+
name: "social-app",
|
|
74
|
+
web: {
|
|
75
|
+
dir: "examples/social-app/generated/web/social-app",
|
|
76
|
+
screens: [
|
|
77
|
+
{ name: "home", route: "/home" },
|
|
78
|
+
{ name: "discover", route: "/discover" },
|
|
79
|
+
{ name: "notifications", route: "/notifications" },
|
|
80
|
+
{ name: "messages", route: "/messages" },
|
|
81
|
+
{ name: "profile", route: "/profile" },
|
|
82
|
+
{ name: "settings", route: "/settings" },
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
android: {
|
|
86
|
+
dir: "examples/social-app/generated/android/social-app",
|
|
87
|
+
screens: [
|
|
88
|
+
{ name: "home", route: "socialapp://home" },
|
|
89
|
+
{ name: "discover", route: "socialapp://discover" },
|
|
90
|
+
{ name: "notifications", route: "socialapp://notifications" },
|
|
91
|
+
{ name: "messages", route: "socialapp://messages" },
|
|
92
|
+
{ name: "profile", route: "socialapp://profile" },
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "todo-orbit",
|
|
98
|
+
web: {
|
|
99
|
+
dir: "examples/todo-orbit/generated/web/Todo Orbit",
|
|
100
|
+
screens: [
|
|
101
|
+
{ name: "home", route: "/" },
|
|
102
|
+
{ name: "analytics", route: "/analytics" },
|
|
103
|
+
{ name: "settings", route: "/settings" },
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
android: {
|
|
107
|
+
dir: "examples/todo-orbit/generated/android/Todo Orbit",
|
|
108
|
+
screens: [
|
|
109
|
+
{ name: "home" },
|
|
110
|
+
{ name: "analytics", nav: ["Analytics"] },
|
|
111
|
+
{ name: "settings", nav: ["Settings"] },
|
|
112
|
+
],
|
|
113
|
+
},
|
|
114
|
+
ios: {
|
|
115
|
+
dir: "examples/todo-orbit/generated/ios/Todo Orbit",
|
|
116
|
+
screens: [
|
|
117
|
+
{ name: "home" },
|
|
118
|
+
{ name: "analytics", nav: ["Analytics"] },
|
|
119
|
+
{ name: "settings", nav: ["Settings"] },
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "taskflow",
|
|
125
|
+
web: {
|
|
126
|
+
dir: "examples/taskflow/generated/web/TaskFlow",
|
|
127
|
+
screens: [
|
|
128
|
+
{ name: "home", route: "/tasks" },
|
|
129
|
+
{ name: "projects", route: "/projects" },
|
|
130
|
+
{ name: "calendar", route: "/calendar" },
|
|
131
|
+
{ name: "settings", route: "/settings" },
|
|
132
|
+
{ name: "profile", route: "/profile" },
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
android: {
|
|
136
|
+
dir: "examples/taskflow/generated/android/TaskFlow",
|
|
137
|
+
screens: [
|
|
138
|
+
{ name: "home" },
|
|
139
|
+
{ name: "projects", nav: ["Projects"] },
|
|
140
|
+
{ name: "settings", nav: ["Settings"] },
|
|
141
|
+
],
|
|
142
|
+
},
|
|
143
|
+
ios: {
|
|
144
|
+
dir: "examples/taskflow/generated/ios/TaskFlow",
|
|
145
|
+
screens: [
|
|
146
|
+
{ name: "home" },
|
|
147
|
+
{ name: "projects", nav: ["Projects"] },
|
|
148
|
+
{ name: "calendar", nav: ["Calendar"] },
|
|
149
|
+
{ name: "settings", nav: ["Settings"] },
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
];
|
|
154
|
+
|
|
155
|
+
// ── Utilities ────────────────────────────────────────────────────────
|
|
156
|
+
|
|
157
|
+
function log(msg: string) { console.log(`\x1b[36m▸\x1b[0m ${msg}`); }
|
|
158
|
+
function logOk(msg: string) { console.log(`\x1b[32m✔\x1b[0m ${msg}`); }
|
|
159
|
+
function logErr(msg: string) { console.error(`\x1b[31m✖\x1b[0m ${msg}`); }
|
|
160
|
+
function sleep(ms: number) { return new Promise((r) => setTimeout(r, ms)); }
|
|
161
|
+
|
|
162
|
+
function saveResultScreenshots(result: any, outDir: string, platform: string) {
|
|
163
|
+
mkdirSync(outDir, { recursive: true });
|
|
164
|
+
if (result.isError) {
|
|
165
|
+
logErr(` ${platform}: ${result.content?.[0]?.text ?? "unknown error"}`);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
for (const item of result.content) {
|
|
169
|
+
if (item.type === "image" && item.data) {
|
|
170
|
+
// Next text item has metadata with screen name
|
|
171
|
+
const idx = result.content.indexOf(item);
|
|
172
|
+
const meta = result.content[idx + 1];
|
|
173
|
+
let screenName = "unknown";
|
|
174
|
+
if (meta?.type === "text") {
|
|
175
|
+
try { screenName = JSON.parse(meta.text).screen; } catch { /* ignore */ }
|
|
176
|
+
}
|
|
177
|
+
const outPath = join(outDir, `${platform}-${screenName}.png`);
|
|
178
|
+
writeFileSync(outPath, Buffer.from(item.data, "base64"));
|
|
179
|
+
logOk(` ${platform}-${screenName}.png`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
185
|
+
// BATCH MODE — uses takeScreenshotBatch / takeAndroidScreenshotBatch / takeIOSScreenshotBatch
|
|
186
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
187
|
+
|
|
188
|
+
async function runBatchMode() {
|
|
189
|
+
for (const project of PROJECTS) {
|
|
190
|
+
console.log(`\n\x1b[1m=== ${project.name} (batch) ===\x1b[0m\n`);
|
|
191
|
+
const outDir = join(ARTIFACTS, project.name, "screenshots");
|
|
192
|
+
|
|
193
|
+
if (project.ios && (!PLATFORM_FILTER || PLATFORM_FILTER === "ios")) {
|
|
194
|
+
try {
|
|
195
|
+
log(`iOS batch: ${project.ios.screens.length} screens...`);
|
|
196
|
+
const result = await takeIOSScreenshotBatch(join(ROOT, "examples", project.name), {
|
|
197
|
+
captures: project.ios.screens.map((s) => ({ screen: s.name, nav: s.nav, wait_for: 5000 })),
|
|
198
|
+
project_dir: join(ROOT, project.ios.dir),
|
|
199
|
+
});
|
|
200
|
+
saveResultScreenshots(result, outDir, "ios");
|
|
201
|
+
} catch (err: any) { logErr(`iOS batch failed for ${project.name}: ${err.message}`); }
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (project.android && (!PLATFORM_FILTER || PLATFORM_FILTER === "android")) {
|
|
205
|
+
try {
|
|
206
|
+
log(`Android batch: ${project.android.screens.length} screens...`);
|
|
207
|
+
const result = await takeAndroidScreenshotBatch(join(ROOT, "examples", project.name), {
|
|
208
|
+
captures: project.android.screens.map((s) => ({ screen: s.name, route: s.route, nav: s.nav, wait_for: 8000 })),
|
|
209
|
+
project_dir: join(ROOT, project.android.dir),
|
|
210
|
+
});
|
|
211
|
+
saveResultScreenshots(result, outDir, "android");
|
|
212
|
+
} catch (err: any) { logErr(`Android batch failed for ${project.name}: ${err.message}`); }
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
if (project.web && (!PLATFORM_FILTER || PLATFORM_FILTER === "web")) {
|
|
216
|
+
try {
|
|
217
|
+
const openuispecDir = join(ROOT, "examples", project.name);
|
|
218
|
+
log(`Web batch: ${project.web.screens.length} screens...`);
|
|
219
|
+
const result = await takeScreenshotBatch(openuispecDir, {
|
|
220
|
+
captures: project.web.screens.map((s) => ({ screen: s.name, route: s.route, wait_for: 3000 })),
|
|
221
|
+
});
|
|
222
|
+
saveResultScreenshots(result, outDir, "web");
|
|
223
|
+
} catch (err: any) { logErr(`Web batch failed for ${project.name}: ${err.message}`); }
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
229
|
+
// PER-SCREEN MODE — manual vite + puppeteer for web, adb for android, simctl + XCUITest for iOS
|
|
230
|
+
// ══════════════════════════════════════════════════════════════════════
|
|
231
|
+
|
|
232
|
+
async function startViteServer(dir: string): Promise<{ proc: ChildProcess; url: string }> {
|
|
233
|
+
return new Promise((resolve, reject) => {
|
|
234
|
+
const proc = spawn("npx", ["vite", "--port", "0"], {
|
|
235
|
+
cwd: dir,
|
|
236
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
237
|
+
env: { ...process.env, BROWSER: "none" },
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
let output = "";
|
|
241
|
+
const timeout = setTimeout(() => {
|
|
242
|
+
proc.kill();
|
|
243
|
+
reject(new Error(`Vite server timed out. Output: ${output}`));
|
|
244
|
+
}, 30_000);
|
|
245
|
+
|
|
246
|
+
const onData = (data: Buffer) => {
|
|
247
|
+
output += data.toString();
|
|
248
|
+
const match = output.match(/Local:\s+(https?:\/\/[^\s]+)/);
|
|
249
|
+
if (match) {
|
|
250
|
+
clearTimeout(timeout);
|
|
251
|
+
proc.stdout?.removeListener("data", onData);
|
|
252
|
+
proc.stderr?.removeListener("data", onData);
|
|
253
|
+
resolve({ proc, url: match[1].replace(/\/+$/, "") });
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
proc.stdout?.on("data", onData);
|
|
258
|
+
proc.stderr?.on("data", onData);
|
|
259
|
+
proc.on("error", (err) => { clearTimeout(timeout); reject(err); });
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
async function takeWebScreenshots(project: string, def: NonNullable<ProjectDef["web"]>) {
|
|
264
|
+
const outDir = join(ARTIFACTS, project, "screenshots");
|
|
265
|
+
mkdirSync(outDir, { recursive: true });
|
|
266
|
+
|
|
267
|
+
log(`Starting web server for ${project}...`);
|
|
268
|
+
const { proc, url } = await startViteServer(join(ROOT, def.dir));
|
|
269
|
+
|
|
270
|
+
try {
|
|
271
|
+
const puppeteer = await import("puppeteer");
|
|
272
|
+
const browser = await puppeteer.default.launch({ headless: "shell" });
|
|
273
|
+
try {
|
|
274
|
+
const page = await browser.newPage();
|
|
275
|
+
await page.setViewport({ width: 1280, height: 800 });
|
|
276
|
+
for (const screen of def.screens) {
|
|
277
|
+
const fullUrl = `${url}${screen.route}`;
|
|
278
|
+
log(` web/${screen.name}: ${fullUrl}`);
|
|
279
|
+
await page.goto(fullUrl, { waitUntil: "networkidle0", timeout: 15_000 });
|
|
280
|
+
try {
|
|
281
|
+
await page.waitForFunction(
|
|
282
|
+
() => (document.getElementById("root")?.children.length ?? 0) > 0,
|
|
283
|
+
{ timeout: 8_000 },
|
|
284
|
+
);
|
|
285
|
+
} catch { /* app may not use #root */ }
|
|
286
|
+
await sleep(3000);
|
|
287
|
+
await page.screenshot({ path: join(outDir, `web-${screen.name}.png`), fullPage: false });
|
|
288
|
+
logOk(` web-${screen.name}.png`);
|
|
289
|
+
}
|
|
290
|
+
} finally {
|
|
291
|
+
await browser.close();
|
|
292
|
+
}
|
|
293
|
+
} finally {
|
|
294
|
+
proc.kill();
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
async function takeAndroidScreenshots(project: string, def: NonNullable<ProjectDef["android"]>) {
|
|
299
|
+
const outDir = join(ARTIFACTS, project, "screenshots");
|
|
300
|
+
mkdirSync(outDir, { recursive: true });
|
|
301
|
+
|
|
302
|
+
const androidDir = join(ROOT, def.dir);
|
|
303
|
+
const adb = findAdb();
|
|
304
|
+
const serial = await getConnectedEmulator(adb);
|
|
305
|
+
|
|
306
|
+
log(`Cleaning emulator storage...`);
|
|
307
|
+
await cleanEmulatorStorage(adb, serial);
|
|
308
|
+
|
|
309
|
+
const appInfo = extractAndroidAppInfo(androidDir);
|
|
310
|
+
log(`Building Android APK for ${project}...`);
|
|
311
|
+
const apkPath = await buildApk(androidDir, appInfo.moduleName);
|
|
312
|
+
|
|
313
|
+
log(`Installing on emulator ${serial}...`);
|
|
314
|
+
await exec(`${adb} -s ${serial} install -r "${apkPath}"`, { timeout: 60_000 });
|
|
315
|
+
|
|
316
|
+
for (const screen of def.screens) {
|
|
317
|
+
log(` android/${screen.name}...`);
|
|
318
|
+
|
|
319
|
+
await adbShell(adb, serial, `am force-stop ${appInfo.applicationId}`);
|
|
320
|
+
try { await adbShell(adb, serial, `pm clear ${appInfo.applicationId}`); } catch { /* ignore */ }
|
|
321
|
+
await sleep(500);
|
|
322
|
+
|
|
323
|
+
if (screen.route) {
|
|
324
|
+
// Deep link launch
|
|
325
|
+
await adbShell(adb, serial,
|
|
326
|
+
`am start -W -a android.intent.action.VIEW -d '${screen.route}' ` +
|
|
327
|
+
`${appInfo.applicationId}/${appInfo.launchActivity}`);
|
|
328
|
+
} else {
|
|
329
|
+
// Normal launch + optional nav taps
|
|
330
|
+
await adbShell(adb, serial,
|
|
331
|
+
`am start -W -n ${appInfo.applicationId}/${appInfo.launchActivity}`);
|
|
332
|
+
}
|
|
333
|
+
await sleep(5000);
|
|
334
|
+
|
|
335
|
+
if (!screen.route && screen.nav && screen.nav.length > 0) {
|
|
336
|
+
try {
|
|
337
|
+
await navigateByTaps(adb, serial, screen.nav);
|
|
338
|
+
} catch (err: any) {
|
|
339
|
+
logErr(` Nav failed: ${err.message}`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const outPath = join(outDir, `android-${screen.name}.png`);
|
|
344
|
+
await captureAndroidScreenshot(adb, serial, outPath);
|
|
345
|
+
logOk(` android-${screen.name}.png`);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
async function takeIOSScreenshots(project: string, def: NonNullable<ProjectDef["ios"]>) {
|
|
350
|
+
const outDir = join(ARTIFACTS, project, "screenshots");
|
|
351
|
+
mkdirSync(outDir, { recursive: true });
|
|
352
|
+
|
|
353
|
+
const iosDir = join(ROOT, def.dir);
|
|
354
|
+
const appInfo = extractIOSAppInfo(iosDir);
|
|
355
|
+
const sim = findSimulator();
|
|
356
|
+
const simUdid = sim.udid;
|
|
357
|
+
|
|
358
|
+
log(`Building iOS app for ${project} (scheme: ${appInfo.schemeName})...`);
|
|
359
|
+
const appBundlePath = await buildIOSApp(iosDir, appInfo, simUdid);
|
|
360
|
+
log(`Installing on simulator...`);
|
|
361
|
+
await installAndLaunchIOS(simUdid, appBundlePath, appInfo.bundleId);
|
|
362
|
+
|
|
363
|
+
const homeScreen = def.screens.find((s) => !s.nav || s.nav.length === 0);
|
|
364
|
+
if (homeScreen) {
|
|
365
|
+
log(` ios/${homeScreen.name} (launch screenshot)...`);
|
|
366
|
+
await sleep(5000);
|
|
367
|
+
await captureIOSScreenshot(simUdid, join(outDir, `ios-${homeScreen.name}.png`));
|
|
368
|
+
logOk(` ios-${homeScreen.name}.png`);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
const navScreens = def.screens.filter((s) => s.nav && s.nav.length > 0);
|
|
372
|
+
if (navScreens.length === 0) return;
|
|
373
|
+
|
|
374
|
+
log(` Generating XCUITest for ${navScreens.length} nav screens...`);
|
|
375
|
+
|
|
376
|
+
const uitestDir = join(iosDir, ".screenshot-uitest");
|
|
377
|
+
const sourcesDir = join(uitestDir, "Sources");
|
|
378
|
+
mkdirSync(sourcesDir, { recursive: true });
|
|
379
|
+
|
|
380
|
+
const testCases = navScreens.map((screen, i) => {
|
|
381
|
+
const taps = (screen.nav ?? []).map((step, j) => {
|
|
382
|
+
const escaped = step.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
383
|
+
return `
|
|
384
|
+
let target_${i}_${j} = app.descendants(matching: .any).matching(NSPredicate(format: "label ==[c] %@ OR title ==[c] %@", "${escaped}", "${escaped}")).firstMatch
|
|
385
|
+
if target_${i}_${j}.waitForExistence(timeout: 5) {
|
|
386
|
+
target_${i}_${j}.tap()
|
|
387
|
+
Thread.sleep(forTimeInterval: 0.8)
|
|
388
|
+
}`;
|
|
389
|
+
}).join("\n");
|
|
390
|
+
|
|
391
|
+
const outputPath = join(outDir, `ios-${screen.name}.png`).replace(/"/g, '\\"');
|
|
392
|
+
return `
|
|
393
|
+
func test_${String(i + 1).padStart(2, "0")}_${screen.name}() {
|
|
394
|
+
let app = XCUIApplication()
|
|
395
|
+
app.launchArguments = ["-AppleLanguages", "(en)"]
|
|
396
|
+
app.launch()
|
|
397
|
+
Thread.sleep(forTimeInterval: 2.0)
|
|
398
|
+
${taps}
|
|
399
|
+
Thread.sleep(forTimeInterval: 0.5)
|
|
400
|
+
let screenshot = XCUIScreen.main.screenshot()
|
|
401
|
+
try! screenshot.pngRepresentation.write(to: URL(fileURLWithPath: "${outputPath}"))
|
|
402
|
+
}`;
|
|
403
|
+
}).join("\n");
|
|
404
|
+
|
|
405
|
+
writeFileSync(join(sourcesDir, "ScreenshotUITest.swift"),
|
|
406
|
+
`import XCTest\n\nfinal class ScreenshotUITest: XCTestCase {\n${testCases}\n}\n`);
|
|
407
|
+
|
|
408
|
+
const UITEST_TARGET = "ScreenshotUITests";
|
|
409
|
+
const hasXcodegen = existsSync(join(iosDir, "project.yml"));
|
|
410
|
+
const projectYmlPath = join(iosDir, "project.yml");
|
|
411
|
+
let originalProjectYml: string | null = null;
|
|
412
|
+
const buildDir = join(iosDir, ".build", "screenshot");
|
|
413
|
+
|
|
414
|
+
if (hasXcodegen) {
|
|
415
|
+
originalProjectYml = readFileSync(projectYmlPath, "utf-8");
|
|
416
|
+
let modifiedYml = ensureInfoPlistFlag(originalProjectYml);
|
|
417
|
+
modifiedYml = insertUITestTarget(modifiedYml, generateUITestTargetYml(appInfo, ".screenshot-uitest/Sources", true));
|
|
418
|
+
writeFileSync(projectYmlPath, modifiedYml);
|
|
419
|
+
await exec(`xcodegen generate`, { cwd: iosDir, timeout: 30_000 });
|
|
420
|
+
} else {
|
|
421
|
+
writeFileSync(join(uitestDir, "project.yml"), `name: ${UITEST_TARGET}
|
|
422
|
+
targets:
|
|
423
|
+
${UITEST_TARGET}:
|
|
424
|
+
type: bundle.ui-testing
|
|
425
|
+
platform: iOS
|
|
426
|
+
deploymentTarget: "${appInfo.deploymentTarget}"
|
|
427
|
+
sources:
|
|
428
|
+
- path: Sources
|
|
429
|
+
settings:
|
|
430
|
+
base:
|
|
431
|
+
TEST_TARGET_NAME: ${appInfo.schemeName}
|
|
432
|
+
PRODUCT_BUNDLE_IDENTIFIER: ${appInfo.bundleId}.uitests
|
|
433
|
+
GENERATE_INFOPLIST_FILE: YES
|
|
434
|
+
`);
|
|
435
|
+
await exec(`xcodegen generate`, { cwd: uitestDir, timeout: 30_000 });
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const testProjectFlag = hasXcodegen
|
|
439
|
+
? (appInfo.xcodeproj ? `-project "${join(iosDir, appInfo.xcodeproj)}"` : "")
|
|
440
|
+
: `-project "${join(uitestDir, `${UITEST_TARGET}.xcodeproj`)}"`;
|
|
441
|
+
const testCwd = hasXcodegen ? iosDir : uitestDir;
|
|
442
|
+
|
|
443
|
+
try {
|
|
444
|
+
log(` Running XCUITest to capture ${navScreens.length} screens...`);
|
|
445
|
+
await exec(
|
|
446
|
+
`xcodebuild test ${testProjectFlag} -scheme "${UITEST_TARGET}" -destination "id=${simUdid}" -derivedDataPath "${buildDir}" -only-testing:${UITEST_TARGET}/ScreenshotUITest 2>&1`,
|
|
447
|
+
{ cwd: testCwd, timeout: 300_000 },
|
|
448
|
+
);
|
|
449
|
+
} catch {
|
|
450
|
+
const missing = navScreens.filter((s) => !existsSync(join(outDir, `ios-${s.name}.png`)));
|
|
451
|
+
if (missing.length > 0) {
|
|
452
|
+
logErr(` XCUITest failed for: ${missing.map((s) => s.name).join(", ")}`);
|
|
453
|
+
}
|
|
454
|
+
} finally {
|
|
455
|
+
if (originalProjectYml) {
|
|
456
|
+
writeFileSync(projectYmlPath, originalProjectYml);
|
|
457
|
+
try { await exec(`xcodegen generate`, { cwd: iosDir, timeout: 30_000 }); } catch { /* best effort */ }
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
for (const screen of navScreens) {
|
|
462
|
+
if (existsSync(join(outDir, `ios-${screen.name}.png`))) {
|
|
463
|
+
logOk(` ios-${screen.name}.png`);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
async function runPerScreenMode() {
|
|
469
|
+
for (const project of PROJECTS) {
|
|
470
|
+
console.log(`\n\x1b[1m=== ${project.name} ===\x1b[0m\n`);
|
|
471
|
+
|
|
472
|
+
if (project.ios && (!PLATFORM_FILTER || PLATFORM_FILTER === "ios")) {
|
|
473
|
+
try { await takeIOSScreenshots(project.name, project.ios); }
|
|
474
|
+
catch (err: any) { logErr(`iOS screenshots failed for ${project.name}: ${err.message}`); }
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (project.android && (!PLATFORM_FILTER || PLATFORM_FILTER === "android")) {
|
|
478
|
+
try { await takeAndroidScreenshots(project.name, project.android); }
|
|
479
|
+
catch (err: any) { logErr(`Android screenshots failed for ${project.name}: ${err.message}`); }
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (project.web && (!PLATFORM_FILTER || PLATFORM_FILTER === "web")) {
|
|
483
|
+
try { await takeWebScreenshots(project.name, project.web); }
|
|
484
|
+
catch (err: any) { logErr(`Web screenshots failed for ${project.name}: ${err.message}`); }
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// ── Main ─────────────────────────────────────────────────────────────
|
|
490
|
+
|
|
491
|
+
async function main() {
|
|
492
|
+
const mode = BATCH_MODE ? "batch" : "per-screen";
|
|
493
|
+
console.log(`\nTaking screenshots of all generated targets (${mode} mode)\n`);
|
|
494
|
+
|
|
495
|
+
if (BATCH_MODE) {
|
|
496
|
+
await runBatchMode();
|
|
497
|
+
} else {
|
|
498
|
+
await runPerScreenMode();
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
console.log("\n\x1b[32mDone! Screenshots saved to artifacts/\x1b[0m\n");
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
main().catch((err) => {
|
|
505
|
+
console.error(err);
|
|
506
|
+
process.exit(1);
|
|
507
|
+
});
|
package/status/index.ts
CHANGED
|
@@ -100,10 +100,10 @@ function buildTargetStatus(cwd: string, projectDir: string, projectName: string,
|
|
|
100
100
|
explain_available: false,
|
|
101
101
|
status: outputExists ? "needs baseline" : "needs generation",
|
|
102
102
|
recommended_next_step: outputExists
|
|
103
|
-
? `
|
|
103
|
+
? `Review the generated output, then run \`openuispec drift --snapshot --target ${target}\` to create the baseline.`
|
|
104
104
|
: `Run code generation for "${target}", then \`openuispec prepare --target ${target}\` to build the target work bundle.`,
|
|
105
105
|
note: outputExists
|
|
106
|
-
? "
|
|
106
|
+
? "Baseline pending — generated code exists but user has not yet confirmed it with a snapshot."
|
|
107
107
|
: `Output directory not found. Run code generation for "${target}" first.`,
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<!-- openuispec-rules-start -->
|
|
2
|
-
<!-- openuispec-rules-version: 0.2.4 -->
|
|
3
|
-
# OpenUISpec — AI Assistant Rules
|
|
4
|
-
# ================================
|
|
5
|
-
# This project uses OpenUISpec to define UI as a semantic spec.
|
|
6
|
-
# Spec files are the single source of truth for all UI across platforms.
|
|
7
|
-
# Targets: "ios", "android", "web"
|
|
8
|
-
|
|
9
|
-
## MANDATORY — UI work requires OpenUISpec tools
|
|
10
|
-
|
|
11
|
-
When the user's request involves UI — screens, navigation, layout, tokens, flows, localization,
|
|
12
|
-
or any visual/structural change — you MUST use the OpenUISpec tools before writing any code.
|
|
13
|
-
|
|
14
|
-
### MCP Tools (use these when available)
|
|
15
|
-
|
|
16
|
-
Call these MCP tools directly. They return structured JSON with everything you need.
|
|
17
|
-
|
|
18
|
-
**Pre-generation:**
|
|
19
|
-
1. Call `openuispec_prepare` with the target platform — returns spec context, platform config, constraints.
|
|
20
|
-
2. Call `openuispec_read_specs` to load spec file contents. Use these as the AUTHORITATIVE source.
|
|
21
|
-
3. If spec changes are needed, update spec files FIRST, then call `openuispec_check`.
|
|
22
|
-
4. Generate or update the platform UI code based on the spec contents.
|
|
23
|
-
|
|
24
|
-
**Post-generation (EVERY TIME after writing UI code):**
|
|
25
|
-
5. Call `openuispec_check` to validate spec integrity.
|
|
26
|
-
6. Call `openuispec_read_specs` for the screens/contracts you just generated code for.
|
|
27
|
-
7. Audit your generated code against the spec. For each screen, verify:
|
|
28
|
-
- Every field/action in the spec has a corresponding UI element
|
|
29
|
-
- Token values (colors, spacing, radii) match exactly — no approximations
|
|
30
|
-
- Contract `must_handle` states are all implemented (loading, error, empty, etc.)
|
|
31
|
-
- Adaptive breakpoints match the spec's `size_classes`
|
|
32
|
-
- Locale keys match `$t:` references
|
|
33
|
-
- Navigation targets match flow definitions
|
|
34
|
-
8. Report any real gaps found and fix them before finishing.
|
|
35
|
-
|
|
36
|
-
**Creating new spec files:**
|
|
37
|
-
- Call `openuispec_spec_types` to discover available spec types.
|
|
38
|
-
- Call `openuispec_spec_schema` with the specific type to get the full JSON schema.
|
|
39
|
-
- Write the spec file following the schema exactly.
|
|
40
|
-
|
|
41
|
-
**Focused getters (prefer these for incremental edits over `read_specs`):**
|
|
42
|
-
- `openuispec_get_screen(name)` — single screen spec
|
|
43
|
-
- `openuispec_get_contract(name, variant?)` — single contract, optionally one variant
|
|
44
|
-
- `openuispec_get_tokens(category)` — single token category (color, typography, spacing, etc.)
|
|
45
|
-
- `openuispec_get_locale(locale, keys?)` — single locale file, optionally filtered keys
|
|
46
|
-
- `openuispec_check(target, screens?, contracts?)` — scoped audit for specific screens/contracts
|
|
47
|
-
|
|
48
|
-
Use `read_specs` for full-project generation; use focused getters when editing one screen or contract.
|
|
49
|
-
|
|
50
|
-
**Other tools:**
|
|
51
|
-
- `openuispec_status` — cross-target summary, good starting point
|
|
52
|
-
- `openuispec_drift` with `explain: true` — property-level spec changes
|
|
53
|
-
- `openuispec_validate` — schema-only validation by group
|
|
54
|
-
|
|
55
|
-
### CLI fallback (when MCP is not available)
|
|
56
|
-
|
|
57
|
-
If MCP tools are not available, use these CLI commands with `--json` flag:
|
|
58
|
-
- `openuispec prepare --target <t> --json` — build AI-ready work bundle
|
|
59
|
-
- `openuispec check --target <t> --json` — composite validation
|
|
60
|
-
- `openuispec status --json` — cross-target status
|
|
61
|
-
- `openuispec drift --target <t> --explain --json` — semantic drift
|
|
62
|
-
- `openuispec validate [group...] --json` — schema validation
|
|
63
|
-
- `openuispec read-specs [paths...]` — read spec file contents
|
|
64
|
-
- `openuispec get-screen <name>` — get a single screen spec
|
|
65
|
-
- `openuispec get-contract <name> [--variant v]` — get a contract spec
|
|
66
|
-
- `openuispec get-tokens <category>` — get tokens for a category
|
|
67
|
-
- `openuispec get-locale <locale> [--keys k1,k2]` — get a locale file
|
|
68
|
-
- `openuispec spec-types` — list available spec types
|
|
69
|
-
- `openuispec spec-schema <type>` — get JSON schema for a spec type
|
|
70
|
-
- `openuispec screenshot --route /path` — screenshot the web app
|
|
71
|
-
- `openuispec screenshot-android [--project-dir path]` — screenshot Android app
|
|
72
|
-
- `openuispec screenshot-ios [--project-dir path]` — screenshot iOS app
|
|
73
|
-
|
|
74
|
-
### Other CLI commands
|
|
75
|
-
- `openuispec init` — scaffold a new spec project
|
|
76
|
-
- `openuispec drift --snapshot --target <t>` — snapshot current state (only after UI code is updated)
|
|
77
|
-
- `openuispec configure-target <t>` — configure target platform stack
|
|
78
|
-
- `openuispec update-rules` — update AI rules to match installed package version
|
|
79
|
-
|
|
80
|
-
## Spec format reference
|
|
81
|
-
|
|
82
|
-
The spec format, schemas, and generation rules are in the installed `openuispec` package.
|
|
83
|
-
You MUST read the reference files before creating or editing spec files — do NOT guess the format.
|
|
84
|
-
|
|
85
|
-
**Find the package:** `node_modules/openuispec/` or run `npm root -g` → `<prefix>/openuispec/`.
|
|
86
|
-
**Online fallback:** `https://openuispec.rsteam.uz/llms-full.txt`
|
|
87
|
-
|
|
88
|
-
**Reference files (read in order):**
|
|
89
|
-
1. `README.md` — schema tables, file format, root wrapper keys
|
|
90
|
-
2. `spec/openuispec-v0.1.md` — full specification
|
|
91
|
-
3. `examples/taskflow/openuispec/` — complete working example
|
|
92
|
-
4. `schema/` — JSON Schemas for every file type
|
|
93
|
-
|
|
94
|
-
## Spec location
|
|
95
|
-
- Spec root: `openuispec/` — read `openuispec/openuispec.yaml` first for actual paths.
|
|
96
|
-
- Default dirs: tokens/, screens/, flows/, contracts/, platform/, locales/
|
|
97
|
-
|
|
98
|
-
## When to start from spec vs platform code
|
|
99
|
-
|
|
100
|
-
**Spec-first** (use `openuispec_prepare` or `openuispec prepare`):
|
|
101
|
-
- Screen structure, navigation, fields, actions, validation, data binding changes
|
|
102
|
-
- Token, variant, contract, flow, or localization changes
|
|
103
|
-
- Changes affecting multiple platforms
|
|
104
|
-
- Requests in product/UI terms
|
|
105
|
-
|
|
106
|
-
**Platform-first** (skip spec tools):
|
|
107
|
-
- Platform-specific polish (iOS-only, Android-only, web-only)
|
|
108
|
-
- Local bug fixes that don't alter shared semantic behavior
|
|
109
|
-
|
|
110
|
-
## If spec directories are empty (first-time setup)
|
|
111
|
-
|
|
112
|
-
Read `spec/openuispec-v0.1.md` from the package first, then:
|
|
113
|
-
1. Scan codebase for UI screens → create `openuispec/screens/<name>.yaml` as `status: stub`
|
|
114
|
-
2. Extract tokens (colors, fonts, spacing) → `openuispec/tokens/`
|
|
115
|
-
3. Create contract extensions → `openuispec/contracts/`
|
|
116
|
-
4. Create locale files → `openuispec/locales/<locale>.json`
|
|
117
|
-
5. Fill in `data_model`, `api.endpoints` in `openuispec/openuispec.yaml`
|
|
118
|
-
|
|
119
|
-
## Rules
|
|
120
|
-
- Do not snapshot drift unless the UI code has also been updated.
|
|
121
|
-
- Do not modify generated UI without checking whether the spec must change first.
|
|
122
|
-
- Do not use `configure-target --defaults` as silent approval — ask the user to confirm.
|
|
123
|
-
- Always read spec format from the installed package, not from cached/memorized content.
|
|
124
|
-
<!-- openuispec-rules-end -->
|