@legendapp/spark 0.0.1 → 0.0.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/native.d.cts +6 -3
- package/package.json +36 -28
- package/patches/dependencies.json +252 -0
- package/patches/expo-application@55.0.19.patch +54 -0
- package/patches/expo-blur@55.0.18.patch +130 -0
- package/patches/expo-device@55.0.21.patch +149 -0
- package/patches/expo-font@55.0.8.patch +55 -0
- package/patches/expo-glass-effect@55.0.11.patch +304 -0
- package/patches/expo-haptics@55.0.18.patch +54 -0
- package/patches/expo-image-manipulator@55.0.21.patch +312 -0
- package/patches/expo-image-picker@55.0.24.patch +327 -0
- package/patches/expo-image@55.0.11.patch +158 -0
- package/patches/expo-keep-awake@55.0.8.patch +41 -0
- package/patches/expo-localization@55.0.19.patch +32 -0
- package/patches/expo-location@55.1.15.patch +190 -0
- package/patches/expo-symbols@55.0.9.patch +286 -0
- package/patches/expo-system-ui@55.0.22.patch +61 -0
- package/patches/expo-web-browser@55.0.20.patch +13 -0
- package/patches/react-native-app-logs@0.3.1.patch +20 -0
- package/patches/react-native-blurhash@2.1.3.patch +318 -0
- package/patches/react-native-community-blur@4.4.1.patch +415 -0
- package/patches/react-native-community-datetimepicker@9.2.2.patch +320 -0
- package/patches/react-native-enriched-markdown@1.1.1.patch +141 -10
- package/patches/react-native-fast-image@10.9.9.patch +131 -0
- package/patches/react-native-graph@1.4.0.patch +157 -0
- package/patches/react-native-keyboard-controller@1.22.9.patch +16 -0
- package/patches/react-native-masked-view-masked-view@0.3.2.patch +140 -0
- package/patches/react-native-mmkv@4.3.2.patch +40 -0
- package/patches/react-native-nitro-fetch@1.9.0.patch +130 -0
- package/patches/react-native-nitro-zxing@0.3.0.patch +13 -0
- package/patches/react-native-quick-base64@3.0.1.patch +13 -0
- package/patches/react-native-quick-crypto@1.1.9.patch +31 -0
- package/patches/react-native-release-profiler@0.4.5.patch +37 -0
- package/patches/react-native-screen-corner-radius@0.2.3.patch +13 -0
- package/patches/react-native-screens@4.23.0.patch +160 -0
- package/patches/react-native-svg@15.15.3.patch +31 -0
- package/patches/react-native-unistyles@3.6.0.patch +203 -0
- package/patches/react-native-worklets-core@1.6.3.patch +13 -0
- package/patches/react-navigation-native-stack@7.21.0.patch +16 -0
- package/patches/sentry-react-native@8.32.0.patch +76 -0
- package/skills/spark/UPGRADING.md +122 -3
- package/vendor/node_modules/@legendapp/spark-ai/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-audio/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-audio/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-auth-session/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +17 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +4 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +8 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +45 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +15 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-preload.cjs +3 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +26 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/metro.cjs +3 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +20 -5
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +10 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +28 -10
- package/vendor/node_modules/@legendapp/spark-cli/dist/release-runner-root.js +108 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +13 -13
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-input-cache.js +140 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/watchman.js +12 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows-geometry.js +2 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/desktop.config.json +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +27 -25
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/desktop.config.json +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +35 -33
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +29 -27
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-clipboard/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-commands/package.json +7 -7
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkDesktop.mm +7 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +64 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-config/accessibility-state.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +12 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/autolinking.cjs +7 -6
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/fabric-lifecycle.cjs +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/keyboard-events.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/macos-host.cjs +39 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +73 -20
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +2 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +8 -6
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-scroll-view.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-alignment.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/rtl-text-input-alignment.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/text-input-accessibility.cjs +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/AppDelegate.h +6 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/Main.storyboard +684 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/macos/main.m +5 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +3 -2
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-desktop-links/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +68 -17
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +2 -1
- package/vendor/node_modules/@legendapp/spark-documents/package.json +9 -9
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-system/macos/RNDesktopFileSystem.mm +14 -5
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-file-system/src/index.ts +1 -1
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-html/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-processes/macos/RNDesktopProcesses.mm +110 -19
- package/vendor/node_modules/@legendapp/spark-processes/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-processes/src/index.ts +17 -3
- package/vendor/node_modules/@legendapp/spark-processes/src/types.ts +6 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-secure-storage/src/index.macos.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +12 -5
- package/vendor/node_modules/@legendapp/spark-system/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-tray/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +82 -18
- package/vendor/node_modules/@legendapp/spark-ui/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +11 -9
- package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +20 -10
- package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +15 -10
- package/vendor/node_modules/@legendapp/spark-ui/src/index.macos.tsx +1 -0
- package/vendor/node_modules/@legendapp/spark-updates/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-webview/package.json +11 -4
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
- package/camera.ts +0 -13
|
@@ -5,8 +5,8 @@ import path from "node:path";
|
|
|
5
5
|
import { prepareNativePatches } from "@legendapp/spark-desktop-config/native-patches.cjs";
|
|
6
6
|
import { findFramework } from "./local.js";
|
|
7
7
|
import { installedPackages, readJson, VERSION } from "./project.js";
|
|
8
|
-
const required = ["@react-native-runtimes/core", "react-native-nitro-modules"
|
|
9
|
-
const optional = ["expo-audio"];
|
|
8
|
+
const required = ["@react-native-runtimes/core", "react-native-nitro-modules"];
|
|
9
|
+
const optional = ["@op-engineering/op-sqlite", "react-native-webview", "expo-audio"];
|
|
10
10
|
export function validatePackedNativePatches(packages, requirements, frameworkVersion = VERSION) {
|
|
11
11
|
if (!requirements || requirements.schema !== 1 || requirements.frameworkVersion !== frameworkVersion || !requirements.packages || typeof requirements.packages !== "object")
|
|
12
12
|
return [`The installed @legendapp/spark SDK does not include native patch provenance for ${frameworkVersion}. Run spark add desktop to install the matching SDK packages, then retry.`];
|
|
@@ -70,8 +70,8 @@ export function validateWorkspaceNativePatches(root, packages) {
|
|
|
70
70
|
}
|
|
71
71
|
export function assertNativePatchPreflight(root) {
|
|
72
72
|
assertEnrichedHtmlPins(root);
|
|
73
|
-
prepareNativePatches(root);
|
|
74
73
|
const packages = installedPackages(root);
|
|
74
|
+
prepareNativePatches(root, packages);
|
|
75
75
|
const framework = findFramework(root);
|
|
76
76
|
let errors;
|
|
77
77
|
const spark = packages.find(pkg => pkg.name === "@legendapp/spark");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assertEnrichedHtmlPins } from "./enriched-html-pins.js";
|
|
2
2
|
import { nativeWindowOptions } from "@legendapp/spark-window-options";
|
|
3
|
-
import { prepareNativePatches } from "@legendapp/spark-desktop-config/native-patches.cjs";
|
|
3
|
+
import { prepareNativePatches, removeExpoApplicationAlias } from "@legendapp/spark-desktop-config/native-patches.cjs";
|
|
4
4
|
import { macOSReleaseSettings } from "./macos-release.js";
|
|
5
5
|
import { projectPlatform, architecture } from "./platform.js";
|
|
6
6
|
import { resolveHelpers } from "./helpers.js";
|
|
@@ -12,7 +12,7 @@ import { existsSync, readFileSync, readdirSync, realpathSync, } from "node:fs";
|
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { readJson, writeJson } from "./json.js";
|
|
14
14
|
export { readJson, writeJson };
|
|
15
|
-
export const VERSION = "0.0.
|
|
15
|
+
export const VERSION = "0.0.3";
|
|
16
16
|
export function digest(value) {
|
|
17
17
|
return createHash("sha256").update(value).digest("hex");
|
|
18
18
|
}
|
|
@@ -40,6 +40,8 @@ export function installedPackages(root) {
|
|
|
40
40
|
const names = Object.keys({
|
|
41
41
|
...Object.fromEntries((Array.isArray(bundled) ? bundled : []).map(name => [name, true])),
|
|
42
42
|
...current.json.dependencies,
|
|
43
|
+
...Object.fromEntries(Object.entries(current.json.optionalDependencies ?? {})
|
|
44
|
+
.filter(([name]) => ["react-native-vision-camera", "react-native-nitro-image", "react-native-enriched-markdown", "react-native-enriched-html", "react-native-webview", "@op-engineering/op-sqlite"].includes(name))),
|
|
43
45
|
...(current.app ? current.json.devDependencies : {}),
|
|
44
46
|
// Optional peers do not require a native module. If an application uses
|
|
45
47
|
// one, its own dependency edge includes it. Resolving optional peers here
|
|
@@ -72,13 +74,13 @@ export function installedPackages(root) {
|
|
|
72
74
|
file = path.join(dir, "package.json");
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
|
-
catch {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
catch { }
|
|
78
|
+
}
|
|
79
|
+
if (!file || !existsSync(file)) {
|
|
80
|
+
if (current.app &&
|
|
81
|
+
(current.json.dependencies?.[name] || current.json.devDependencies?.[name]))
|
|
82
|
+
throw new Error(`Dependency ${name} is not installed yet. Finish the package installation, then retry.`);
|
|
83
|
+
continue;
|
|
82
84
|
}
|
|
83
85
|
const dir = realpathSync(path.dirname(file));
|
|
84
86
|
if (visited.has(dir))
|
|
@@ -142,10 +144,14 @@ export function hashFiles(root, entries, windows = false, excluded = [], nativeS
|
|
|
142
144
|
}
|
|
143
145
|
export function nativePackages(root, { applyExcludes = true } = {}) {
|
|
144
146
|
assertEnrichedHtmlPins(root);
|
|
145
|
-
prepareNativePatches(root);
|
|
146
147
|
const installed = installedPackages(root);
|
|
148
|
+
prepareNativePatches(root, installed);
|
|
147
149
|
if (projectPlatform(root) === "windows")
|
|
148
150
|
return windowsNativePackages(root, installed);
|
|
151
|
+
const rootOf = (name) => installed.find(pkg => pkg.name === name)?.root;
|
|
152
|
+
const [macOS, expoCore] = [rootOf("react-native-macos"), rootOf("expo-modules-core")];
|
|
153
|
+
if (macOS && expoCore)
|
|
154
|
+
removeExpoApplicationAlias(macOS, expoCore);
|
|
149
155
|
const excluded = ["app.json", "desktop.config.json"].some(file => existsSync(path.join(root, file)))
|
|
150
156
|
? readAppConfig(root).expo?.autolinking?.exclude ?? [] : [];
|
|
151
157
|
if (!applyExcludes) {
|
|
@@ -205,6 +211,18 @@ export function dependencyStamp(root) {
|
|
|
205
211
|
"react-native.config.js",
|
|
206
212
|
]);
|
|
207
213
|
}
|
|
214
|
+
// CocoaPods skips a pod whose podspec lists platforms without macOS, but codegen still registers
|
|
215
|
+
// the library's components and modules, mapping them to classes that were never built.
|
|
216
|
+
export function lacksMacOSPod(pkg) {
|
|
217
|
+
if (!pkg.json.codegenConfig || ["react-native", "react-native-macos"].includes(pkg.name))
|
|
218
|
+
return false;
|
|
219
|
+
const specs = readdirSync(pkg.root).filter(name => name.endsWith(".podspec")).map(name => readFileSync(path.join(pkg.root, name), "utf8"));
|
|
220
|
+
return specs.length > 0 && specs.every(spec => {
|
|
221
|
+
// `s.platform = :ios, '13.4'` or `s.platforms = { :ios => ..., osx: ... }`; a computed value proves nothing.
|
|
222
|
+
const platforms = spec.match(/\.platforms?\s*=\s*(\{[^}]*\}|.*)/)?.[1] ?? "";
|
|
223
|
+
return /\b(ios|tvos|visionos)\b/.test(platforms) && !/\b(osx|macos)\b/.test(platforms) && !/\.(osx|macos)\./.test(spec);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
208
226
|
export function selection(packages, used, include = [], excluded = []) {
|
|
209
227
|
const selected = new Set([
|
|
210
228
|
...packages.filter((p) => !p.sdk).map((p) => p.name),
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { copyFileSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* Release Runner builds use one fixed project folder so Xcode's build database (keyed by
|
|
6
|
+
* absolute source paths) stays valid across versions and the build is incremental.
|
|
7
|
+
* Each release creates a fresh project in a staging folder exactly as before, syncs it into the
|
|
8
|
+
* fixed folder (only files whose bytes differ are rewritten, so unchanged sources keep their
|
|
9
|
+
* mtimes), builds there, then mirrors the result into sdk-builds/<version>/SparkRunner.
|
|
10
|
+
*/
|
|
11
|
+
export const releaseRunnerRoot = (sdkBuilds) => path.join(sdkBuilds, "release", "SparkRunner");
|
|
12
|
+
export const releaseRunnerStaging = (sdkBuilds) => path.join(sdkBuilds, "release", "staging", "SparkRunner");
|
|
13
|
+
// Build state the fresh project never contains and the build must keep: Xcode's DerivedData,
|
|
14
|
+
// generated native project + Pods (prebuild regenerates the project but preserves Pods), products.
|
|
15
|
+
export const preservedBuildState = [".spark/DerivedData", "macos", ".spark/products", ".spark/prebuild-cache"];
|
|
16
|
+
function same(a, b) {
|
|
17
|
+
const left = lstatSync(a), right = lstatSync(b);
|
|
18
|
+
if (left.isSymbolicLink() || right.isSymbolicLink())
|
|
19
|
+
return left.isSymbolicLink() && right.isSymbolicLink() && readlinkSync(a) === readlinkSync(b);
|
|
20
|
+
if (left.isFile() !== right.isFile() || left.size !== right.size || (left.mode & 0o777) !== (right.mode & 0o777))
|
|
21
|
+
return false;
|
|
22
|
+
return readFileSync(a).equals(readFileSync(b));
|
|
23
|
+
}
|
|
24
|
+
/** Makes `destination` byte-identical to `source`, skipping (and keeping) `keep` paths relative to the roots. Returns rewritten paths. */
|
|
25
|
+
export function syncTree(source, destination, keep = [], relative = "") {
|
|
26
|
+
const changed = [];
|
|
27
|
+
mkdirSync(destination, { recursive: true });
|
|
28
|
+
const wanted = new Set(existsSync(source) ? readdirSync(source) : []);
|
|
29
|
+
for (const name of readdirSync(destination)) {
|
|
30
|
+
const rel = path.posix.join(relative, name);
|
|
31
|
+
if (wanted.has(name) || keep.includes(rel))
|
|
32
|
+
continue;
|
|
33
|
+
// A folder holding preserved state is pruned around it, never removed wholesale.
|
|
34
|
+
if (keep.some(entry => entry.startsWith(`${rel}/`)) && lstatSync(path.join(destination, name)).isDirectory())
|
|
35
|
+
changed.push(...syncTree(path.join(source, name), path.join(destination, name), keep, rel));
|
|
36
|
+
else {
|
|
37
|
+
rmSync(path.join(destination, name), { recursive: true, force: true });
|
|
38
|
+
changed.push(rel);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const name of wanted) {
|
|
42
|
+
const rel = path.posix.join(relative, name);
|
|
43
|
+
if (keep.includes(rel))
|
|
44
|
+
continue;
|
|
45
|
+
const from = path.join(source, name), to = path.join(destination, name);
|
|
46
|
+
const stat = lstatSync(from);
|
|
47
|
+
if (stat.isDirectory()) {
|
|
48
|
+
if (existsSync(to) && !lstatSync(to).isDirectory())
|
|
49
|
+
rmSync(to, { force: true });
|
|
50
|
+
changed.push(...syncTree(from, to, keep, rel));
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (existsSync(to) || isLink(to)) {
|
|
54
|
+
if (!lstatSync(to).isDirectory() && same(from, to))
|
|
55
|
+
continue;
|
|
56
|
+
rmSync(to, { recursive: true, force: true });
|
|
57
|
+
}
|
|
58
|
+
if (stat.isSymbolicLink())
|
|
59
|
+
symlinkSync(readlinkSync(from), to);
|
|
60
|
+
else
|
|
61
|
+
copyFileSync(from, to);
|
|
62
|
+
changed.push(rel);
|
|
63
|
+
}
|
|
64
|
+
return changed;
|
|
65
|
+
}
|
|
66
|
+
function isLink(file) { try {
|
|
67
|
+
return lstatSync(file).isSymbolicLink();
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return false;
|
|
71
|
+
} }
|
|
72
|
+
// Files under the version folder that record the project's own absolute path.
|
|
73
|
+
export const pathRecords = [".spark/go-build.json", ".spark/native-selection.json", ".spark/native-preparation.json", "macos/Podfile", "macos/Podfile.lock"];
|
|
74
|
+
export function rewritePathRecords(root, from, to) {
|
|
75
|
+
for (const record of pathRecords) {
|
|
76
|
+
const file = path.join(root, record);
|
|
77
|
+
if (existsSync(file))
|
|
78
|
+
writeFileSync(file, readFileSync(file, "utf8").split(from).join(to));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Replaces sdk-builds/<version>/SparkRunner with the fixed folder's built project (minus its
|
|
83
|
+
* DerivedData), rewriting recorded absolute paths so signing, notarization and --resume read the
|
|
84
|
+
* version folder exactly as when it was built in place. An earlier notarization/packaging state
|
|
85
|
+
* in the version folder is kept.
|
|
86
|
+
*/
|
|
87
|
+
export function mirrorRunner(fixed, version, clone = (from, to) => spawnSync("cp", ["-c", "-R", from, to]).status === 0) {
|
|
88
|
+
const incoming = `${version}.incoming`;
|
|
89
|
+
rmSync(incoming, { recursive: true, force: true });
|
|
90
|
+
mkdirSync(path.dirname(version), { recursive: true });
|
|
91
|
+
if (!clone(fixed, incoming)) {
|
|
92
|
+
rmSync(incoming, { recursive: true, force: true });
|
|
93
|
+
spawnSync("cp", ["-R", fixed, incoming]);
|
|
94
|
+
}
|
|
95
|
+
if (!existsSync(path.join(incoming, "package.json")))
|
|
96
|
+
throw new Error(`Copying the release Runner from ${fixed} failed.`);
|
|
97
|
+
rmSync(path.join(incoming, ".spark/DerivedData"), { recursive: true, force: true });
|
|
98
|
+
for (const kept of [".spark/packaging", ".spark/signing.json"]) {
|
|
99
|
+
const previous = path.join(version, kept);
|
|
100
|
+
if (!existsSync(previous))
|
|
101
|
+
continue;
|
|
102
|
+
rmSync(path.join(incoming, kept), { recursive: true, force: true });
|
|
103
|
+
renameSync(previous, path.join(incoming, kept));
|
|
104
|
+
}
|
|
105
|
+
rewritePathRecords(incoming, fixed, version);
|
|
106
|
+
rmSync(version, { recursive: true, force: true });
|
|
107
|
+
renameSync(incoming, version);
|
|
108
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"revision": "
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"revision": "82a56a0a0b3363ecfddde675a2caf4d04976d482",
|
|
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.3/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.
|
|
12
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.3/react-native-nitro-modules-0.37.0-5df8774796c4.tgz",
|
|
13
13
|
"size": 145600,
|
|
14
14
|
"sha256": "5df8774796c48ed54d238f3fada01b64d710b14077983c37f639607eb805e066"
|
|
15
15
|
},
|
|
16
16
|
"@op-engineering/op-sqlite": {
|
|
17
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
17
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.3/op-engineering-op-sqlite-18.2.1-a14b99ecf491.tgz",
|
|
18
18
|
"size": 5847607,
|
|
19
19
|
"sha256": "a14b99ecf4911b55f586b2c5d1f58ac48b0a9d8fe4b84fa6edef1a167630646b"
|
|
20
20
|
},
|
|
21
21
|
"react-native-webview": {
|
|
22
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
22
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.3/react-native-webview-16.0.0-333e421ad38b.tgz",
|
|
23
23
|
"size": 116285,
|
|
24
24
|
"sha256": "333e421ad38b0da2b1dc7b3306de019f257e31bfd6cdb0272d97b1bb2b129354"
|
|
25
25
|
},
|
|
26
26
|
"expo-audio": {
|
|
27
|
-
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.
|
|
28
|
-
"size":
|
|
29
|
-
"sha256": "
|
|
27
|
+
"url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.3/expo-audio-55.0.18-a8d70b5b39bd.tgz",
|
|
28
|
+
"size": 610139,
|
|
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.3/spark-runner-macos-arm64.zip",
|
|
35
|
+
"size": 13253060,
|
|
36
|
+
"sha256": "eea17937911cde7c1bce3a4058b828082e2b3d9fa28a9a4820896537ba9f5829",
|
|
37
37
|
"app": "SparkRunner.app",
|
|
38
38
|
"teamId": "56DD97VT22",
|
|
39
|
-
"fingerprint": "
|
|
39
|
+
"fingerprint": "10cf4425571758e09fa4217d514d4d2c62c54f1ab4466323b7de58915065f3c7"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { realpathSync, statSync, watch } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import { installedPackages, nativePackages } from "./project.js";
|
|
5
|
+
import { isExpoProject } from "@legendapp/spark-desktop-config/config.cjs";
|
|
6
|
+
/** Native compatibility inputs stay stable until a source or resolution path changes. */
|
|
7
|
+
export function createRuntimeInputCache(root) {
|
|
8
|
+
let value;
|
|
9
|
+
let dirty = true;
|
|
10
|
+
let disabled = false;
|
|
11
|
+
let watchers = [];
|
|
12
|
+
let resolutionPaths = new Map();
|
|
13
|
+
let observedRoots = "";
|
|
14
|
+
let readiness;
|
|
15
|
+
function identity(location) {
|
|
16
|
+
try {
|
|
17
|
+
const stat = statSync(location, { throwIfNoEntry: false });
|
|
18
|
+
return stat ? `${stat.dev}:${stat.ino}` : null;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (error.code === "ENOTDIR")
|
|
22
|
+
return null;
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function stop() {
|
|
27
|
+
clearImmediate(readiness);
|
|
28
|
+
readiness = undefined;
|
|
29
|
+
for (const watcher of watchers)
|
|
30
|
+
watcher.close();
|
|
31
|
+
watchers = [];
|
|
32
|
+
}
|
|
33
|
+
const invalidate = () => { dirty = true; };
|
|
34
|
+
function fail() {
|
|
35
|
+
disabled = true;
|
|
36
|
+
dirty = true;
|
|
37
|
+
stop();
|
|
38
|
+
}
|
|
39
|
+
const calculate = () => ({ native: nativePackages(root) });
|
|
40
|
+
function observe(installed) {
|
|
41
|
+
const realRoot = realpathSync(root);
|
|
42
|
+
const requested = new Map();
|
|
43
|
+
const add = (location, recursive) => {
|
|
44
|
+
const directory = realpathSync(location);
|
|
45
|
+
requested.set(directory, recursive || requested.get(directory) || false);
|
|
46
|
+
};
|
|
47
|
+
const paths = new Map();
|
|
48
|
+
for (const pkg of [{ root, json: {} }, ...installed]) {
|
|
49
|
+
add(pkg.root, true);
|
|
50
|
+
add(path.dirname(pkg.root), false);
|
|
51
|
+
const context = path.join(pkg.root, pkg.json.spark?.bundledModuleRoot ?? ".", "package.json");
|
|
52
|
+
for (const search of createRequire(context).resolve.paths("__spark_runtime_inputs__") ?? []) {
|
|
53
|
+
if (!paths.has(search)) {
|
|
54
|
+
const current = identity(search);
|
|
55
|
+
paths.set(search, current);
|
|
56
|
+
if (current !== null)
|
|
57
|
+
add(search, true);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const recursiveRoots = [...requested].filter(([, recursive]) => recursive).map(([directory]) => directory);
|
|
62
|
+
const roots = [...requested].filter(([directory]) => !recursiveRoots.some(parent => parent !== directory && directory.startsWith(parent + path.sep)));
|
|
63
|
+
const key = JSON.stringify(roots.map(([directory, recursive]) => [directory, recursive, identity(directory)]));
|
|
64
|
+
if (key === observedRoots) {
|
|
65
|
+
resolutionPaths = paths;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const next = [];
|
|
69
|
+
try {
|
|
70
|
+
for (const [directory, recursive] of roots) {
|
|
71
|
+
const watcher = watch(directory, { recursive }, (_event, filename) => {
|
|
72
|
+
const relative = filename === null ? null : path.relative(realRoot, path.join(directory, String(filename))).split(path.sep).join("/");
|
|
73
|
+
// Session status is output of the check, never an input to it.
|
|
74
|
+
if (relative && /^\.spark\/(?:platforms\/[^/]+\/)?session\.json(?:\.\d+\.tmp)?$/.test(relative))
|
|
75
|
+
return;
|
|
76
|
+
invalidate();
|
|
77
|
+
});
|
|
78
|
+
watcher.on("error", fail);
|
|
79
|
+
next.push(watcher);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
for (const watcher of next)
|
|
84
|
+
watcher.close();
|
|
85
|
+
fail();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
stop();
|
|
89
|
+
watchers = next;
|
|
90
|
+
resolutionPaths = paths;
|
|
91
|
+
observedRoots = key;
|
|
92
|
+
// A watch may start asynchronously. Recheck after its first event-loop turn.
|
|
93
|
+
readiness = setImmediate(() => { readiness = undefined; invalidate(); });
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
invalidate,
|
|
97
|
+
read() {
|
|
98
|
+
// Expo configuration can depend on arbitrary external modules or environment.
|
|
99
|
+
if (disabled || isExpoProject(root))
|
|
100
|
+
return calculate();
|
|
101
|
+
if (!dirty) {
|
|
102
|
+
try {
|
|
103
|
+
// Installs can replace a watched directory before its event is delivered.
|
|
104
|
+
for (const [location, previous] of resolutionPaths) {
|
|
105
|
+
if (identity(location) !== previous) {
|
|
106
|
+
dirty = true;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
fail();
|
|
113
|
+
return calculate();
|
|
114
|
+
}
|
|
115
|
+
if (!dirty)
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
dirty = false;
|
|
119
|
+
try {
|
|
120
|
+
const installed = installedPackages(root);
|
|
121
|
+
try {
|
|
122
|
+
observe(installed);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
fail();
|
|
126
|
+
}
|
|
127
|
+
value = calculate();
|
|
128
|
+
// A concurrent graph change needs a fresh set of source watches next poll.
|
|
129
|
+
if (JSON.stringify(installed) !== JSON.stringify(installedPackages(root)))
|
|
130
|
+
dirty = true;
|
|
131
|
+
return value;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
dirty = true;
|
|
135
|
+
throw error;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
close() { disabled = true; stop(); },
|
|
139
|
+
};
|
|
140
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
// Metro waits on Watchman's watch-project without a timeout, so a wedged Watchman
|
|
3
|
+
// server leaves the app on a blank window. True when Watchman is installed but
|
|
4
|
+
// does not answer; a missing Watchman is Metro's ordinary Node-crawler case.
|
|
5
|
+
export function watchmanStalls(root, timeout = 10_000) {
|
|
6
|
+
return new Promise(resolve => {
|
|
7
|
+
const child = spawn("watchman", ["watch-project", root], { stdio: "ignore" });
|
|
8
|
+
const timer = setTimeout(() => { child.kill(); resolve(true); }, timeout);
|
|
9
|
+
const done = () => { clearTimeout(timer); resolve(false); };
|
|
10
|
+
child.on("error", done).on("exit", done);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -21,8 +21,8 @@ export function patchWindowsGeometry(source) {
|
|
|
21
21
|
export function prepareWindowsGeometry(root) {
|
|
22
22
|
const req = createRequire(path.join(root, "package.json"));
|
|
23
23
|
const manifest = req.resolve("react-native-windows/package.json");
|
|
24
|
-
if (JSON.parse(readFileSync(manifest, "utf8")).version !== "0.
|
|
25
|
-
throw new Error("spark's Windows geometry adapter requires react-native-windows 0.
|
|
24
|
+
if (JSON.parse(readFileSync(manifest, "utf8")).version !== "0.83.2")
|
|
25
|
+
throw new Error("spark's Windows geometry adapter requires react-native-windows 0.83.2");
|
|
26
26
|
const rnw = path.dirname(manifest), source = path.join(rnw, "Microsoft.ReactNative/Fabric/ComponentView.h");
|
|
27
27
|
const original = readFileSync(source, "utf8");
|
|
28
28
|
const patched = patchWindowsGeometry(original);
|
|
@@ -65,7 +65,7 @@ export async function prepareWindows(root, mode) {
|
|
|
65
65
|
const manifest = readFileSync(path.join(root, "package.json"), "utf8");
|
|
66
66
|
try {
|
|
67
67
|
await preserveWindowsBuildOutputs(root, async () => {
|
|
68
|
-
await run(root, nodeCommand(root, "expo-desktop", "expo-desktop", ["prebuild", "--platform", "windows", "--template", "expo-desktop-template-bare-minimum@
|
|
68
|
+
await run(root, nodeCommand(root, "expo-desktop", "expo-desktop", ["prebuild", "--platform", "windows", "--template", "expo-desktop-template-bare-minimum@55.83.10", "--no-install"]), { env: { CI: "1" }, capture: true });
|
|
69
69
|
});
|
|
70
70
|
// The beta template expands all-platform dependencies. Keep the consumer's installed graph.
|
|
71
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,13 +11,13 @@
|
|
|
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.3",
|
|
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.3",
|
|
21
21
|
"diff": "8.0.4",
|
|
22
22
|
"yaml": "2.9.1"
|
|
23
23
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spark-template-blank-typescript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": true,
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -13,40 +13,40 @@
|
|
|
13
13
|
"postinstall": "node node_modules/@legendapp/spark/init-template.cjs"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@legendapp/spark": "0.0.
|
|
17
|
-
"expo": "
|
|
16
|
+
"@legendapp/spark": "0.0.3",
|
|
17
|
+
"expo": "55.0.32",
|
|
18
18
|
"expo-desktop": "1.0.6",
|
|
19
19
|
"expo-desktop-prebuild-config": "1.1.3",
|
|
20
20
|
"expo-desktop-config-plugins": "1.3.2",
|
|
21
|
-
"expo-desktop-metro-config": "
|
|
22
|
-
"expo-desktop-template-bare-minimum": "
|
|
23
|
-
"react": "19.
|
|
24
|
-
"react-dom": "19.
|
|
25
|
-
"react-native": "0.
|
|
26
|
-
"react-native-macos": "0.
|
|
21
|
+
"expo-desktop-metro-config": "55.83.3",
|
|
22
|
+
"expo-desktop-template-bare-minimum": "55.83.10",
|
|
23
|
+
"react": "19.2.0",
|
|
24
|
+
"react-dom": "19.2.0",
|
|
25
|
+
"react-native": "0.83.10",
|
|
26
|
+
"react-native-macos": "0.83.0",
|
|
27
27
|
"@react-native-community/cli": "20.1.3",
|
|
28
28
|
"typescript": "5.9.3",
|
|
29
|
-
"@types/react": "19.
|
|
29
|
+
"@types/react": "19.2.18",
|
|
30
30
|
"@react-native-runtimes/core": "0.1.0-alpha.2"
|
|
31
31
|
},
|
|
32
32
|
"overrides": {
|
|
33
|
-
"expo": "
|
|
34
|
-
"@expo/cli": "
|
|
33
|
+
"expo": "55.0.32",
|
|
34
|
+
"@expo/cli": "55.0.37",
|
|
35
35
|
"react-native-nitro-modules": "0.37.0",
|
|
36
36
|
"react-native-webview": "16.0.0",
|
|
37
37
|
"@op-engineering/op-sqlite": "18.2.1",
|
|
38
|
-
"expo-asset": "
|
|
39
|
-
"expo-constants": "
|
|
40
|
-
"expo-file-system": "
|
|
41
|
-
"expo-font": "
|
|
42
|
-
"expo-keep-awake": "
|
|
43
|
-
"expo-modules-core": "
|
|
44
|
-
"expo-desktop-modules-core": "
|
|
45
|
-
"expo-desktop-stubs": "
|
|
46
|
-
"react": "19.
|
|
47
|
-
"react-native": "0.
|
|
48
|
-
"react-native-macos": "0.
|
|
49
|
-
"react-native-windows": "0.
|
|
38
|
+
"expo-asset": "55.0.20",
|
|
39
|
+
"expo-constants": "55.0.17",
|
|
40
|
+
"expo-file-system": "55.0.26",
|
|
41
|
+
"expo-font": "55.0.8",
|
|
42
|
+
"expo-keep-awake": "55.0.8",
|
|
43
|
+
"expo-modules-core": "55.0.27",
|
|
44
|
+
"expo-desktop-modules-core": "55.0.2",
|
|
45
|
+
"expo-desktop-stubs": "55.0.2",
|
|
46
|
+
"react": "19.2.0",
|
|
47
|
+
"react-native": "0.83.10",
|
|
48
|
+
"react-native-macos": "0.83.0",
|
|
49
|
+
"react-native-windows": "0.83.2",
|
|
50
50
|
"postcss": "8.5.31",
|
|
51
51
|
"dompurify": "3.4.17",
|
|
52
52
|
"@tiptap/core": "3.32.0",
|
|
@@ -71,7 +71,9 @@
|
|
|
71
71
|
"@tiptap/extension-bubble-menu": "3.32.0",
|
|
72
72
|
"@tiptap/extension-floating-menu": "3.32.0",
|
|
73
73
|
"fast-xml-parser": "5.11.2",
|
|
74
|
-
"react-dom": "19.
|
|
74
|
+
"react-dom": "19.2.0",
|
|
75
|
+
"react-native-enriched-markdown": "1.1.1",
|
|
76
|
+
"react-native-enriched-html": "1.1.1"
|
|
75
77
|
},
|
|
76
78
|
"expo": {
|
|
77
79
|
"install": {
|