@legendapp/spark 0.0.4 → 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.
Files changed (74) hide show
  1. package/package.json +3 -3
  2. package/skills/spark/UPGRADING.md +58 -0
  3. package/skills/spark/storage-settings.md +2 -28
  4. package/skills/spark/ui.md +27 -1
  5. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  6. package/vendor/node_modules/@legendapp/spark-audio/package.json +2 -2
  7. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  8. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +43 -24
  9. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +3 -0
  10. package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +4 -8
  11. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +1 -1
  12. package/vendor/node_modules/@legendapp/spark-cli/dist/publish-directory.js +32 -0
  13. package/vendor/node_modules/@legendapp/spark-cli/dist/release-app.js +139 -0
  14. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +21 -21
  15. package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +61 -41
  16. package/vendor/node_modules/@legendapp/spark-cli/package.json +4 -4
  17. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  18. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  19. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  20. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
  21. package/vendor/node_modules/@legendapp/spark-codex/package.json +2 -2
  22. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  23. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +2 -2
  24. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.h +2 -0
  25. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +1 -0
  26. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +1 -1
  27. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +1 -0
  28. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  29. package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.cjs +20 -0
  30. package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.d.cts +1 -0
  31. package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +16 -5
  32. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  33. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
  34. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +2 -2
  35. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +3 -3
  36. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  37. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +2 -2
  38. package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +4 -4
  39. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +2 -2
  40. package/vendor/node_modules/@legendapp/spark-file-system/package.json +2 -2
  41. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +2 -2
  42. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  43. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  44. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
  45. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +2 -2
  46. package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
  47. package/vendor/node_modules/@legendapp/spark-processes/package.json +2 -2
  48. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  49. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
  50. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  51. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +4 -4
  52. package/vendor/node_modules/@legendapp/spark-settings-ui/src/index.tsx +122 -334
  53. package/vendor/node_modules/@legendapp/spark-settings-ui/src/rows.tsx +183 -0
  54. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  55. package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
  56. package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
  57. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +2 -0
  58. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.mm +17 -1
  59. package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +20 -0
  60. package/vendor/node_modules/@legendapp/spark-ui/package.json +2 -2
  61. package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +2 -1
  62. package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +1 -1
  63. package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +10 -8
  64. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +7 -6
  65. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +10 -9
  66. package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +6 -4
  67. package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSelectNativeComponent.ts +1 -0
  68. package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +4 -0
  69. package/vendor/node_modules/@legendapp/spark-ui/src/switch.tsx +13 -0
  70. package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +16 -4
  71. package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
  72. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  73. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
  74. /package/{settings-window.ts → ui-settings.ts} +0 -0
@@ -1,42 +1,42 @@
1
1
  {
2
2
  "schema": 1,
3
- "version": "0.0.4",
4
- "revision": "6daf2825b0db8f7457cb09a2b90f71d2fa8dd356",
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.4/runtimes-4df45cb5ea74.tgz",
8
- "size": 54063,
9
- "sha256": "307db9a8283e1f3b38e26eacb68bf987d36d4d3470a398547a5507240ff0a1aa"
7
+ "url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/runtimes-4df45cb5ea74.tgz",
8
+ "size": 54050,
9
+ "sha256": "3a04e0455ac44b0bc11cfa315943ad84509c445111a2b3974ca85c8ed489827c"
10
10
  },
11
11
  "react-native-nitro-modules": {
12
- "url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.4/react-native-nitro-modules-0.37.0-44c3fb99d6c3.tgz",
13
- "size": 145645,
14
- "sha256": "44c3fb99d6c3b6020faad2a267ee4b8c91d7ca485cb09bcd1a65844dc52c0317"
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.4/op-engineering-op-sqlite-18.2.1-fb6a308a316d.tgz",
18
- "size": 5847611,
19
- "sha256": "fb6a308a316d9a6604a91d289d5ebede75d42a5a621cd321d967db2ca9591804"
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.4/react-native-webview-16.0.0-89b78ee0b037.tgz",
23
- "size": 116285,
24
- "sha256": "89b78ee0b0378e5c2bc77f298ff1e2bbe2a79210d4f2fe27f062c4eea56fa147"
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.4/expo-audio-55.0.18-87b2ad9f530c.tgz",
28
- "size": 610157,
29
- "sha256": "87b2ad9f530c36617bcd6f31d65cd947f39aa2788249667378655c0f6e02a911"
27
+ "url": "https://github.com/LegendApp/legend-spark/releases/download/v0.0.5/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.4/spark-runner-macos-arm64.zip",
35
- "size": 13490443,
36
- "sha256": "e392bb31bf84a40e09e793549ec1f43dc8b01fabf748b65b280a6c9532f70885",
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": "4a85a1cf3d2680b2cf5314c75d34154de1f19f58d55a1deedc27fec9fcef7dee"
39
+ "fingerprint": "2d47860cb29f29bd1ddcd776ecf00c554e76c07f7e987331d97afc49391364ca"
40
40
  }
41
41
  }
42
42
  }
@@ -1,4 +1,4 @@
1
- import { writeFile } from "node:fs/promises";
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((file) => [file, byPath[path.relative(app, file)] ?? {}]));
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 relative = path.relative(app, file) || ".";
121
- const value = targets.get(file);
122
- const processTarget = /\.(app|xpc|appex)$/.test(file) || (lstatSync(file).isFile() && machOType(file) === 2);
123
- if (!processTarget && Object.keys(value).length)
124
- throw new Error(`Entitlements belong on executable processes, not libraries: ${relative}`);
125
- const plist = stateFile(root, `packaging/entitlements/${digest(relative)}.plist`);
126
- writeJson(plist, value);
127
- await execute(root, ["plutil", "-convert", "xml1", plist], { capture: true });
128
- await execute(root, ["codesign", "--force", "--sign", credentials.hash, "--options", "runtime", "--timestamp", ...(processTarget ? ["--entitlements", plist] : []),
129
- ...(credentials.keychain ? ["--keychain", credentials.keychain] : []), file], { capture: true });
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, credentials, expected, notarized, execute = run) {
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 arches = (await execute(root, ["lipo", "-archs", path.join(app, "Contents/MacOS", info.CFBundleExecutable)], { capture: true })).trim().split(/\s+/);
148
- const expectedArch = expected.arch === "x64" ? "x86_64" : "arm64";
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
- await execute(root, ["codesign", "--verify", "--deep", "--strict", "--verbose=2", app], { capture: true });
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=${credentials.name}\n`) || !signature.includes(`TeamIdentifier=${credentials.teamId}\n`) || !/flags=.*\bruntime\b/.test(signature) || !/^Timestamp=/m.test(signature)) {
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", ":-", file], { capture: true });
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
- let actual = {};
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 });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-cli",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "files": [
@@ -11,16 +11,16 @@
11
11
  "node": ">=24.19.0"
12
12
  },
13
13
  "dependencies": {
14
- "@legendapp/spark-desktop-config": "0.0.4",
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.4",
20
+ "@legendapp/spark-window-options": "0.0.5",
21
21
  "diff": "8.0.4",
22
22
  "yaml": "2.9.1",
23
- "@legendapp/spark-expo-compat": "0.0.4"
23
+ "@legendapp/spark-expo-compat": "0.0.5"
24
24
  },
25
25
  "private": true
26
26
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spark-template-blank-typescript",
3
- "version": "0.0.4",
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.4",
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.4",
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.4"
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.4",
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.4"
31
+ "@legendapp/spark": "0.0.5"
32
32
  },
33
33
  "overrides": {
34
34
  "expo": "55.0.32",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-clipboard",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -34,7 +34,7 @@
34
34
  ]
35
35
  },
36
36
  "dependencies": {
37
- "@legendapp/spark-desktop-app": "0.0.4"
37
+ "@legendapp/spark-desktop-app": "0.0.5"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "expo-clipboard": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-codex",
3
- "version": "0.0.4",
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.4",
13
+ "@legendapp/spark-desktop-app": "0.0.5",
14
14
  "react-native-nitro-modules": "0.37.0"
15
15
  },
16
16
  "files": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-commands",
3
- "version": "0.0.4",
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.4",
12
- "@legendapp/spark-desktop-shortcuts": "0.0.4",
13
- "@legendapp/spark-settings": "0.0.4",
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.4"
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.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -34,7 +34,7 @@
34
34
  ]
35
35
  },
36
36
  "dependencies": {
37
- "@legendapp/spark-desktop-app": "0.0.4"
37
+ "@legendapp/spark-desktop-app": "0.0.5"
38
38
  },
39
39
  "private": true
40
40
  }
@@ -21,6 +21,7 @@ static inline BOOL SparkTestDriverStart(void)
21
21
  }
22
22
  static inline BOOL SparkTestDriverActive(void) { return NO; }
23
23
  static inline void SparkTestDriverDidMount(void) {}
24
+ static inline void SparkTestDriverDidReload(void) {}
24
25
  static inline BOOL SparkTestDriverEnding(void) { return NO; }
25
26
  #else
26
27
 
@@ -30,6 +31,7 @@ FOUNDATION_EXPORT BOOL SparkTestDriverStart(void);
30
31
  FOUNDATION_EXPORT BOOL SparkTestDriverActive(void);
31
32
  // The host reports each mounted UI transaction; captures wait until mounts settle.
32
33
  FOUNDATION_EXPORT void SparkTestDriverDidMount(void);
34
+ FOUNDATION_EXPORT void SparkTestDriverDidReload(void);
33
35
  // YES once the runner's session has ended: that termination is teardown, not a user quit,
34
36
  // so the host terminates without running the app's quit guards.
35
37
  FOUNDATION_EXPORT BOOL SparkTestDriverEnding(void);
@@ -33,6 +33,7 @@ static void SparkDriverTerminate(void) { ending = YES; [NSApp terminate:nil]; }
33
33
  BOOL SparkTestDriverActive(void) { return active; }
34
34
  BOOL SparkTestDriverEnding(void) { return ending; }
35
35
  void SparkTestDriverDidMount(void) { lastMount = CACurrentMediaTime(); }
36
+ void SparkTestDriverDidReload(void) { lastMount = 0; }
36
37
  static NSArray<NSString *> *const SparkBuiltInCommands = @[@"ping", @"navigate", @"openFile", @"waitFor", @"setAppAppearance", @"capture", @"pointerEvents", @"restorePointer", @"quit"];
37
38
  static NSMutableDictionary<NSString *, SparkTestDriverHandler> *SparkModuleCommands(void) {
38
39
  static NSMutableDictionary *commands;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-app",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -92,6 +92,7 @@ module.exports = function withSparkDesktop(config) {
92
92
  paths: [mod.modRequest.projectRoot],
93
93
  })))).replace(/#\{/g, "\\#{");
94
94
  mod.modResults.contents = mod.modResults.contents.replaceAll('"#{config[:reactNativePath]}-macos"', macOSPath);
95
+ mod.modResults.contents = require("./rpaths.cjs").stripSwiftToolchainRunpath(mod.modResults.contents);
95
96
  const selectionFile = statePath(mod.modRequest.projectRoot, "native-selection.json", "macos");
96
97
  const { included, excluded } = fs.existsSync(selectionFile) ? JSON.parse(fs.readFileSync(selectionFile, "utf8")) : { included: [], excluded: [] };
97
98
  mod.modResults.contents = require("./autolinking.cjs").excludeNativeModules(mod.modResults.contents, excluded);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-config",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "app.plugin.cjs",
6
6
  "files": [
@@ -11,8 +11,8 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "expo-desktop-config-plugins": "1.3.2",
14
- "@legendapp/spark-desktop-host": "0.0.4",
15
- "@legendapp/spark-window-options": "0.0.4",
14
+ "@legendapp/spark-desktop-host": "0.0.5",
15
+ "@legendapp/spark-window-options": "0.0.5",
16
16
  "@expo/config-plugins": "55.0.12",
17
17
  "diff": "8.0.4"
18
18
  },
@@ -0,0 +1,20 @@
1
+ const marker = "# spark: remove Swift toolchain runpath";
2
+ const toolchain = '"${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"';
3
+
4
+ function stripSwiftToolchainRunpath(podfile) {
5
+ if (podfile.includes(marker)) return podfile;
6
+ const postInstall = /^[ \t]*post_install do \|installer\|[ \t]*$/m;
7
+ if (!postInstall.test(podfile)) throw new Error("Missing post_install block for Spark's macOS runpath configuration.");
8
+ return podfile.replace(postInstall, line => `${line}
9
+ ${marker}
10
+ installer.aggregate_targets.each do |aggregate|
11
+ aggregate.xcconfigs.each do |configuration, xcconfig|
12
+ paths = xcconfig.attributes['LD_RUNPATH_SEARCH_PATHS']
13
+ next unless paths&.include?('${toolchain}')
14
+ xcconfig.attributes['LD_RUNPATH_SEARCH_PATHS'] = paths.gsub('${toolchain}', '')
15
+ xcconfig.save_as(aggregate.xcconfig_path(configuration))
16
+ end
17
+ end`);
18
+ }
19
+
20
+ module.exports = { stripSwiftToolchainRunpath };
@@ -0,0 +1 @@
1
+ export declare function stripSwiftToolchainRunpath(podfile: string): string;
@@ -19,6 +19,7 @@
19
19
  @property (nonatomic, assign) BOOL sparkPrimaryInstance;
20
20
  @property (nonatomic, weak) NSWindow *sparkLastFocusedWindow;
21
21
  @property (nonatomic, strong) NSColor *sparkStartupColor;
22
+ @property (nonatomic, weak) RCTSurfacePresenter *sparkDriverPresenter;
22
23
  @end
23
24
 
24
25
  @implementation AppDelegate
@@ -125,11 +126,7 @@
125
126
  - (void)loadReactNativeWindow:(NSDictionary *)launchOptions {
126
127
  [self sparkPrepareMainWindow];
127
128
  NSView *root = [self.rootViewFactory viewWithModuleName:self.moduleName initialProperties:self.initialProps launchOptions:launchOptions];
128
- if (SparkTestDriverActive()) {
129
- RCTSurfacePresenter *presenter = self.rootViewFactory.reactHost.surfacePresenter;
130
- if (!presenter) [NSException raise:NSInternalInconsistencyException format:@"The test driver needs the Fabric surface presenter"];
131
- [presenter addObserver:self];
132
- }
129
+ if (SparkTestDriverActive()) [self sparkObserveDriverMounts:self.rootViewFactory.reactHost];
133
130
  root.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
134
131
  NSDictionary *options = SparkWindowConfiguration();
135
132
  if ([options[@"transparent"] boolValue] || options[@"backgroundColor"] || SparkLifecycleConfiguration()[@"mainWindow"][@"backgroundColors"])
@@ -153,7 +150,21 @@
153
150
  }
154
151
  });
155
152
  }
153
+ - (void)sparkObserveDriverMounts:(RCTHost *)host {
154
+ RCTSurfacePresenter *presenter = host.surfacePresenter;
155
+ if (!presenter) [NSException raise:NSInternalInconsistencyException format:@"The test driver needs the Fabric surface presenter"];
156
+ [self.sparkDriverPresenter removeObserver:self];
157
+ self.sparkDriverPresenter = presenter;
158
+ [presenter addObserver:self];
159
+ }
156
160
  - (void)didMountComponentsWithRootTag:(NSInteger)rootTag { SparkTestDriverDidMount(); }
161
+ - (void)hostDidStart:(RCTHost *)host {
162
+ [super hostDidStart:host];
163
+ if (SparkTestDriverActive() && host == self.rootViewFactory.reactHost) {
164
+ SparkTestDriverDidReload();
165
+ [self sparkObserveDriverMounts:host];
166
+ }
167
+ }
157
168
  - (BOOL)windowShouldClose:(NSWindow *)window {
158
169
  NSString *behavior = SparkLifecycleConfiguration()[@"mainWindow"][@"closeBehavior"];
159
170
  if ([behavior isEqual:@"hide"]) { [window orderOut:nil]; return NO; }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-host",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "AppDelegate.mm",
@@ -9,7 +9,7 @@
9
9
  "SparkCustomize.mm"
10
10
  ],
11
11
  "dependencies": {
12
- "@legendapp/spark-desktop-app": "0.0.4"
12
+ "@legendapp/spark-desktop-app": "0.0.5"
13
13
  },
14
14
  "private": true
15
15
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-links",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -35,7 +35,7 @@
35
35
  ]
36
36
  },
37
37
  "dependencies": {
38
- "@legendapp/spark-desktop-app": "0.0.4"
38
+ "@legendapp/spark-desktop-app": "0.0.5"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "expo-linking": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-shortcuts",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -33,7 +33,7 @@
33
33
  ]
34
34
  },
35
35
  "dependencies": {
36
- "@legendapp/spark-desktop-app": "0.0.4"
36
+ "@legendapp/spark-desktop-app": "0.0.5"
37
37
  },
38
38
  "private": true
39
39
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-desktop-windows",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -33,8 +33,8 @@
33
33
  ]
34
34
  },
35
35
  "dependencies": {
36
- "@legendapp/spark-desktop-app": "0.0.4",
37
- "@legendapp/spark-window-options": "0.0.4",
36
+ "@legendapp/spark-desktop-app": "0.0.5",
37
+ "@legendapp/spark-window-options": "0.0.5",
38
38
  "@legendapp/state": "^3.0.0-beta.42"
39
39
  },
40
40
  "private": true
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-documents",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "main": "src/index.tsx",
@@ -8,12 +8,12 @@
8
8
  "src"
9
9
  ],
10
10
  "dependencies": {
11
- "@legendapp/spark-file-dialog": "0.0.4",
12
- "@legendapp/spark-file-system": "0.0.4",
13
- "@legendapp/spark-native-menu": "0.0.4",
14
- "@legendapp/spark-desktop-app": "0.0.4",
15
- "@legendapp/spark-desktop-windows": "0.0.4",
16
- "@legendapp/spark-desktop-links": "0.0.4"
11
+ "@legendapp/spark-file-dialog": "0.0.5",
12
+ "@legendapp/spark-file-system": "0.0.5",
13
+ "@legendapp/spark-native-menu": "0.0.5",
14
+ "@legendapp/spark-desktop-app": "0.0.5",
15
+ "@legendapp/spark-desktop-windows": "0.0.5",
16
+ "@legendapp/spark-desktop-links": "0.0.5"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "^19.2.0",