@legendapp/spark 0.0.3 → 0.0.5
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/init-template.cjs +7 -1
- package/package.json +11 -6
- package/patches/dependencies.json +4 -4
- package/patches/react-native-mmkv@4.3.2.patch +2 -2
- package/patches/react-native-nitro-zxing@0.3.1.patch +22 -0
- package/patches/registry.json +615 -0
- package/patches/workspace/expo-audio@55.0.18.patch +159 -0
- package/patches/workspace/op-engineering-op-sqlite@18.2.1.patch +796 -0
- package/patches/workspace/react-native-nitro-modules@0.37.0.patch +1348 -0
- package/patches/workspace/react-native-runtimes-core@0.1.0-alpha.2.patch +276 -0
- package/patches/workspace/react-native-webview@16.0.0.patch +208 -0
- package/postinstall.cjs +10 -1
- package/skills/spark/SKILL.md +37 -4
- package/skills/spark/UPGRADING.md +174 -1
- package/skills/spark/ai-customize.md +39 -0
- package/skills/spark/app-and-documents.md +56 -0
- package/skills/spark/external-libraries.md +87 -0
- package/skills/spark/files.md +64 -0
- package/skills/spark/integrations.md +69 -0
- package/skills/spark/keyboard.md +54 -0
- package/skills/spark/library-compat.md +76 -0
- package/skills/spark/menus-tray-dock.md +83 -0
- package/skills/spark/storage-settings.md +59 -0
- package/skills/spark/ui.md +83 -0
- package/skills/spark/windows.md +91 -0
- package/ui-popover.ts +1 -0
- package/ui-progress.ts +1 -0
- package/ui-sheet.ts +1 -0
- package/ui-split-view.ts +1 -0
- package/ui-table.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -13
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +5 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +157 -106
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +16 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +19 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +57 -9
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.cjs +12 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrate.js +65 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +4 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +15 -8
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +35 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +4 -8
- package/vendor/node_modules/@legendapp/spark-cli/dist/patch.js +92 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +8 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/publish-directory.js +32 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release-app.js +139 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +17 -17
- package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +61 -41
- package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/package.json +5 -4
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-clipboard/macos/RNDesktopClipboard.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-clipboard/src/desktop.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +3 -7
- package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.h +3 -1
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +51 -10
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.h +4 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkStorage.mm +82 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.h +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -8
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +6 -8
- package/vendor/node_modules/@legendapp/spark-desktop-config/identity.cjs +2 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +300 -71
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +7 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.cjs +318 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/patch-registry.d.cts +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.cjs +20 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/validation.cjs +66 -9
- package/vendor/node_modules/@legendapp/spark-desktop-config/windows.plugin.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +17 -5
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/RNDesktopWindows.mm +7 -2
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +235 -240
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -11
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +9 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +7 -0
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/types.ts +32 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/validation.ts +28 -11
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/createWindowsNavigator.tsx +15 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/primaryWindowLifecycle.ts +12 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/usePrimaryWindowLifecycle.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/windows/useWindowFocusEffect.ts +4 -1
- package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
- package/vendor/node_modules/@legendapp/spark-drag-drop/macos/RNDesktopDragView.mm +77 -17
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -8
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/DesktopDragViewNativeComponent.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/contracts.ts +13 -4
- package/vendor/node_modules/@legendapp/spark-drag-drop/src/index.tsx +5 -3
- package/vendor/node_modules/@legendapp/spark-drag-drop/windows/SparkDragDrop/SparkDragDrop.h +6 -1
- package/vendor/node_modules/@legendapp/spark-expo-compat/metro.cjs +44 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +20 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/src/clipboard.ts +40 -0
- package/vendor/node_modules/@legendapp/spark-expo-compat/src/document-picker.ts +52 -0
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/options.ts +5 -2
- package/vendor/node_modules/@legendapp/spark-file-dialog/src/types.ts +3 -3
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -11
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-message-dialog/src/index.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -9
- package/vendor/node_modules/@legendapp/spark-native-menu/src/hooks.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/index.tsx +122 -334
- package/vendor/node_modules/@legendapp/spark-settings-ui/src/rows.tsx +183 -0
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-system/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -10
- package/vendor/node_modules/@legendapp/spark-tray/src/index.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkButton.mm +82 -14
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.h +1 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/RNSparkTextInput.mm +94 -11
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +235 -18
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.h +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkPaneSplitView.mm +216 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.h +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewComponent.mm +212 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSparkSplitViewUpdates.h +6 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +28 -13
- package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.mm +17 -1
- package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/popover/RNSparkPopover.mm +126 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/progress/RNSparkProgressIndicator.mm +66 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/radio-group/RNSparkRadioGroup.mm +118 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sf-symbol/RNSFSymbol.mm +4 -12
- package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sheet/RNSparkSheet.mm +109 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +438 -102
- package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.h +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/table/RNSparkTable.mm +179 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +9 -8
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkButtonNativeComponent.ts +10 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/SparkTextInputNativeComponent.ts +2 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +9 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitView.tsx +99 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SplitViewNativeComponent.ts +29 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +34 -17
- package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +6 -4
- package/vendor/node_modules/@legendapp/spark-ui/src/checkbox-unavailable.tsx +20 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +24 -3
- package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +72 -20
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +18 -12
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +21 -15
- package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +40 -16
- package/vendor/node_modules/@legendapp/spark-ui/src/mobile-input.tsx +2 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSelectNativeComponent.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/popover/PopoverNativeComponent.ts +20 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/popover/index.tsx +45 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/progress/ProgressIndicatorNativeComponent.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/progress/index.tsx +32 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/radio-group/RadioGroupNativeComponent.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sheet/SheetNativeComponent.ts +15 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sheet/index.tsx +38 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarItemNativeComponent.ts +9 -1
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/SidebarNativeComponent.ts +17 -2
- package/vendor/node_modules/@legendapp/spark-ui/src/sidebar/index.tsx +106 -22
- package/vendor/node_modules/@legendapp/spark-ui/src/switch.tsx +13 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/table/TableNativeComponent.ts +22 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/table/index.tsx +118 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +52 -7
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.ts +3 -1
- package/vendor/node_modules/@legendapp/spark-ui/uniwind.web.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-ui/windows/SparkUI/SparkUI.h +46 -15
- package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -9
- package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
- /package/{settings-window.ts → ui-settings.ts} +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync, realpathSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
export function checkReleasePayload(app, runner, info) {
|
|
4
|
+
const runtime = path.join(app, "Contents/Resources/spark-runtime.json");
|
|
5
|
+
if (!existsSync(runtime))
|
|
6
|
+
throw new Error("Distribution app is missing spark-runtime.json.");
|
|
7
|
+
if (!runner) {
|
|
8
|
+
const bundle = path.join(app, "Contents/Resources/main.jsbundle");
|
|
9
|
+
if (!existsSync(bundle))
|
|
10
|
+
throw new Error("Distribution app is missing its JavaScript bundle.");
|
|
11
|
+
if (readFileSync(bundle).subarray(0, 8).toString("hex") !== "c61fbc03c103191f") {
|
|
12
|
+
throw new Error("The release main.jsbundle must contain Hermes bytecode.");
|
|
13
|
+
}
|
|
14
|
+
const ats = info.NSAppTransportSecurity;
|
|
15
|
+
if (ats?.NSAllowsLocalNetworking === true || ats?.NSAllowsArbitraryLoads === true) {
|
|
16
|
+
throw new Error("The release Info.plist allows local networking or arbitrary loads.");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const entry of readdirSync(app, { recursive: true, withFileTypes: true })) {
|
|
20
|
+
if (/(?:^\.(?:git|DS_Store)$|^node_modules$|^__tests__$|\.(?:map|dSYM|o|a|p12|p8)$|^libclang_rt\..*\.dylib$)/i.test(entry.name) ||
|
|
21
|
+
(!runner && entry.name.endsWith(".debug.dylib"))) {
|
|
22
|
+
throw new Error(`Development artifact in the distribution app: ${path.relative(app, path.join(entry.parentPath, entry.name))}`);
|
|
23
|
+
}
|
|
24
|
+
if (entry.isFile() && /\.(?:mjs|cjs|js)$/.test(entry.name) &&
|
|
25
|
+
/(?:\/\/[#@]|\/\*[#@])\s*sourceMappingURL\s*=/.test(readFileSync(path.join(entry.parentPath, entry.name), "utf8"))) {
|
|
26
|
+
throw new Error(`Source map reference in the distribution app: ${path.relative(app, path.join(entry.parentPath, entry.name))}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function loadCommands(file, output) {
|
|
31
|
+
const images = output.split(/^Mach header$/m).slice(1).map(slice => {
|
|
32
|
+
const header = /^MH_\S+\s+(\S+)\s+\S+\s+\S+\s+(\S+)\s/m.exec(slice);
|
|
33
|
+
if (!header)
|
|
34
|
+
throw new Error(`Cannot read the Mach-O header in ${file}.`);
|
|
35
|
+
const image = { file, arch: header[1], type: header[2], rpaths: [], loads: [] };
|
|
36
|
+
for (const command of slice.split(/^Load command \d+$/m).slice(1)) {
|
|
37
|
+
const kind = /^\s*cmd (LC_\w+)$/m.exec(command)?.[1];
|
|
38
|
+
if (kind === "LC_DYLD_ENVIRONMENT")
|
|
39
|
+
throw new Error(`LC_DYLD_ENVIRONMENT in ${file}.`);
|
|
40
|
+
if (!kind || !/^LC_(?:RPATH|ID_DYLIB|LOAD_DYLINKER|(?:LOAD(?:_WEAK|_UPWARD)?|LAZY_LOAD|REEXPORT)_DYLIB)$/.test(kind))
|
|
41
|
+
continue;
|
|
42
|
+
const value = /^\s*(?:name|path) (.+) \(offset \d+\)$/m.exec(command)?.[1];
|
|
43
|
+
if (!value)
|
|
44
|
+
throw new Error(`Cannot read ${kind} in ${file}.`);
|
|
45
|
+
if (kind === "LC_RPATH")
|
|
46
|
+
image.rpaths.push(value);
|
|
47
|
+
else if (kind === "LC_ID_DYLIB")
|
|
48
|
+
image.id = value;
|
|
49
|
+
else
|
|
50
|
+
image.loads.push(value);
|
|
51
|
+
}
|
|
52
|
+
return image;
|
|
53
|
+
});
|
|
54
|
+
if (!images.length)
|
|
55
|
+
throw new Error(`Cannot read Mach-O load commands in ${file}.`);
|
|
56
|
+
return images;
|
|
57
|
+
}
|
|
58
|
+
const systemPath = (file) => /^\/(?:usr\/lib|System\/Library)(?:\/|$)/.test(file);
|
|
59
|
+
const cleanRpath = (value) => value.startsWith("@rpath/") && !value.split("/").includes("..");
|
|
60
|
+
export async function checkReleaseLoadPaths(root, app, main, files, execute) {
|
|
61
|
+
const byFile = new Map();
|
|
62
|
+
for (const file of files) {
|
|
63
|
+
byFile.set(file, loadCommands(file, await execute(root, ["otool", "-arch", "all", "-hv", "-l", file], { capture: true })));
|
|
64
|
+
}
|
|
65
|
+
const mainImages = byFile.get(realpathSync(main));
|
|
66
|
+
if (!mainImages?.every(image => image.type === "EXECUTE"))
|
|
67
|
+
throw new Error("Distribution app is missing its Mach-O executable.");
|
|
68
|
+
let sdk;
|
|
69
|
+
const visited = new Map();
|
|
70
|
+
const inside = (file) => file === app || file.startsWith(app + path.sep);
|
|
71
|
+
function expand(value, loader, executable) {
|
|
72
|
+
const token = /^@(loader_path|executable_path)(?:\/|$)/.exec(value);
|
|
73
|
+
if (token) {
|
|
74
|
+
const directory = path.dirname(token[1] === "loader_path" ? loader : executable);
|
|
75
|
+
const resolved = path.resolve(directory, value.slice(token[0].length));
|
|
76
|
+
if (inside(resolved))
|
|
77
|
+
return resolved;
|
|
78
|
+
}
|
|
79
|
+
else if (systemPath(value) && systemPath(path.normalize(value)))
|
|
80
|
+
return path.normalize(value);
|
|
81
|
+
}
|
|
82
|
+
async function inspect(image, loader, executable, inherited, ancestors = new Set()) {
|
|
83
|
+
if (ancestors.has(image))
|
|
84
|
+
return;
|
|
85
|
+
const rpaths = [...new Set([...image.rpaths.map(value => {
|
|
86
|
+
const expanded = expand(value, loader, executable);
|
|
87
|
+
if (!expanded)
|
|
88
|
+
throw new Error(`Invalid LC_RPATH ${value} in ${image.file}.`);
|
|
89
|
+
return expanded;
|
|
90
|
+
}), ...inherited])];
|
|
91
|
+
const context = JSON.stringify([loader, executable, rpaths]);
|
|
92
|
+
let contexts = visited.get(image);
|
|
93
|
+
if (contexts?.has(context))
|
|
94
|
+
return;
|
|
95
|
+
if (!contexts)
|
|
96
|
+
visited.set(image, contexts = new Set());
|
|
97
|
+
contexts.add(context);
|
|
98
|
+
if (image.id && !cleanRpath(image.id) && !expand(image.id, loader, executable)?.startsWith(app + path.sep)) {
|
|
99
|
+
throw new Error(`Invalid LC_ID_DYLIB ${image.id} in ${image.file}.`);
|
|
100
|
+
}
|
|
101
|
+
const chain = new Set([...ancestors, image]);
|
|
102
|
+
for (const load of image.loads) {
|
|
103
|
+
const expanded = expand(load, loader, executable);
|
|
104
|
+
if (expanded && systemPath(expanded))
|
|
105
|
+
continue;
|
|
106
|
+
const candidates = cleanRpath(load) ? rpaths.map(dir => path.join(dir, load.slice("@rpath/".length))) : expanded ? [expanded] : [];
|
|
107
|
+
let resolved = false;
|
|
108
|
+
for (const candidate of candidates) {
|
|
109
|
+
if (systemPath(candidate)) {
|
|
110
|
+
// Swift libraries may live in the dyld cache. The SDK stubs also keep this from accepting a missing bundled library.
|
|
111
|
+
sdk ??= (await execute(root, ["xcrun", "--sdk", "macosx", "--show-sdk-path"], { capture: true })).trim();
|
|
112
|
+
if (existsSync(candidate) || existsSync(path.join(sdk, candidate.replace(/\.dylib$/, ".tbd"))))
|
|
113
|
+
resolved = true;
|
|
114
|
+
}
|
|
115
|
+
else if (existsSync(candidate)) {
|
|
116
|
+
const dependency = byFile.get(realpathSync(candidate))?.find(other => other.arch === image.arch && other.type === "DYLIB");
|
|
117
|
+
if (dependency) {
|
|
118
|
+
await inspect(dependency, candidate, executable, rpaths, chain);
|
|
119
|
+
resolved = true;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (resolved)
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
if (!resolved)
|
|
126
|
+
throw new Error(`Unresolved load path ${load} in ${image.file} (${image.arch}).`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
const images = [...byFile.values()].flat();
|
|
130
|
+
for (const image of images.filter(image => image.type === "EXECUTE")) {
|
|
131
|
+
await inspect(image, image.file, image.file, []);
|
|
132
|
+
}
|
|
133
|
+
// Plug-ins and unused universal slices can still load in the main process's context.
|
|
134
|
+
for (const image of images.filter(image => !visited.has(image))) {
|
|
135
|
+
const host = mainImages.find(other => other.arch === image.arch) ?? mainImages[0];
|
|
136
|
+
const rpaths = host.rpaths.map(value => expand(value, main, main));
|
|
137
|
+
await inspect(image, image.file, main, rpaths);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"revision": "
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"revision": "8eeb0302ebfcf7fc49e3628b18171badaee46007",
|
|
5
5
|
"packages": {
|
|
6
6
|
"@react-native-runtimes/core": {
|
|
7
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
7
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/runtimes-4df45cb5ea74.tgz",
|
|
8
8
|
"size": 54050,
|
|
9
9
|
"sha256": "3a04e0455ac44b0bc11cfa315943ad84509c445111a2b3974ca85c8ed489827c"
|
|
10
10
|
},
|
|
11
11
|
"react-native-nitro-modules": {
|
|
12
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
13
|
-
"size":
|
|
14
|
-
"sha256": "
|
|
12
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/react-native-nitro-modules-0.37.0-71ddf8c04084.tgz",
|
|
13
|
+
"size": 145595,
|
|
14
|
+
"sha256": "71ddf8c0408471b46db6dc32112586cc7a0bbb63c606721ef3be8fe3438dfb3c"
|
|
15
15
|
},
|
|
16
16
|
"@op-engineering/op-sqlite": {
|
|
17
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
18
|
-
"size":
|
|
19
|
-
"sha256": "
|
|
17
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/op-engineering-op-sqlite-18.2.1-afe4b8ce5706.tgz",
|
|
18
|
+
"size": 5847598,
|
|
19
|
+
"sha256": "afe4b8ce5706385af514319ba38076f2d768220e043cc706ace99d0d7adcacd8"
|
|
20
20
|
},
|
|
21
21
|
"react-native-webview": {
|
|
22
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
23
|
-
"size":
|
|
24
|
-
"sha256": "
|
|
22
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/react-native-webview-16.0.0-fb06fd26c218.tgz",
|
|
23
|
+
"size": 116275,
|
|
24
|
+
"sha256": "fb06fd26c2188cc9a67581e2a634de385818a7ca7f749226b172fdda561d36d6"
|
|
25
25
|
},
|
|
26
26
|
"expo-audio": {
|
|
27
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
27
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/expo-audio-55.0.18-a8d70b5b39bd.tgz",
|
|
28
28
|
"size": 610139,
|
|
29
29
|
"sha256": "a8d70b5b39bd3b69d95528011f14aa93a0fdf7ff1e6c89e0f7489329230be060"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"runners": {
|
|
33
33
|
"macos-arm64": {
|
|
34
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
35
|
-
"size":
|
|
36
|
-
"sha256": "
|
|
34
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/spark-runner-macos-arm64.zip",
|
|
35
|
+
"size": 13454160,
|
|
36
|
+
"sha256": "0155991945a298d19b10e8be9dfa89fce0c67277d6d957f46a67520d9686f55b",
|
|
37
37
|
"app": "SparkRunner.app",
|
|
38
38
|
"teamId": "56DD97VT22",
|
|
39
|
-
"fingerprint": "
|
|
39
|
+
"fingerprint": "2d47860cb29f29bd1ddcd776ecf00c554e76c07f7e987331d97afc49391364ca"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
2
|
import { readAppConfig } from "./project.js";
|
|
3
3
|
import { existsSync, openSync, closeSync, readSync, readdirSync, realpathSync, lstatSync } from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
@@ -6,9 +6,11 @@ import { createRequire } from "node:module";
|
|
|
6
6
|
import { isDeepStrictEqual } from "node:util";
|
|
7
7
|
import { run } from "./commands.js";
|
|
8
8
|
import { digest, nativePackages, readJson, stateFile, writeJson } from "./project.js";
|
|
9
|
+
import { checkReleaseLoadPaths, checkReleasePayload } from "./release-app.js";
|
|
10
|
+
import { checkReleaseTestDriver } from "./release-driver.js";
|
|
9
11
|
const { resolveEntitlements } = createRequire(import.meta.url)("@legendapp/spark-desktop-config/entitlements.cjs");
|
|
10
12
|
export function distributionEntitlements(value) {
|
|
11
|
-
for (const key of ["com.apple.security.get-task-allow", "get-task-allow"]) {
|
|
13
|
+
for (const key of ["com.apple.security.get-task-allow", "get-task-allow", "com.apple.security.cs.disable-library-validation"]) {
|
|
12
14
|
if (value[key] !== undefined && value[key] !== false)
|
|
13
15
|
throw new Error(`${key} must be absent or false in a distribution app.`);
|
|
14
16
|
}
|
|
@@ -31,6 +33,19 @@ export function appEntitlements(root, modules) {
|
|
|
31
33
|
// release binary's module set, not whichever selection file was written last.
|
|
32
34
|
return resolveEntitlements(readAppConfig(root), selected.map((pkg) => pkg.json));
|
|
33
35
|
}
|
|
36
|
+
export function releaseAppExpectation(root, runtime, config, buildVersion) {
|
|
37
|
+
if (runtime.platform !== "macos" || !["release", "go"].includes(runtime.mode))
|
|
38
|
+
throw new Error("Expected a macOS release app or Spark Runner.");
|
|
39
|
+
const bundleId = config.macos?.bundleIdentifier, version = config.version;
|
|
40
|
+
if (!bundleId || !version || typeof buildVersion !== "string" || !buildVersion)
|
|
41
|
+
throw new Error("Bundle identifier and release version metadata must be configured before packaging.");
|
|
42
|
+
return {
|
|
43
|
+
runtime, bundleId, version, buildVersion,
|
|
44
|
+
entitlements: appEntitlements(root, runtime.modules),
|
|
45
|
+
byPath: config.extra?.spark?.signing?.macos?.entitlementsByPath ?? {},
|
|
46
|
+
testDriverInRelease: config.macos?.testDriverInRelease === true,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
34
49
|
function machOType(file) {
|
|
35
50
|
const fd = openSync(file, "r");
|
|
36
51
|
try {
|
|
@@ -87,8 +102,16 @@ export function signingOrder(app) {
|
|
|
87
102
|
return [...new Set([...code, ...containers])].sort((a, b) => b.split(path.sep).length - a.split(path.sep).length || a.localeCompare(b));
|
|
88
103
|
}
|
|
89
104
|
async function entitlementTargets(root, app, order, entitlements, byPath, execute) {
|
|
90
|
-
const targets = new Map(order.map(
|
|
91
|
-
targets.set(app, entitlements);
|
|
105
|
+
const targets = new Map(order.map(file => [file, {}]));
|
|
106
|
+
targets.set(app, distributionEntitlements(entitlements));
|
|
107
|
+
for (const [relative, value] of Object.entries(byPath)) {
|
|
108
|
+
const file = path.join(app, relative);
|
|
109
|
+
if (path.relative(app, file) !== relative || !targets.has(file) || file === app)
|
|
110
|
+
throw new Error(`Unknown nested signing target: ${relative}`);
|
|
111
|
+
if (!isProcessTarget(file) && Object.keys(value).length)
|
|
112
|
+
throw new Error(`Entitlements belong on executable processes, not libraries: ${relative}`);
|
|
113
|
+
targets.set(file, distributionEntitlements(value));
|
|
114
|
+
}
|
|
92
115
|
for (const container of order.filter((file) => /\.(app|xpc|appex)$/.test(file))) {
|
|
93
116
|
const plist = existsSync(path.join(container, "Contents/Info.plist")) ? path.join(container, "Contents/Info.plist") : path.join(container, "Info.plist");
|
|
94
117
|
const info = JSON.parse(await execute(root, ["plutil", "-convert", "json", "-o", "-", plist], { capture: true }));
|
|
@@ -105,70 +128,67 @@ async function entitlementTargets(root, app, order, entitlements, byPath, execut
|
|
|
105
128
|
}
|
|
106
129
|
return targets;
|
|
107
130
|
}
|
|
131
|
+
function isProcessTarget(file) {
|
|
132
|
+
return /\.(app|xpc|appex)$/.test(file) || (lstatSync(file).isFile() && machOType(file) === 2);
|
|
133
|
+
}
|
|
108
134
|
export async function signApp(root, app, credentials, entitlements, byPath = {}, execute = run) {
|
|
109
135
|
app = realpathSync(app);
|
|
110
|
-
distributionEntitlements(entitlements);
|
|
111
136
|
const order = signingOrder(app);
|
|
112
|
-
const relatives = new Set(order.map((file) => path.relative(app, file) || "."));
|
|
113
|
-
for (const [relative, value] of Object.entries(byPath)) {
|
|
114
|
-
if (!relatives.has(relative) || relative === ".")
|
|
115
|
-
throw new Error(`Unknown nested signing target: ${relative}`);
|
|
116
|
-
distributionEntitlements(value);
|
|
117
|
-
}
|
|
118
137
|
const targets = await entitlementTargets(root, app, order, entitlements, byPath, execute);
|
|
119
138
|
for (const file of order) {
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
139
|
+
const args = ["codesign", "--force", "--sign", credentials.hash, "--options", "runtime", "--timestamp"];
|
|
140
|
+
if (isProcessTarget(file)) {
|
|
141
|
+
const relative = path.relative(app, file) || ".";
|
|
142
|
+
const plist = stateFile(root, `packaging/entitlements/${digest(relative)}.plist`);
|
|
143
|
+
writeJson(plist, targets.get(file));
|
|
144
|
+
await execute(root, ["plutil", "-convert", "xml1", plist], { capture: true });
|
|
145
|
+
args.push("--entitlements", plist);
|
|
146
|
+
}
|
|
147
|
+
if (credentials.keychain)
|
|
148
|
+
args.push("--keychain", credentials.keychain);
|
|
149
|
+
await execute(root, [...args, file], { capture: true });
|
|
130
150
|
}
|
|
131
151
|
return order;
|
|
132
152
|
}
|
|
133
|
-
export async function validateApp(root, app,
|
|
153
|
+
export async function validateApp(root, app, identity, expected, notarized, execute = run) {
|
|
134
154
|
app = realpathSync(app);
|
|
135
|
-
if (expected.runner) {
|
|
136
|
-
const runtime = readJson(path.join(app, "Contents/Resources/spark-runtime.json"));
|
|
137
|
-
if (runtime.mode !== "go" || runtime.platform !== "macos" || runtime.arch !== expected.arch)
|
|
138
|
-
throw new Error("Distribution app is not a macOS Spark Runner.");
|
|
139
|
-
}
|
|
140
|
-
else if (!existsSync(path.join(app, "Contents/Resources/main.jsbundle")))
|
|
141
|
-
throw new Error("Distribution app is missing its JavaScript bundle.");
|
|
142
155
|
const info = JSON.parse(await execute(root, ["plutil", "-convert", "json", "-o", "-", path.join(app, "Contents/Info.plist")], { capture: true }));
|
|
156
|
+
checkReleasePayload(app, expected.runtime.mode === "go", info);
|
|
157
|
+
if (expected.runtime.mode === "release")
|
|
158
|
+
checkReleaseTestDriver(app, expected.testDriverInRelease);
|
|
159
|
+
const runtime = readJson(path.join(app, "Contents/Resources/spark-runtime.json"));
|
|
160
|
+
if (!isDeepStrictEqual(runtime, expected.runtime))
|
|
161
|
+
throw new Error("The packaged runtime receipt does not match the release build.");
|
|
143
162
|
for (const [key, value] of Object.entries({ CFBundleIdentifier: expected.bundleId, CFBundleShortVersionString: expected.version, CFBundleVersion: expected.buildVersion })) {
|
|
144
163
|
if (info[key] !== value)
|
|
145
164
|
throw new Error(`Packaged ${key} does not match the release build.`);
|
|
146
165
|
}
|
|
147
|
-
const
|
|
148
|
-
|
|
166
|
+
const executable = info.CFBundleExecutable;
|
|
167
|
+
if (info.CFBundlePackageType !== "APPL" || typeof executable !== "string" || !executable || path.basename(executable) !== executable)
|
|
168
|
+
throw new Error("Invalid app package type or executable name in Info.plist.");
|
|
169
|
+
const main = path.join(app, "Contents/MacOS", executable);
|
|
170
|
+
const arches = (await execute(root, ["lipo", "-archs", main], { capture: true })).trim().split(/\s+/);
|
|
171
|
+
const expectedArch = expected.runtime.arch === "x64" ? "x86_64" : "arm64";
|
|
149
172
|
if (arches.length !== 1 || arches[0] !== expectedArch)
|
|
150
173
|
throw new Error(`The package must contain a ${expectedArch} app.`);
|
|
151
|
-
|
|
174
|
+
// Apple TN3127's Developer ID Application requirement, independent of the certificate's display name.
|
|
175
|
+
const developerId = "anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] exists and certificate leaf[field.1.2.840.113635.100.6.1.13] exists";
|
|
176
|
+
await execute(root, ["codesign", "--verify", "--deep", "--strict", "--verbose=2", "-R=" + developerId, app], { capture: true });
|
|
152
177
|
const order = signingOrder(app);
|
|
153
178
|
const targets = await entitlementTargets(root, app, order, expected.entitlements, expected.byPath, execute);
|
|
154
179
|
for (const file of order) {
|
|
155
180
|
const signature = await execute(root, ["codesign", "-dvvv", file], { capture: true });
|
|
156
|
-
if (!signature.includes(`Authority=${
|
|
181
|
+
if (!signature.includes(`Authority=${identity.name}\n`) || !signature.includes(`TeamIdentifier=${identity.teamId}\n`) || !/flags=.*\bruntime\b/.test(signature) || !/^Timestamp=/m.test(signature)) {
|
|
157
182
|
throw new Error(`Invalid Developer ID signature, hardened runtime, or timestamp: ${file}`);
|
|
158
183
|
}
|
|
159
|
-
const signedEntitlements = await execute(root, ["codesign", "-d", "--entitlements", "
|
|
160
|
-
// Inspect the final signature, not just the input entitlement file.
|
|
184
|
+
const signedEntitlements = await execute(root, ["codesign", "-d", "--entitlements", "-", "--xml", file], { capture: true });
|
|
161
185
|
const xml = signedEntitlements.match(/<\?xml[\s\S]*?<\/plist>|<plist[\s\S]*?<\/plist>/)?.[0];
|
|
162
|
-
|
|
163
|
-
if (xml) {
|
|
164
|
-
const plist = stateFile(root, "packaging/verified-entitlements.plist");
|
|
165
|
-
await writeFile(plist, xml);
|
|
166
|
-
actual = distributionEntitlements(JSON.parse(await execute(root, ["plutil", "-convert", "json", "-o", "-", plist], { capture: true })));
|
|
167
|
-
}
|
|
186
|
+
const actual = xml ? distributionEntitlements(JSON.parse(execFileSync("/usr/bin/plutil", ["-convert", "json", "-o", "-", "-"], { input: xml, encoding: "utf8" }))) : {};
|
|
168
187
|
const desired = targets.get(file);
|
|
169
188
|
if (!isDeepStrictEqual(actual, desired))
|
|
170
189
|
throw new Error(`Signed entitlements do not match the release configuration: ${file}`);
|
|
171
190
|
}
|
|
191
|
+
await checkReleaseLoadPaths(root, app, main, order.filter(file => lstatSync(file).isFile()), execute);
|
|
172
192
|
if (notarized) {
|
|
173
193
|
await execute(root, ["xcrun", "stapler", "validate", app], { capture: true });
|
|
174
194
|
await execute(root, ["spctl", "--assess", "--type", "execute", "--verbose=4", app], { capture: true });
|
|
@@ -91,7 +91,7 @@ export async function upgrade(root, dryRun = false) {
|
|
|
91
91
|
const updatedCLI = cliRoot(installed);
|
|
92
92
|
const { initializeTemplate } = createRequire(path.join(updatedCLI, "package.json"))("./dist/init-template.cjs");
|
|
93
93
|
const { recordProjectVersion, refreshPointers } = createRequire(path.join(updatedCLI, "package.json"))("./dist/migrations.cjs");
|
|
94
|
-
initializeTemplate(root);
|
|
94
|
+
initializeTemplate(root, false);
|
|
95
95
|
refreshPointers(root);
|
|
96
96
|
recordProjectVersion(root, version);
|
|
97
97
|
console.log(`Updated Spark to ${version}.`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ensurePatchRegistry } from "@legendapp/spark-desktop-config/patch-registry.cjs";
|
|
1
2
|
import { which, nodeCommand } from "./process.js";
|
|
2
3
|
import { prepareWindowsGeometry } from "./windows-geometry.js";
|
|
3
4
|
import { copyHelpers } from "./helpers.js";
|
|
@@ -48,6 +49,7 @@ export async function preserveWindowsBuildOutputs(root, prepare) {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
export async function prepareWindows(root, mode) {
|
|
52
|
+
await ensurePatchRegistry(root);
|
|
51
53
|
assertNativePatchPreflight(root);
|
|
52
54
|
await checkExpoDesktopNode(root);
|
|
53
55
|
prepareConfig(root);
|
|
@@ -77,6 +79,7 @@ export async function prepareWindows(root, mode) {
|
|
|
77
79
|
export async function buildWindows(root, mode, force) {
|
|
78
80
|
if (mode !== "go" && mode !== "dev")
|
|
79
81
|
throw new Error("Windows currently supports Spark Runner runtimes and development builds. Use spark build --dev; production builds and packaging are not implemented.");
|
|
82
|
+
await ensurePatchRegistry(root);
|
|
80
83
|
assertNativePatchPreflight(root);
|
|
81
84
|
if (process.platform !== "win32")
|
|
82
85
|
throw new Error("Windows native builds require Windows x64 or ARM64. Project generation and Metro bundle checks can run on macOS.");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,15 +11,16 @@
|
|
|
11
11
|
"node": ">=24.19.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@legendapp/spark-desktop-config": "0.0.
|
|
14
|
+
"@legendapp/spark-desktop-config": "0.0.5",
|
|
15
15
|
"ws": "8.21.0",
|
|
16
16
|
"expo-desktop": "1.0.6",
|
|
17
17
|
"npm": "11.21.1",
|
|
18
18
|
"typescript": "5.9.3",
|
|
19
19
|
"cross-spawn": "7.0.6",
|
|
20
|
-
"@legendapp/spark-window-options": "0.0.
|
|
20
|
+
"@legendapp/spark-window-options": "0.0.5",
|
|
21
21
|
"diff": "8.0.4",
|
|
22
|
-
"yaml": "2.9.1"
|
|
22
|
+
"yaml": "2.9.1",
|
|
23
|
+
"@legendapp/spark-expo-compat": "0.0.5"
|
|
23
24
|
},
|
|
24
25
|
"private": true
|
|
25
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spark-template-blank-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"postinstall": "node node_modules/@legendapp/spark/init-template.cjs"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@legendapp/spark": "0.0.
|
|
16
|
+
"@legendapp/spark": "0.0.5",
|
|
17
17
|
"expo": "55.0.32",
|
|
18
18
|
"expo-desktop": "1.0.6",
|
|
19
19
|
"expo-desktop-prebuild-config": "1.1.3",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spark-template-universal",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react-native-web": "0.21.0",
|
|
42
42
|
"uniwind": "1.6.3",
|
|
43
43
|
"tailwindcss": "4.2.4",
|
|
44
|
-
"@legendapp/spark": "0.0.
|
|
44
|
+
"@legendapp/spark": "0.0.5"
|
|
45
45
|
},
|
|
46
46
|
"overrides": {
|
|
47
47
|
"expo": "55.0.32",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spark-template-windows",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"react-native-windows": "0.83.2",
|
|
29
29
|
"expo-desktop-modules-core": "55.0.2",
|
|
30
30
|
"expo-desktop-stubs": "55.0.2",
|
|
31
|
-
"@legendapp/spark": "0.0.
|
|
31
|
+
"@legendapp/spark": "0.0.5"
|
|
32
32
|
},
|
|
33
33
|
"overrides": {
|
|
34
34
|
"expo": "55.0.32",
|
|
@@ -70,7 +70,7 @@ RCT_EXPORT_MODULE(NativeDesktopClipboard)
|
|
|
70
70
|
if (item.types.count) [objects addObject:item];
|
|
71
71
|
}
|
|
72
72
|
[board clearContents]; if (objects.count && ![board writeObjects:objects]) { reject(@"E_CLIPBOARD", @"Could not write clipboard", nil); return; }
|
|
73
|
-
resolve(@"null"); return;
|
|
73
|
+
resolve(binary ? NSNull.null : @"null"); return;
|
|
74
74
|
}
|
|
75
75
|
SparkInvalid(reject, @"Unknown clipboard operation");
|
|
76
76
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-clipboard",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index",
|
|
6
6
|
"react-native": "src/index",
|
|
@@ -28,20 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"spark": {
|
|
30
30
|
"sdk": true,
|
|
31
|
-
"nativeModules":
|
|
32
|
-
"NativeDesktopClipboard"
|
|
33
|
-
],
|
|
34
|
-
"pod": "RNDesktopClipboard",
|
|
35
|
-
"platforms": [
|
|
36
|
-
"macos",
|
|
37
|
-
"windows"
|
|
38
|
-
],
|
|
31
|
+
"nativeModules": true,
|
|
39
32
|
"requires": [
|
|
40
33
|
"@legendapp/spark-desktop-app"
|
|
41
34
|
]
|
|
42
35
|
},
|
|
43
36
|
"dependencies": {
|
|
44
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
37
|
+
"@legendapp/spark-desktop-app": "0.0.5"
|
|
45
38
|
},
|
|
46
39
|
"peerDependenciesMeta": {
|
|
47
40
|
"expo-clipboard": {
|
|
@@ -58,6 +58,7 @@ export async function writeClipboard(content: ClipboardWriteContent): Promise<vo
|
|
|
58
58
|
const files = content.files?.map(path => nativePath(path, Platform.OS));
|
|
59
59
|
const { image, ...rest } = content;
|
|
60
60
|
if (image !== undefined && (!image || image.format !== "png" || !(image.bytes instanceof Uint8Array))) throw new SparkError("E_INVALID_ARGUMENT", "Expected PNG image bytes");
|
|
61
|
+
if (image !== undefined) for (const key of Object.keys(image)) if (key !== "format" && key !== "bytes") throw new SparkError("E_UNSUPPORTED_OPTION", `Unsupported clipboard image option: ${key}`);
|
|
61
62
|
const response = await invokeNative(() => callBinary(native(), "__sparkClipboardBinary", "write", { ...rest, files }, image?.bytes));
|
|
62
63
|
if (response !== null) throw new SparkError("E_INVALID_DATA", "Invalid native clipboard response");
|
|
63
64
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-codex",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
13
|
+
"@legendapp/spark-desktop-app": "0.0.5",
|
|
14
14
|
"react-native-nitro-modules": "0.37.0"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
@@ -23,11 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"spark": {
|
|
25
25
|
"sdk": true,
|
|
26
|
-
"nativeModules":
|
|
27
|
-
"pod": "RNCodex",
|
|
28
|
-
"platforms": [
|
|
29
|
-
"macos"
|
|
30
|
-
],
|
|
26
|
+
"nativeModules": true,
|
|
31
27
|
"requires": [
|
|
32
28
|
"react-native-nitro-modules"
|
|
33
29
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-commands",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.tsx",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"src"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@legendapp/spark-ui": "0.0.
|
|
12
|
-
"@legendapp/spark-desktop-shortcuts": "0.0.
|
|
13
|
-
"@legendapp/spark-settings": "0.0.
|
|
11
|
+
"@legendapp/spark-ui": "0.0.5",
|
|
12
|
+
"@legendapp/spark-desktop-shortcuts": "0.0.5",
|
|
13
|
+
"@legendapp/spark-settings": "0.0.5",
|
|
14
14
|
"@legendapp/state": "^3.0.0-beta.42",
|
|
15
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
15
|
+
"@legendapp/spark-desktop-app": "0.0.5"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"react": "^19.2.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-context-menu",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"react-native": "src/index.ts",
|
|
@@ -28,20 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"spark": {
|
|
30
30
|
"sdk": true,
|
|
31
|
-
"nativeModules":
|
|
32
|
-
"NativeContextMenu"
|
|
33
|
-
],
|
|
34
|
-
"pod": "RNContextMenu",
|
|
35
|
-
"platforms": [
|
|
36
|
-
"macos",
|
|
37
|
-
"windows"
|
|
38
|
-
],
|
|
31
|
+
"nativeModules": true,
|
|
39
32
|
"requires": [
|
|
40
33
|
"@legendapp/spark-desktop-app"
|
|
41
34
|
]
|
|
42
35
|
},
|
|
43
36
|
"dependencies": {
|
|
44
|
-
"@legendapp/spark-desktop-app": "0.0.
|
|
37
|
+
"@legendapp/spark-desktop-app": "0.0.5"
|
|
45
38
|
},
|
|
46
39
|
"private": true
|
|
47
40
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#import <React/RCTBridgeModule.h>
|
|
4
4
|
|
|
5
5
|
FOUNDATION_EXPORT NSString * const SparkDesktopEvent;
|
|
6
|
-
// Call in applicationWillFinishLaunching:. YES: this process owns the
|
|
6
|
+
// Call in applicationWillFinishLaunching:. YES: this process owns the app's
|
|
7
7
|
// instance. NO: another process does; this one forwards its launch and exits.
|
|
8
8
|
FOUNDATION_EXPORT BOOL SparkAcquireInstance(void);
|
|
9
9
|
// Latched on first call during launch: --spark-safe-mode, or Shift held at launch.
|
|
@@ -15,6 +15,8 @@ FOUNDATION_EXPORT void SparkRelaunch(NSArray<NSString *> *arguments, void (^comp
|
|
|
15
15
|
FOUNDATION_EXPORT NSDictionary *SparkContext(void);
|
|
16
16
|
FOUNDATION_EXPORT NSDictionary *SparkInitialProps(NSString *windowID, NSDictionary *props);
|
|
17
17
|
FOUNDATION_EXPORT NSString *SparkNamespace(void);
|
|
18
|
+
FOUNDATION_EXPORT NSString *SparkStorageNamespace(void);
|
|
19
|
+
FOUNDATION_EXPORT void SparkPrepareStorage(void);
|
|
18
20
|
FOUNDATION_EXPORT void SparkEmit(NSDictionary *event);
|
|
19
21
|
FOUNDATION_EXPORT void SparkOpenURLs(NSArray<NSURL *> *urls);
|
|
20
22
|
FOUNDATION_EXPORT NSArray *SparkPendingURLs(void);
|