@legendapp/spark 0.0.1-next.2 → 0.0.1-next.3
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/LICENSE +21 -0
- package/README.md +10 -4
- package/ai-codex.ts +1 -0
- package/ai.ts +1 -0
- package/app-documents.ts +1 -0
- package/config-plugin.d.cts +2 -0
- package/contracts.ts +2 -0
- package/diagnostics.ts +1 -0
- package/expo-config.d.cts +1 -0
- package/metro.cjs +4 -1
- package/metro.d.cts +12 -0
- package/native.cjs +3 -1
- package/native.d.cts +6 -0
- package/package.json +82 -14
- package/schema.json +276 -58
- package/settings-observable.ts +1 -0
- package/settings-window.ts +1 -0
- package/shortcuts-commands.ts +1 -0
- package/shortcuts-keyboard.ts +3 -0
- package/ui-classnames.ts +1 -0
- package/ui-glass.ts +1 -0
- package/ui-search.ts +1 -0
- package/ui-sidebar.ts +1 -0
- package/ui-split-view.ts +1 -0
- package/ui-symbol.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +19 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/availability.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/index.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +34 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/output.ts +62 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/run.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/types.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.h +2 -1
- package/vendor/node_modules/@legendapp/spark-audio/macos/RNSparkAudio.mm +126 -24
- package/vendor/node_modules/@legendapp/spark-audio/package.json +5 -2
- package/vendor/node_modules/@legendapp/spark-audio/src/NativeSparkAudio.ts +5 -1
- package/vendor/node_modules/@legendapp/spark-audio/src/desktop.ts +36 -32
- package/vendor/node_modules/@legendapp/spark-audio/src/events.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/hooks.ts +65 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/index.web.ts +92 -33
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session-unavailable.ts +6 -4
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.ts +52 -19
- package/vendor/node_modules/@legendapp/spark-audio/src/media-session.web.ts +18 -10
- package/vendor/node_modules/@legendapp/spark-audio/src/media-types.ts +40 -13
- package/vendor/node_modules/@legendapp/spark-audio/src/mobile.ts +40 -32
- package/vendor/node_modules/@legendapp/spark-audio/src/player.ts +97 -0
- package/vendor/node_modules/@legendapp/spark-audio/src/status-listeners.ts +21 -15
- package/vendor/node_modules/@legendapp/spark-audio/src/types.ts +9 -4
- package/vendor/node_modules/@legendapp/spark-audio/windows/SparkAudio/SparkAudio.h +67 -20
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-auth-session/src/core.ts +60 -42
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.ts +28 -12
- package/vendor/node_modules/@legendapp/spark-auth-session/src/mobile.ts +97 -41
- package/vendor/node_modules/@legendapp/spark-auth-session/src/types.ts +20 -9
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +50 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/build-mode.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +83 -48
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +60 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +7 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +31 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +69 -23
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +12 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +12 -9
- package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +4 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-metro.cjs +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-node.js +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +10 -38
- package/vendor/node_modules/@legendapp/spark-cli/dist/local.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +26 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-metadata.js +26 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +84 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-preparation.js +88 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/notary-profiles.js +75 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +4 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/platform.js +16 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +66 -13
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +84 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +23 -18
- package/vendor/node_modules/@legendapp/spark-cli/dist/runner-install.js +145 -31
- package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +4 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/updates.js +41 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +4 -1
- package/vendor/node_modules/@legendapp/spark-cli/package.json +7 -6
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/App.tsx +6 -12
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +5 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +11 -9
- package/vendor/node_modules/@legendapp/spark-cli/templates/diff-lite/Git.macos.tsx +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.macos.tsx +23 -21
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/Integration.windows.tsx +23 -21
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.desktop.ts +11 -8
- package/vendor/node_modules/@legendapp/spark-cli/templates/document-editor/io.macos.ts +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/Lifecycle.desktop.tsx +8 -14
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/OpenFiles.desktop.tsx +5 -10
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.desktop.ts +11 -8
- package/vendor/node_modules/@legendapp/spark-cli/templates/example-shared/io.macos.ts +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/music-lite/assets.desktop.ts +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Activation.desktop.tsx +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/Desktop.desktop.ts +37 -15
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/session.ts +5 -6
- package/vendor/node_modules/@legendapp/spark-cli/templates/notes-lite/window-session.ts +5 -4
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +5 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/metro.config.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +13 -11
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/react-native.config.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +13 -11
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/react-native.config.js +1 -1
- package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +10 -16
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-clipboard/src/NativeDesktopClipboard.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +55 -31
- package/vendor/node_modules/@legendapp/spark-clipboard/src/expo.ts +21 -11
- package/vendor/node_modules/@legendapp/spark-clipboard/src/options.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/src/types.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.h +38 -15
- package/vendor/node_modules/@legendapp/spark-clipboard/windows/SparkClipboard/SparkClipboard.vcxproj +2 -0
- package/vendor/node_modules/@legendapp/spark-codex/RNCodex.podspec +22 -0
- package/vendor/node_modules/@legendapp/spark-codex/cpp/HybridCodexAppServer.hpp +23 -0
- package/vendor/node_modules/@legendapp/spark-codex/cpp/HybridCodexAppServer.mm +1529 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitro.json +21 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/.gitattributes +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex+autolinking.rb +62 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Bridge.cpp +17 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Bridge.hpp +27 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodex-Swift-Cxx-Umbrella.hpp +38 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodexAutolinking.mm +35 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/ios/RNCodexAutolinking.swift +16 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/CodexAvailability.hpp +95 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/CodexRunResult.hpp +99 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/HybridCodexAppServerSpec.cpp +24 -0
- package/vendor/node_modules/@legendapp/spark-codex/nitrogen/generated/shared/c++/HybridCodexAppServerSpec.hpp +71 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +35 -0
- package/vendor/node_modules/@legendapp/spark-codex/react-native.config.js +11 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/Codex.nitro.ts +30 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/index.ts +65 -0
- package/vendor/node_modules/@legendapp/spark-codex/src/native.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-commands/package.json +21 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/bindings.ts +90 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/index.tsx +400 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/router.ts +138 -0
- package/vendor/node_modules/@legendapp/spark-commands/src/storage.ts +20 -0
- package/vendor/node_modules/@legendapp/spark-context-menu/macos/RNContextMenu.mm +7 -8
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-context-menu/src/NativeContextMenu.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-context-menu/src/index.ts +26 -26
- package/vendor/node_modules/@legendapp/spark-context-menu/windows/SparkContextMenu/SparkContextMenu.h +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/RNDesktopApp.podspec +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-app/cpp/SparkBinaryJSI.hpp +89 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/cpp/SparkBinaryWindows.hpp +22 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +13 -7
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkBinaryJSI.h +48 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +33 -33
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktopError.h +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkLifecycle.h +26 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkLifecycle.mm +49 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkQuitCoordinator.h +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkQuitCoordinator.mm +70 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkWindow.mm +9 -6
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/recent-documents/RNRecentDocumentController.mm +55 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +5 -3
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/NativeDesktopApp.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/api.ts +86 -40
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/accelerator.ts +40 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/index.ts +56 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/menu.ts +114 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/native-buffer.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/path.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/events.ts +75 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/index.windows.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/open-requests.ts +43 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/restoration.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/transport.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +10 -5
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.d.cts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +35 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +16 -3
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +89 -9
- package/vendor/node_modules/@legendapp/spark-desktop-config/expo.d.cts +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/lifecycle.cjs +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +6 -5
- package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +276 -58
- package/vendor/node_modules/@legendapp/spark-desktop-config/updates.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +35 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +129 -11
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-host/windows/application.inc +277 -121
- package/vendor/node_modules/@legendapp/spark-desktop-links/common/AuthLoopback.h +5 -7
- package/vendor/node_modules/@legendapp/spark-desktop-links/macos/RNDesktopLinks.mm +10 -9
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/NativeDesktopLinks.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/api.ts +27 -33
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/expo.ts +3 -4
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/native.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-links/windows/SparkLinks/SparkLinks.h +22 -22
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/RNDesktopShortcuts.podspec +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +9 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +307 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +8 -5
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/NativeDesktopShortcuts.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/api.ts +39 -14
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/keyboard-manager/NativeKeyboardManager.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/keyboard-manager/codes.ts +108 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/keyboard-manager/index.ts +99 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/RNDesktopWindows.podspec +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +229 -103
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/SparkWindowGeometry.h +63 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/LegendWindowRegistry.h +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/LegendWindowRegistry.mm +27 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.h +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +3130 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManagerStartup.mm +31 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/SidebarStartupFallbacks.mm +14 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +10 -6
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/NativeDesktopWindowManager.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +144 -70
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/diagnostics.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/index.windows.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +53 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos.ts +51 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/transport.ts +41 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +140 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +162 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/window-manager/NativeWindowManager.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/WindowProvider.tsx +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +78 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/index.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +34 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/types.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +18 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-documents/package.json +22 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/controller.ts +97 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/documentTransition.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/hooks.ts +139 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/index.tsx +50 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/reload.ts +39 -0
- package/vendor/node_modules/@legendapp/spark-documents/src/requests.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +73 -18
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +58 -15
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +14 -8
- package/vendor/node_modules/@legendapp/spark-file-dialog/ios/RNFileDialog.mm +34 -121
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +12 -5
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/NativeFileDialog.ts +1 -5
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/index.ts +19 -84
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/native.ts +12 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +34 -14
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +26 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/windows/SparkFileDialog/SparkFileDialog.h +42 -58
- package/vendor/node_modules/@legendapp/spark-file-system/RNDesktopFileSystem.podspec +1 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +32 -21
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +24 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +215 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScanner.h +9 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScanner.mm +82 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScannerCore.h +47 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/file-scanner/RNFileScannerCore.mm +306 -0
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +8 -6
- package/vendor/node_modules/@legendapp/spark-file-system/src/NativeDesktopFileSystem.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-file-system/src/file-scanner/NativeFileScanner.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/file-scanner/index.ts +93 -0
- package/vendor/node_modules/@legendapp/spark-file-system/src/handles.ts +48 -14
- package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +134 -45
- package/vendor/node_modules/@legendapp/spark-file-system/src/path.ts +1 -9
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.h +102 -26
- package/vendor/node_modules/@legendapp/spark-file-system/windows/SparkFileSystem/SparkFileSystem.vcxproj +2 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/RNDesktopGlobalShortcuts.podspec +1 -0
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/macos/RNDesktopGlobalShortcuts.mm +7 -4
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/NativeDesktopGlobalShortcuts.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/index.ts +39 -10
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/windows/SparkGlobalShortcuts/SparkGlobalShortcuts.h +5 -4
- package/vendor/node_modules/@legendapp/spark-message-dialog/macos/RNDesktopMessageDialog.mm +2 -2
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/NativeDesktopMessageDialog.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +48 -11
- package/vendor/node_modules/@legendapp/spark-native-menu/ios/RNNativeMenu.mm +141 -609
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +9 -4
- package/vendor/node_modules/@legendapp/spark-native-menu/src/NativeMenu.ts +2 -7
- package/vendor/node_modules/@legendapp/spark-native-menu/src/api.ts +76 -121
- package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +97 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/src/windows-menus.ts +43 -37
- package/vendor/node_modules/@legendapp/spark-notifications/macos/RNDesktopNotifications.mm +75 -30
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-notifications/src/NativeDesktopNotifications.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-notifications/src/index.ts +130 -42
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.h +46 -8
- package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +94 -21
- package/vendor/node_modules/@legendapp/spark-processes/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-processes/src/NativeDesktopProcesses.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +124 -28
- package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +34 -0
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.h +83 -34
- package/vendor/node_modules/@legendapp/spark-processes/windows/SparkProcesses/SparkProcesses.vcxproj +2 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/macos/RNDesktopSecureStorage.mm +49 -40
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/NativeDesktopSecureStorage.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/desktop.ts +16 -14
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/expo.ts +0 -1
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/options.ts +3 -2
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/unavailable.ts +6 -3
- package/vendor/node_modules/@legendapp/spark-settings/package.json +10 -3
- package/vendor/node_modules/@legendapp/spark-settings/src/fileStorage.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/index.ts +7 -9
- package/vendor/node_modules/@legendapp/spark-settings/src/storage/index.ts +142 -0
- package/vendor/node_modules/@legendapp/spark-settings/src/store.ts +63 -21
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +20 -0
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/index.tsx +436 -0
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/options.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-sqlite/src/database.ts +182 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/src/index.ts +19 -6
- package/vendor/node_modules/@legendapp/spark-sqlite/src/types.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-system/macos/RNDesktopSystem.mm +36 -11
- package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-system/src/NativeDesktopSystem.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-system/src/index.ts +89 -32
- package/vendor/node_modules/@legendapp/spark-system/windows/SparkSystem/SparkSystem.h +8 -4
- package/vendor/node_modules/@legendapp/spark-tray/macos/RNDesktopTray.mm +20 -8
- package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-tray/src/NativeDesktopTray.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +91 -34
- package/vendor/node_modules/@legendapp/spark-tray/windows/SparkTray/SparkTray.h +45 -15
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +2 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +10 -2
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +1182 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/glass-effect-view/RNGlassEffectView.mm +72 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +194 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.mm +180 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +155 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.h +18 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +645 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/text-input-search/RNTextInputSearch.h +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/text-input-search/RNTextInputSearch.mm +164 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +16 -4
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkSelectNativeComponent.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +6 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +31 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +77 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/classnames/index.ts +8 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +42 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +56 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/glass-effect-view/index.tsx +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +35 -21
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +55 -26
- package/vendor/node_modules/@legendapp/spark-ui/src/index.tsx +1 -27
- package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +45 -14
- package/vendor/node_modules/@legendapp/spark-ui/src/index.windows.tsx +1 -42
- package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +11 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSelectNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +5 -3
- package/vendor/node_modules/@legendapp/spark-ui/src/sf-symbol/SFSymbolNativeComponent.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sf-symbol/index.tsx +27 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +25 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +104 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/specialized.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/text-input-search/TextInputSearchNativeComponent.ts +33 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/text-input-search/index.tsx +34 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +30 -19
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +16 -11
- package/vendor/node_modules/@legendapp/spark-updates/macos/RNDesktopUpdates.mm +21 -8
- package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-updates/src/NativeDesktopUpdates.ts +3 -2
- package/vendor/node_modules/@legendapp/spark-updates/src/index.ts +71 -15
- package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-webview/src/WebView.tsx +11 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/adapter.ts +55 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/index.ts +2 -2
- package/vendor/node_modules/@legendapp/spark-webview/src/types.ts +32 -0
- package/vendor/node_modules/@legendapp/spark-webview/src/view-props.ts +28 -0
- package/vendor/node_modules/@legendapp/spark-window-options/index.cjs +51 -14
- package/vendor/node_modules/@legendapp/spark-window-options/index.d.ts +21 -8
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
- package/windows-macos.ts +1 -0
- package/expo-metro.cjs +0 -1
- package/message-dialog.ts +0 -1
- package/universal.cjs +0 -1
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/src/accelerator.ts +0 -22
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows-options.ts +0 -11
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/index.windows.ts +0 -15
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/src/accelerator.ts +0 -22
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkSelect.h +0 -4
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkSelect.mm +0 -53
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { packageSources } from "./release.js";
|
|
1
|
+
import { installedRelease, materializeReleasePackages, packageSources, verifyMaterializedReleasePackages } from "./release.js";
|
|
2
2
|
import { packageManager, managerCommand, localArchive } from "./package-manager.js";
|
|
3
3
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import ts from "typescript";
|
|
7
7
|
import { run } from "./commands.js";
|
|
8
|
-
import { readJson } from "./project.js";
|
|
8
|
+
import { readJson, writeJson } from "./project.js";
|
|
9
9
|
export const integrationMarker = "// spark: existing Expo project";
|
|
10
10
|
/** Wrap an existing export without reprinting or moving the application's code. */
|
|
11
11
|
export function composeExport(source, file, module, fn, root = true) {
|
|
@@ -43,8 +43,8 @@ export function composeMetro(source, file) {
|
|
|
43
43
|
if (!replacements.length)
|
|
44
44
|
throw new Error(`Cannot safely compose ${file}: use Expo's getDefaultConfig before adding desktop support. No files were changed.`);
|
|
45
45
|
for (const { start, end } of replacements.sort((a, b) => b.start - a.start))
|
|
46
|
-
source = source.slice(0, start) + '"@legendapp/spark/
|
|
47
|
-
return composeExport(source, file, "@legendapp/spark/
|
|
46
|
+
source = source.slice(0, start) + '"@legendapp/spark/metro"' + source.slice(end);
|
|
47
|
+
return composeExport(source, file, "@legendapp/spark/metro", "withSparkMetro", false);
|
|
48
48
|
}
|
|
49
49
|
export async function addDesktop(root, manifestFile) {
|
|
50
50
|
const pkgFile = path.join(root, "package.json");
|
|
@@ -54,6 +54,7 @@ export async function addDesktop(root, manifestFile) {
|
|
|
54
54
|
if (pkg.type === "module")
|
|
55
55
|
throw new Error("ES module package configurations need explicit composition; automatic add desktop currently supports Expo's CommonJS project layout. No files were changed.");
|
|
56
56
|
const manager = packageManager(root);
|
|
57
|
+
const release = manifestFile ? undefined : installedRelease();
|
|
57
58
|
const req = createRequire(pkgFile);
|
|
58
59
|
const installed = (name) => readJson(req.resolve(`${name}/package.json`)).version;
|
|
59
60
|
// Never upgrade the mobile baseline as a side effect of adding desktop.
|
|
@@ -72,6 +73,43 @@ export async function addDesktop(root, manifestFile) {
|
|
|
72
73
|
if (existsSync(desktopFile)) {
|
|
73
74
|
if (readJson(desktopFile).extends !== "expo")
|
|
74
75
|
throw new Error("This app already uses spark-owned configuration; add desktop is for existing Expo projects.");
|
|
76
|
+
if (release) {
|
|
77
|
+
const sources = packageSources(undefined, release);
|
|
78
|
+
const replacement = new Map(Object.entries(release.packages).map(([name, asset]) => [asset.url, sources[name]]));
|
|
79
|
+
const portableSources = new Set(replacement.values());
|
|
80
|
+
let changed = false, needsVerify = false;
|
|
81
|
+
function secureDependencies(value) {
|
|
82
|
+
if (typeof value === "string") {
|
|
83
|
+
const portable = replacement.get(value);
|
|
84
|
+
if (portable) {
|
|
85
|
+
changed = true;
|
|
86
|
+
needsVerify = true;
|
|
87
|
+
return portable;
|
|
88
|
+
}
|
|
89
|
+
if (portableSources.has(value))
|
|
90
|
+
needsVerify = true;
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
if (Array.isArray(value))
|
|
94
|
+
return value.map(secureDependencies);
|
|
95
|
+
if (value && typeof value === "object")
|
|
96
|
+
return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, secureDependencies(item)]));
|
|
97
|
+
return value;
|
|
98
|
+
}
|
|
99
|
+
for (const field of ["dependencies", "devDependencies", "optionalDependencies", "overrides", "resolutions", "pnpm"])
|
|
100
|
+
if (pkg[field])
|
|
101
|
+
pkg[field] = secureDependencies(pkg[field]);
|
|
102
|
+
if (needsVerify) {
|
|
103
|
+
await materializeReleasePackages(release, root);
|
|
104
|
+
verifyMaterializedReleasePackages(release, root);
|
|
105
|
+
if (changed)
|
|
106
|
+
writeJson(pkgFile, pkg);
|
|
107
|
+
const ignoreFile = path.join(root, ".gitignore");
|
|
108
|
+
const ignore = existsSync(ignoreFile) ? readFileSync(ignoreFile, "utf8") : "";
|
|
109
|
+
if (!ignore.includes("!/spark-packages/**"))
|
|
110
|
+
writeFileSync(ignoreFile, `${ignore}${ignore.endsWith("\n") || !ignore ? "" : "\n"}\n# Spark verified release package inputs\n!/spark-packages/\n!/spark-packages/**\n`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
75
113
|
await run(root, managerCommand(manager, ["install"]));
|
|
76
114
|
console.log("Desktop integration already exists; dependencies installed. Existing configuration preserved.");
|
|
77
115
|
return;
|
|
@@ -101,7 +139,7 @@ export async function addDesktop(root, manifestFile) {
|
|
|
101
139
|
files.set(native, composeExport(existsSync(path.join(root, native)) ? readFileSync(path.join(root, native), "utf8") : "module.exports = {};\n", native, "@legendapp/spark/native", "withSparkNative"));
|
|
102
140
|
const template = path.resolve(import.meta.dirname, "../templates/universal");
|
|
103
141
|
const defaults = readJson(path.join(template, "package.json"));
|
|
104
|
-
const archives = packageSources(manifestFile);
|
|
142
|
+
const archives = packageSources(manifestFile, release);
|
|
105
143
|
const local = ["@legendapp/spark"];
|
|
106
144
|
const dependencies = {};
|
|
107
145
|
for (const name of local) {
|
|
@@ -123,7 +161,8 @@ export async function addDesktop(root, manifestFile) {
|
|
|
123
161
|
}
|
|
124
162
|
// Resolve local transitive SDK packages without replacing any mobile pins.
|
|
125
163
|
const vendor = ["@react-native-runtimes/core", "react-native-nitro-modules", "@op-engineering/op-sqlite", "react-native-webview"];
|
|
126
|
-
const overrides = { ...Object.fromEntries(local.map(name => [name, dependencies[name]])), "@expo/cli": "54.0.27"
|
|
164
|
+
const overrides = { ...Object.fromEntries(local.map(name => [name, dependencies[name]])), "@expo/cli": "54.0.27",
|
|
165
|
+
"react-native-macos": defaults.overrides["react-native-macos"], "react-native-windows": defaults.overrides["react-native-windows"] };
|
|
127
166
|
for (const name of vendor) {
|
|
128
167
|
if (archives[name]) {
|
|
129
168
|
overrides[name] = archives[name];
|
|
@@ -154,11 +193,15 @@ export async function addDesktop(root, manifestFile) {
|
|
|
154
193
|
files.set("desktop.config.json", JSON.stringify(desktop, null, 2) + "\n");
|
|
155
194
|
const ignoreFile = path.join(root, ".gitignore");
|
|
156
195
|
const ignore = existsSync(ignoreFile) ? readFileSync(ignoreFile, "utf8") : "";
|
|
157
|
-
files.set(".gitignore", `${ignore}${ignore.endsWith("\n") || !ignore ? "" : "\n"}\n# spark generated desktop state\n/.spark/\n/macos/\n/windows/\n`);
|
|
196
|
+
files.set(".gitignore", `${ignore}${ignore.endsWith("\n") || !ignore ? "" : "\n"}\n# spark generated desktop state\n/.spark/\n/macos/\n/windows/\n${release ? "\n# Spark verified release package inputs\n!/spark-packages/\n!/spark-packages/**\n" : ""}`);
|
|
158
197
|
// All conflicts are checked before the first write. The integration is kept
|
|
159
198
|
// reviewable/retryable if the package manager fails; never regenerate mobile.
|
|
199
|
+
if (release)
|
|
200
|
+
await materializeReleasePackages(release, root);
|
|
160
201
|
for (const [file, content] of files)
|
|
161
202
|
writeFileSync(path.join(root, file), content);
|
|
203
|
+
if (release)
|
|
204
|
+
verifyMaterializedReleasePackages(release, root);
|
|
162
205
|
await run(root, managerCommand(manager, ["install"]));
|
|
163
206
|
console.log(`Added desktop support to ${root}. Existing entry point and mobile/web scripts are unchanged.\nRun spark build --dev --platform macos, then spark dev --platform macos. Windows native builds run on Windows.`);
|
|
164
207
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export function buildMode(values) {
|
|
2
|
-
const prebuilt = values.runner
|
|
2
|
+
const prebuilt = values.runner;
|
|
3
3
|
if ([prebuilt, values.dev, values.preview, values.release].filter(Boolean).length > 1) {
|
|
4
4
|
throw new Error("Choose only one build mode: --dev, --preview, --release, or --runner.");
|
|
5
5
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { restoreNativeMetadata } from "./native-metadata.js";
|
|
2
|
+
import { assertNativePatchPreflight } from "./native-patch-preflight.js";
|
|
3
|
+
import { missingNativeFrameworks, preparationChanges, preserveMacOSPods } from "./native-preparation.js";
|
|
1
4
|
import { macOSReleaseSettings } from "./macos-release.js";
|
|
2
|
-
import { projectPlatform } from "./platform.js";
|
|
5
|
+
import { macOSXcodeArchitecture, projectPlatform } from "./platform.js";
|
|
3
6
|
import { isUniversal, isExpoProject } from "@legendapp/spark-desktop-config/config.cjs";
|
|
4
7
|
import { buildWindows } from "./windows.js";
|
|
5
8
|
import { copyHelpers } from "./helpers.js";
|
|
@@ -8,8 +11,9 @@ import { cpSync, existsSync, mkdirSync, readFileSync, realpathSync, readdirSync,
|
|
|
8
11
|
import path from "node:path";
|
|
9
12
|
import { registerRuntime } from "./local.js";
|
|
10
13
|
import { binary, doctor, run } from "./commands.js";
|
|
11
|
-
import { prepareConfig, entryFile, digest, hashFiles,
|
|
14
|
+
import { prepareConfig, entryFile, digest, hashFiles, nativePreparationInputs, nativeProjectFingerprint, localSigningIdentity, nativePackages, readJson, runtimeFor, selection, stateFile, writeJson, validateBuildModules, goConfigurationIssues, } from "./project.js";
|
|
12
15
|
export async function analyze(root, packages = nativePackages(root)) {
|
|
16
|
+
assertNativePatchPreflight(root);
|
|
13
17
|
if (projectPlatform(root) === "windows")
|
|
14
18
|
throw new Error("Windows production analysis is not implemented; use spark build --dev.");
|
|
15
19
|
prepareConfig(root);
|
|
@@ -21,7 +25,9 @@ export async function analyze(root, packages = nativePackages(root)) {
|
|
|
21
25
|
"--platform",
|
|
22
26
|
"macos",
|
|
23
27
|
"--entry-file",
|
|
24
|
-
|
|
28
|
+
// Metro resolves export entries from its server root, which can be the
|
|
29
|
+
// containing workspace rather than this app's project root.
|
|
30
|
+
path.resolve(root, entryFile(root)),
|
|
25
31
|
"--bundle-output",
|
|
26
32
|
path.join(dir, "app.js"),
|
|
27
33
|
"--sourcemap-output",
|
|
@@ -32,7 +38,7 @@ export async function analyze(root, packages = nativePackages(root)) {
|
|
|
32
38
|
"false",
|
|
33
39
|
"--max-workers",
|
|
34
40
|
"2",
|
|
35
|
-
], { env: { CI: "1", ...env },
|
|
41
|
+
], { env: { CI: "1", ...env }, label: "Analyzing production JavaScript" });
|
|
36
42
|
await exportBundle({ SPARK_RUNTIME_DISCOVERY: "1" });
|
|
37
43
|
const discovery = readJson(path.join(dir, "app.map"));
|
|
38
44
|
const runtimeCore = packages.find(pkg => pkg.name === "@react-native-runtimes/core");
|
|
@@ -72,6 +78,7 @@ export async function analyze(root, packages = nativePackages(root)) {
|
|
|
72
78
|
return result;
|
|
73
79
|
}
|
|
74
80
|
export async function build(root, mode, force = false) {
|
|
81
|
+
assertNativePatchPreflight(root);
|
|
75
82
|
const lock = stateFile(root, "build.lock");
|
|
76
83
|
mkdirSync(path.dirname(lock), { recursive: true });
|
|
77
84
|
try {
|
|
@@ -131,16 +138,12 @@ async function buildUnlocked(root, mode, force) {
|
|
|
131
138
|
if (productionHash)
|
|
132
139
|
runtime.fingerprint = digest(runtime.fingerprint + productionHash);
|
|
133
140
|
const resultFile = stateFile(root, `${mode}-build.json`);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
console.log(`Reusing ${existing.app}`);
|
|
139
|
-
return existing;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
141
|
+
const excludedNames = [...new Set([
|
|
142
|
+
...(readAppConfig(root).expo.autolinking?.exclude ?? []),
|
|
143
|
+
...chosen.excluded.map((p) => p.name),
|
|
144
|
+
])];
|
|
142
145
|
writeJson(stateFile(root, "native-selection.json"), {
|
|
143
|
-
excluded:
|
|
146
|
+
excluded: excludedNames,
|
|
144
147
|
included: chosen.included.map((p) => ({ name: p.name, root: p.root })),
|
|
145
148
|
});
|
|
146
149
|
const rnConfig = path.join(root, "react-native.config.js");
|
|
@@ -155,66 +158,97 @@ async function buildUnlocked(root, mode, force) {
|
|
|
155
158
|
if (!isUniversal(root)) {
|
|
156
159
|
pkg.expo ??= {};
|
|
157
160
|
pkg.expo.autolinking ??= {};
|
|
158
|
-
pkg.expo.autolinking.exclude =
|
|
161
|
+
pkg.expo.autolinking.exclude = excludedNames;
|
|
159
162
|
writeJson(path.join(root, "package.json"), pkg);
|
|
160
163
|
}
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
packages: chosen.included.map((p) => [
|
|
164
|
-
p.name,
|
|
165
|
-
hashFiles(p.root, [
|
|
166
|
-
"package.json",
|
|
167
|
-
p.json.codegenConfig?.jsSrcsDir ?? "src",
|
|
168
|
-
...readdirSync(p.root).filter((name) => name.endsWith(".podspec")),
|
|
169
|
-
]),
|
|
170
|
-
]),
|
|
171
|
-
plugin: hostSourceSignature(root),
|
|
172
|
-
}));
|
|
164
|
+
const inputs = nativePreparationInputs(root, chosen.included);
|
|
165
|
+
const preparation = { fingerprint: digest(JSON.stringify(inputs)), inputs, projectFingerprint: nativeProjectFingerprint(inputs, chosen.included) };
|
|
173
166
|
const preparedFile = stateFile(root, "native-preparation.json");
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
167
|
+
const prepared = existsSync(preparedFile) ? readJson(preparedFile) : undefined;
|
|
168
|
+
const nativeRoot = path.join(root, "macos");
|
|
169
|
+
const hasNativeProject = existsSync(nativeRoot) && readdirSync(nativeRoot).some(name => name.endsWith(".xcodeproj") && existsSync(path.join(nativeRoot, name, "project.pbxproj")));
|
|
170
|
+
const needsProject = force || !hasNativeProject || prepared?.projectFingerprint !== preparation.projectFingerprint;
|
|
171
|
+
const needsPreparation = needsProject ||
|
|
172
|
+
prepared?.fingerprint !== preparation.fingerprint ||
|
|
177
173
|
!existsSync(path.join(root, "macos/Pods/Manifest.lock"));
|
|
178
|
-
|
|
174
|
+
const existing = existsSync(resultFile) ? readJson(resultFile) : undefined;
|
|
175
|
+
if (!force && existing) {
|
|
176
|
+
if (existing.runtime.fingerprint === runtime.fingerprint &&
|
|
177
|
+
existing.preparation?.fingerprint === preparation.fingerprint &&
|
|
178
|
+
existsSync(existing.app)) {
|
|
179
|
+
console.log(`Reusing ${existing.app}`);
|
|
180
|
+
return existing;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const reasons = force ? ["forced build"] : !existing ? ["no cached app"] : [
|
|
184
|
+
...preparationChanges(existing.preparation, preparation),
|
|
185
|
+
...(existing.runtime.fingerprint !== runtime.fingerprint ? ["runtime inputs changed"] : []),
|
|
186
|
+
...(!existsSync(existing.app) ? ["cached app missing"] : []),
|
|
187
|
+
];
|
|
188
|
+
console.log(`Building ${mode} runtime: ${reasons.join("; ")}.`);
|
|
189
|
+
const nativeConfig = readAppConfig(root).expo;
|
|
190
|
+
if (needsPreparation)
|
|
191
|
+
rmSync(preparedFile, { force: true });
|
|
192
|
+
if (needsProject) {
|
|
193
|
+
console.log(`Preparing native project (preserving CocoaPods cache): ${force ? "forced build" : !hasNativeProject ? "native project missing" : preparationChanges(prepared, preparation).join("; ") || "native project provenance missing"}.`);
|
|
179
194
|
const manifest = readFileSync(path.join(root, "package.json"), "utf8");
|
|
195
|
+
const appJson = path.join(root, "app.json");
|
|
196
|
+
const originalAppJson = existsSync(appJson) ? readFileSync(appJson, "utf8") : undefined;
|
|
180
197
|
try {
|
|
181
|
-
await run(root, [
|
|
198
|
+
await preserveMacOSPods(root, () => run(root, [
|
|
182
199
|
binary(root, "expo-desktop"),
|
|
183
200
|
"prebuild",
|
|
184
201
|
"--platform",
|
|
185
202
|
"macos",
|
|
186
203
|
"--template",
|
|
187
|
-
"expo-desktop-template-bare-minimum@54.81.1
|
|
204
|
+
"expo-desktop-template-bare-minimum@54.81.1",
|
|
188
205
|
"--no-install",
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
206
|
+
// Template renaming is not idempotent (HelloWorld becomes
|
|
207
|
+
// LegendHelloWorld, then LegendLegendHelloWorld). Native projects
|
|
208
|
+
// are generated output; recreate them only when project inputs change.
|
|
209
|
+
"--clean",
|
|
210
|
+
], { env: { CI: "1" }, label: "Generating native project" }));
|
|
211
|
+
// Expo Desktop copies all-platform template dependencies even for macOS. Preserve this
|
|
192
212
|
// platform's installed manifest instead of silently adding uninstalled Windows packages.
|
|
193
213
|
}
|
|
194
214
|
finally {
|
|
195
215
|
writeFileSync(path.join(root, "package.json"), manifest);
|
|
216
|
+
// Upstream template replacement also rewrites app.json substrings.
|
|
217
|
+
if (originalAppJson !== undefined)
|
|
218
|
+
writeFileSync(appJson, originalAppJson);
|
|
196
219
|
}
|
|
220
|
+
}
|
|
221
|
+
if (needsPreparation) {
|
|
197
222
|
// ReactCodegen's source glob must not pick up bindings from a previously larger graph.
|
|
198
223
|
rmSync(path.join(root, "macos/build/generated"), {
|
|
199
224
|
recursive: true,
|
|
200
225
|
force: true,
|
|
201
226
|
});
|
|
227
|
+
}
|
|
228
|
+
const missing = missingNativeFrameworks(root);
|
|
229
|
+
if (needsPreparation || missing.length) {
|
|
230
|
+
if (needsPreparation && !needsProject)
|
|
231
|
+
console.log(`Updating CocoaPods dependencies: ${prepared?.fingerprint !== preparation.fingerprint ? preparationChanges(prepared, preparation).join("; ") : "CocoaPods state missing"}.`);
|
|
232
|
+
if (missing.length && !needsPreparation)
|
|
233
|
+
console.log(`Restoring missing native frameworks:\n${missing.join("\n")}`);
|
|
202
234
|
await run(root, ["pod", "install"], {
|
|
203
235
|
cwd: path.join(root, "macos"),
|
|
204
236
|
env: { RCT_NEW_ARCH_ENABLED: "1" },
|
|
205
|
-
|
|
237
|
+
label: "Installing CocoaPods dependencies",
|
|
206
238
|
});
|
|
207
|
-
|
|
239
|
+
const remaining = missingNativeFrameworks(root);
|
|
240
|
+
if (remaining.length)
|
|
241
|
+
throw new Error(`Native frameworks are missing after pod install. Restore the package's native artifacts and retry:\n${remaining.join("\n")}`);
|
|
242
|
+
writeJson(preparedFile, preparation);
|
|
208
243
|
}
|
|
209
|
-
|
|
244
|
+
await restoreNativeMetadata(root, nativeConfig);
|
|
210
245
|
const workspace = readdirSync(nativeRoot).find((name) => name.endsWith(".xcworkspace"));
|
|
211
246
|
if (!workspace)
|
|
212
247
|
throw new Error("Prebuild did not produce a macOS workspace.");
|
|
213
248
|
const name = workspace.slice(0, -".xcworkspace".length);
|
|
214
249
|
const configuration = mode === "release" ? "Release" : "Debug";
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
// Export once for analysis; native build performs the normal production bundle step.
|
|
250
|
+
const xcodeArch = macOSXcodeArchitecture(runtime.arch);
|
|
251
|
+
const derived = stateFile(root, `DerivedData/macos-${runtime.arch}`);
|
|
218
252
|
await run(root, [
|
|
219
253
|
"xcodebuild",
|
|
220
254
|
"-workspace",
|
|
@@ -224,10 +258,10 @@ async function buildUnlocked(root, mode, force) {
|
|
|
224
258
|
"-configuration",
|
|
225
259
|
configuration,
|
|
226
260
|
"-destination",
|
|
227
|
-
|
|
261
|
+
`platform=macOS,arch=${xcodeArch}`,
|
|
228
262
|
"-derivedDataPath",
|
|
229
263
|
derived,
|
|
230
|
-
|
|
264
|
+
`ARCHS=${xcodeArch}`,
|
|
231
265
|
"ONLY_ACTIVE_ARCH=YES",
|
|
232
266
|
"CODE_SIGNING_ALLOWED=NO",
|
|
233
267
|
...(mode === "release" ? macOSReleaseSettings : []),
|
|
@@ -236,13 +270,13 @@ async function buildUnlocked(root, mode, force) {
|
|
|
236
270
|
"build",
|
|
237
271
|
], {
|
|
238
272
|
env: { RCT_NEW_ARCH_ENABLED: "1", ENTRY_FILE: entryFile(root), ...(productionGraph ? { SPARK_RUNTIME_SOURCES: stateFile(root, "analysis/runtime-sources.json") } : {}) },
|
|
239
|
-
|
|
273
|
+
label: `Building ${mode === "go" ? "Spark Runner" : mode} runtime (${configuration}, ${runtime.arch})`,
|
|
240
274
|
});
|
|
241
275
|
const products = path.join(derived, "Build", "Products", configuration);
|
|
242
276
|
const product = readdirSync(products).find((name) => name.endsWith(".app"));
|
|
243
277
|
if (!product)
|
|
244
278
|
throw new Error("Build completed without an app product.");
|
|
245
|
-
const destination = stateFile(root, `products/${mode}/${product}`);
|
|
279
|
+
const destination = stateFile(root, `products/macos-${runtime.arch}/${mode}/${product}`);
|
|
246
280
|
rmSync(destination, { recursive: true, force: true });
|
|
247
281
|
mkdirSync(path.dirname(destination), { recursive: true });
|
|
248
282
|
cpSync(path.join(products, product), destination, { recursive: true, verbatimSymlinks: true });
|
|
@@ -252,6 +286,7 @@ async function buildUnlocked(root, mode, force) {
|
|
|
252
286
|
const result = {
|
|
253
287
|
app: destination,
|
|
254
288
|
runtime: runtimeFor(root, chosen.included, mode),
|
|
289
|
+
preparation,
|
|
255
290
|
};
|
|
256
291
|
if (mode === "go" && process.env.SPARK_RELEASE_REVISION) {
|
|
257
292
|
if (!/^[a-f0-9]{40}$/.test(process.env.SPARK_RELEASE_REVISION))
|
|
@@ -269,9 +304,9 @@ async function buildUnlocked(root, mode, force) {
|
|
|
269
304
|
if (existsSync(hermes))
|
|
270
305
|
await run(root, ["strip", "-S", "-x", hermes], { capture: true });
|
|
271
306
|
}
|
|
272
|
-
//
|
|
273
|
-
//
|
|
274
|
-
await run(root, ["codesign", "--force", "--deep", "--sign",
|
|
307
|
+
// Development apps can opt into a local identity for same-team native plugins.
|
|
308
|
+
// Standalone outputs remain ad-hoc until `spark package` signs its staging copy.
|
|
309
|
+
await run(root, ["codesign", "--force", "--deep", "--sign", localSigningIdentity(root, mode), destination], { capture: true });
|
|
275
310
|
writeJson(resultFile, result);
|
|
276
311
|
console.log(`Built ${destination}`);
|
|
277
312
|
return result;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { parseArgs } from "node:util";
|
|
2
|
+
import { buildMode } from "./build-mode.js";
|
|
3
|
+
const options = {
|
|
4
|
+
example: { type: "string" }, "package-manager": { type: "string" },
|
|
5
|
+
runtime: { type: "string", multiple: true }, universal: { type: "boolean" },
|
|
6
|
+
device: { type: "string" }, project: { type: "string" }, platform: { type: "string" },
|
|
7
|
+
packages: { type: "string" }, port: { type: "string" }, runner: { type: "boolean" },
|
|
8
|
+
dev: { type: "boolean" }, release: { type: "boolean" }, preview: { type: "boolean" },
|
|
9
|
+
force: { type: "boolean" }, "submission-id": { type: "string" }, help: { type: "boolean", short: "h" },
|
|
10
|
+
};
|
|
11
|
+
const commands = {
|
|
12
|
+
create: { flags: ["example", "package-manager", "universal", "platform", "packages"], arguments: [1, 1] },
|
|
13
|
+
"add desktop": { flags: ["project", "packages"], arguments: [0, 0] },
|
|
14
|
+
"sdk export": { flags: ["packages", "runtime"], arguments: [1, 1] },
|
|
15
|
+
"sdk import": { flags: [], arguments: [1, 1] },
|
|
16
|
+
"sdk register": { flags: [], arguments: [1, 1] },
|
|
17
|
+
"sdk pack": { flags: ["project", "platform"], arguments: [0, 0] },
|
|
18
|
+
"sdk package-runner": { flags: ["project", "platform", "force", "submission-id"], arguments: [0, 0] },
|
|
19
|
+
"sdk build-runner": { flags: ["project", "platform", "packages", "package-manager", "force"], arguments: [0, 0] },
|
|
20
|
+
build: { flags: ["project", "platform", "device", "port", "runner", "dev", "release", "preview", "force"], arguments: [0, 0] },
|
|
21
|
+
prebuild: { flags: ["project", "platform"], arguments: [0, 0] },
|
|
22
|
+
doctor: { flags: ["project"], arguments: [0, 0] },
|
|
23
|
+
"updates init": { flags: ["project", "platform"], arguments: [1, 1] },
|
|
24
|
+
credentials: { flags: ["project", "platform"], arguments: [0, 0] },
|
|
25
|
+
package: { flags: ["project", "platform", "force", "submission-id"], arguments: [0, 0] },
|
|
26
|
+
analyze: { flags: ["project", "platform"], arguments: [0, 0] },
|
|
27
|
+
open: { flags: ["project", "platform", "port"], arguments: [0, 1] },
|
|
28
|
+
};
|
|
29
|
+
/** Validate the command grammar before resolving a project or performing side effects. */
|
|
30
|
+
export function cliArguments(args) {
|
|
31
|
+
const parsed = parseArgs({ args, allowPositionals: true, options });
|
|
32
|
+
const { values, positionals } = parsed;
|
|
33
|
+
const grouped = ["sdk", "add", "updates"].includes(positionals[0]);
|
|
34
|
+
const command = positionals.slice(0, grouped ? 2 : 1).join(" ");
|
|
35
|
+
if (!command || (grouped && positionals.length === 1 && values.help)) {
|
|
36
|
+
if (Object.keys(values).some(key => key !== "help"))
|
|
37
|
+
throw new Error("Choose a command before specifying options. Run spark --help.");
|
|
38
|
+
return parsed;
|
|
39
|
+
}
|
|
40
|
+
const contract = commands[command];
|
|
41
|
+
if (!contract)
|
|
42
|
+
throw new Error(`Unknown command: ${command}. Run spark --help.`);
|
|
43
|
+
for (const key of Object.keys(values))
|
|
44
|
+
if (key !== "help" && !contract.flags.includes(key))
|
|
45
|
+
throw new Error(`--${key} is not an option for spark ${command}`);
|
|
46
|
+
const count = positionals.length - (grouped ? 2 : 1);
|
|
47
|
+
if ((!values.help && count < contract.arguments[0]) || count > contract.arguments[1])
|
|
48
|
+
throw new Error(`Invalid arguments for spark ${command}. Expected ${contract.arguments[0] === contract.arguments[1] ? contract.arguments[0] : "zero or one"} positional argument(s).`);
|
|
49
|
+
if (values.platform && !["macos", "windows", "ios", "android", "web"].includes(values.platform))
|
|
50
|
+
throw new Error("Platform must be macos, windows, ios, android, or web.");
|
|
51
|
+
if (values.port !== undefined && (!Number.isInteger(Number(values.port)) || Number(values.port) < 1 || Number(values.port) > 65535))
|
|
52
|
+
throw new Error("Port must be an integer between 1 and 65535.");
|
|
53
|
+
if (values["package-manager"] && !["npm", "pnpm", "yarn", "bun"].includes(values["package-manager"]))
|
|
54
|
+
throw new Error("Package manager must be npm, pnpm, yarn, or bun.");
|
|
55
|
+
if (command === "build")
|
|
56
|
+
buildMode(values);
|
|
57
|
+
if (command === "sdk build-runner" && values.project && (values.packages || values["package-manager"]))
|
|
58
|
+
throw new Error("--packages and --package-manager configure a generated Runner project; omit --project to use them.");
|
|
59
|
+
return parsed;
|
|
60
|
+
}
|
|
@@ -39,6 +39,9 @@ export async function run(root, argv, options = {}) {
|
|
|
39
39
|
running.get(root).add(child);
|
|
40
40
|
let output = "";
|
|
41
41
|
const log = stateFile(root, `logs/${Date.now()}-${crypto.randomUUID()}-${path.basename(argv[0])}.log`);
|
|
42
|
+
const started = Date.now();
|
|
43
|
+
if (options.label)
|
|
44
|
+
console.log(`${options.label}…\nLog: ${log}`);
|
|
42
45
|
async function consume(stream, target) {
|
|
43
46
|
const decoder = new TextDecoder();
|
|
44
47
|
for await (const chunk of stream) {
|
|
@@ -72,6 +75,8 @@ export async function run(root, argv, options = {}) {
|
|
|
72
75
|
}
|
|
73
76
|
if (code)
|
|
74
77
|
throw new Error(`${argv.map(redact).join(" ")} exited ${code}. See ${log}\n${redact(output).slice(-1800)}`);
|
|
78
|
+
if (options.label)
|
|
79
|
+
console.log(`${options.label} finished (${((Date.now() - started) / 1000).toFixed(1)}s).`);
|
|
75
80
|
return output;
|
|
76
81
|
}
|
|
77
82
|
export function binary(root, name) {
|
|
@@ -94,8 +99,8 @@ export async function doctor(root) {
|
|
|
94
99
|
await run(root, ["pwsh.exe", "-File", path.join(windows, "Scripts/rnw-dependencies.ps1")]);
|
|
95
100
|
return;
|
|
96
101
|
}
|
|
97
|
-
if (process.platform !== "darwin"
|
|
98
|
-
throw new Error("
|
|
102
|
+
if (process.platform !== "darwin")
|
|
103
|
+
throw new Error("Native macOS builds require macOS.");
|
|
99
104
|
for (const tool of ["node", "pod", "xcodebuild"])
|
|
100
105
|
if (!which(tool))
|
|
101
106
|
throw new Error(`Missing ${tool}. Install the macOS native prerequisites described in docs/development.md, then retry the build.`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { packageSources } from "./release.js";
|
|
1
|
+
import { installedRelease, materializeReleasePackages, packageSources, verifyMaterializedReleasePackages } from "./release.js";
|
|
2
2
|
import { packageManager, managerCommand, applyOverrides, localArchive } from "./package-manager.js";
|
|
3
3
|
import { packArchive } from "./pack-archive.js";
|
|
4
4
|
import { spawnProcess } from "./process.js";
|
|
@@ -16,7 +16,13 @@ const template = path.resolve(import.meta.dirname, "../templates/blank-typescrip
|
|
|
16
16
|
export async function refreshLocalPackages(root, manifest, selectedManager) {
|
|
17
17
|
const pkg = readJson(path.join(root, "package.json"));
|
|
18
18
|
// The template owns the tested compatibility matrix, not module inclusion.
|
|
19
|
-
const
|
|
19
|
+
const defaults = readJson(path.join(template, "package.json"));
|
|
20
|
+
const pins = { ...defaults.overrides, ...Object.fromEntries(Object.entries(defaults.dependencies)
|
|
21
|
+
.filter(([name]) => name.startsWith("expo-desktop"))) };
|
|
22
|
+
for (const [name, version] of Object.entries(pins)) {
|
|
23
|
+
if (pkg.dependencies?.[name])
|
|
24
|
+
pkg.dependencies[name] = version;
|
|
25
|
+
}
|
|
20
26
|
const manager = packageManager(root, selectedManager);
|
|
21
27
|
const overrides = { ...pins };
|
|
22
28
|
for (const [name, file] of Object.entries(readJson(manifest))) {
|
|
@@ -42,9 +48,12 @@ export async function create(root, archiveManifest, platform = hostPlatform(), u
|
|
|
42
48
|
try {
|
|
43
49
|
cpSync(source, temporary, { recursive: true });
|
|
44
50
|
const pkg = readJson(path.join(temporary, "package.json"));
|
|
45
|
-
const
|
|
51
|
+
const release = archiveManifest ? undefined : installedRelease();
|
|
52
|
+
const archives = packageSources(archiveManifest, release);
|
|
46
53
|
if (pkg.dependencies["@react-native-runtimes/core"] && !archives["@react-native-runtimes/core"])
|
|
47
54
|
throw new Error("This SDK lacks the patched Runtimes archive. Repack or install the complete SDK.");
|
|
55
|
+
if (release)
|
|
56
|
+
await materializeReleasePackages(release, temporary);
|
|
48
57
|
const overrides = {};
|
|
49
58
|
for (const [name, file] of Object.entries(archives)) {
|
|
50
59
|
overrides[name] = file;
|
|
@@ -58,10 +67,12 @@ export async function create(root, archiveManifest, platform = hostPlatform(), u
|
|
|
58
67
|
if (manager === "pnpm")
|
|
59
68
|
writeFileSync(path.join(temporary, ".npmrc"), "node-linker=hoisted\n");
|
|
60
69
|
await packArchive(temporary, templateFile);
|
|
70
|
+
if (release)
|
|
71
|
+
verifyMaterializedReleasePackages(release, temporary);
|
|
61
72
|
// The upstream CLI owns validation, extraction, app IDs, install, and Git setup.
|
|
62
73
|
// The templates' postinstall initializes spark configuration once.
|
|
63
74
|
const name = path.basename(root);
|
|
64
|
-
//
|
|
75
|
+
// Expo Desktop misreads npm 12's record-shaped pack metadata for a local tarball.
|
|
65
76
|
// Use the compatible npm executable for upstream extraction; the chosen manager installs.
|
|
66
77
|
const npmBin = path.join(import.meta.dirname, "npm-bin");
|
|
67
78
|
// Expo needs file: to distinguish Windows drive paths from npm package names.
|
|
@@ -75,11 +86,26 @@ export async function create(root, archiveManifest, platform = hostPlatform(), u
|
|
|
75
86
|
finally {
|
|
76
87
|
rmSync(temporary, { recursive: true, force: true });
|
|
77
88
|
}
|
|
89
|
+
if (!archiveManifest) {
|
|
90
|
+
const release = installedRelease();
|
|
91
|
+
if (release)
|
|
92
|
+
verifyMaterializedReleasePackages(release, root);
|
|
93
|
+
const ignoreFile = path.join(root, ".gitignore");
|
|
94
|
+
const ignore = existsSync(ignoreFile) ? readFileSync(ignoreFile, "utf8") : "";
|
|
95
|
+
if (!ignore.includes("!/spark-packages/**"))
|
|
96
|
+
writeFileSync(ignoreFile, `${ignore}${ignore.endsWith("\n") || !ignore ? "" : "\n"}\n# Spark verified release package inputs\n!/spark-packages/\n!/spark-packages/**\n`);
|
|
97
|
+
}
|
|
78
98
|
// Upstream can report success after an install failure. Require a usable CLI.
|
|
79
99
|
if (!existsSync(path.join(root, "node_modules/@legendapp/spark/package.json")))
|
|
80
100
|
throw new Error(`Dependency installation failed. Run ${manager} install in ${root} and retry.`);
|
|
81
|
-
if (example)
|
|
101
|
+
if (example) {
|
|
102
|
+
if (!archiveManifest) {
|
|
103
|
+
const release = installedRelease();
|
|
104
|
+
if (release)
|
|
105
|
+
verifyMaterializedReleasePackages(release, root);
|
|
106
|
+
}
|
|
82
107
|
await configureExample(root, example);
|
|
108
|
+
}
|
|
83
109
|
console.log(`Created ${root}.\n\n cd ${JSON.stringify(root)}\n ${manager} run ${platform}`);
|
|
84
110
|
}
|
|
85
111
|
export function upgradeManagedEntry(root) {
|