@legendapp/spark 0.0.1-next.4 → 0.0.1-next.6

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 (132) hide show
  1. package/README.md +1 -1
  2. package/customize.ts +2 -0
  3. package/html.ts +1 -0
  4. package/markdown.ts +1 -0
  5. package/package.json +22 -13
  6. package/patches/dependencies.json +10 -4
  7. package/patches/react-native-enriched-html@1.1.1.patch +854 -0
  8. package/patches/{react-native-enriched-markdown@1.0.2.patch → react-native-enriched-markdown@1.1.1.patch} +2560 -1983
  9. package/schema.json +104 -0
  10. package/skills/spark/SKILL.md +56 -0
  11. package/skills/spark/UPGRADING.md +254 -0
  12. package/vendor/node_modules/@legendapp/spark-ai/package.json +4 -4
  13. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.cjs +11 -0
  14. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.d.cts +2 -0
  15. package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +2 -19
  16. package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -3
  17. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  18. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +4 -4
  19. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +3 -0
  20. package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +31 -11
  21. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-ai.cjs +108 -0
  22. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-artifacts.js +315 -0
  23. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-cli.cjs +75 -0
  24. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-github.cjs +133 -0
  25. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-policy.cjs +102 -0
  26. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-provider.cjs +2 -0
  27. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-worker.cjs +273 -0
  28. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +54 -29
  29. package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +2 -0
  30. package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +128 -0
  31. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +30 -1
  32. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +16 -7
  33. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -0
  34. package/vendor/node_modules/@legendapp/spark-cli/dist/js-runtime.cjs +96 -0
  35. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +152 -0
  36. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +15 -0
  37. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +184 -0
  38. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.d.cts +16 -0
  39. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +2 -0
  40. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager-config.js +41 -0
  41. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +13 -0
  42. package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -0
  43. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +40 -9
  44. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +19 -19
  45. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.ps1 +87 -0
  46. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.sh +107 -0
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-downloads.tsv +13 -0
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-install.js +8 -3
  49. package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +102 -0
  50. package/vendor/node_modules/@legendapp/spark-cli/package.json +6 -4
  51. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/.claude/skills/spark/SKILL.md +9 -0
  52. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/AGENTS.md +4 -0
  53. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/CLAUDE.md +4 -0
  54. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/README.md +15 -0
  55. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +46 -2
  56. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md +9 -0
  57. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/AGENTS.md +4 -0
  58. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/CLAUDE.md +4 -0
  59. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/README.md +15 -0
  60. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +45 -2
  61. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/.claude/skills/spark/SKILL.md +9 -0
  62. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/AGENTS.md +4 -0
  63. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/CLAUDE.md +4 -0
  64. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/README.md +15 -0
  65. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +46 -2
  66. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -3
  67. package/vendor/node_modules/@legendapp/spark-codex/package.json +3 -3
  68. package/vendor/node_modules/@legendapp/spark-commands/package.json +6 -6
  69. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -3
  70. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +14 -1
  71. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -2
  72. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize-hooks.ts +17 -0
  73. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize.ts +117 -0
  74. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +20 -1
  75. package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +3 -2
  76. package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +14 -0
  77. package/vendor/node_modules/@legendapp/spark-desktop-config/customize-provider.cjs +16 -0
  78. package/vendor/node_modules/@legendapp/spark-desktop-config/customize.cjs +16 -0
  79. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +4 -4
  80. package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +104 -0
  81. package/vendor/node_modules/@legendapp/spark-desktop-host/SparkCustomize.mm +517 -0
  82. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +4 -3
  83. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -3
  84. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +3 -1
  85. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +3 -0
  86. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +1 -1
  87. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -3
  88. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +5 -4
  89. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -4
  90. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +62 -25
  91. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +7 -5
  92. package/vendor/node_modules/@legendapp/spark-documents/package.json +8 -8
  93. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -3
  94. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -3
  95. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +1 -0
  96. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +11 -10
  97. package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -3
  98. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -3
  99. package/vendor/node_modules/@legendapp/spark-html/package.json +24 -0
  100. package/vendor/node_modules/@legendapp/spark-html/src/Html.tsx +22 -0
  101. package/vendor/node_modules/@legendapp/spark-html/src/HtmlInput.tsx +102 -0
  102. package/vendor/node_modules/@legendapp/spark-html/src/index.ts +4 -0
  103. package/vendor/node_modules/@legendapp/spark-html/src/types.ts +4 -0
  104. package/vendor/node_modules/@legendapp/spark-markdown/package.json +24 -0
  105. package/vendor/node_modules/@legendapp/spark-markdown/src/Markdown.tsx +24 -0
  106. package/vendor/node_modules/@legendapp/spark-markdown/src/MarkdownInput.tsx +111 -0
  107. package/vendor/node_modules/@legendapp/spark-markdown/src/index.ts +4 -0
  108. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -3
  109. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -3
  110. package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -3
  111. package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -3
  112. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +18 -0
  113. package/vendor/node_modules/@legendapp/spark-rich-text/src/components.tsx +52 -0
  114. package/vendor/node_modules/@legendapp/spark-rich-text/src/index.ts +4 -0
  115. package/vendor/node_modules/@legendapp/spark-rich-text/src/types.ts +24 -0
  116. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.macos.ts +55 -0
  117. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.ts +13 -0
  118. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputValue.ts +14 -0
  119. package/vendor/node_modules/@legendapp/spark-rich-text/src/value.ts +16 -0
  120. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -3
  121. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  122. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +5 -5
  123. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  124. package/vendor/node_modules/@legendapp/spark-system/package.json +3 -3
  125. package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -3
  126. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +102 -14
  127. package/vendor/node_modules/@legendapp/spark-ui/package.json +3 -3
  128. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +5 -0
  129. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +12 -4
  130. package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -3
  131. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  132. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
package/schema.json CHANGED
@@ -452,6 +452,110 @@
452
452
  "extends": {
453
453
  "const": "expo",
454
454
  "description": "Compose desktop options onto the existing Expo configuration."
455
+ },
456
+ "customize": {
457
+ "oneOf": [
458
+ {
459
+ "const": false
460
+ },
461
+ {
462
+ "type": "object",
463
+ "additionalProperties": false,
464
+ "required": [
465
+ "repository",
466
+ "files"
467
+ ],
468
+ "properties": {
469
+ "repository": {
470
+ "type": "string",
471
+ "pattern": "^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$"
472
+ },
473
+ "files": {
474
+ "type": "array",
475
+ "minItems": 1,
476
+ "items": {
477
+ "type": "string"
478
+ }
479
+ },
480
+ "tag": {
481
+ "type": "string"
482
+ },
483
+ "toolkitRepository": {
484
+ "type": "string"
485
+ },
486
+ "toolkitTag": {
487
+ "type": "string"
488
+ },
489
+ "ui": {
490
+ "enum": [
491
+ "default",
492
+ "custom"
493
+ ],
494
+ "default": "default"
495
+ },
496
+ "provider": {
497
+ "oneOf": [
498
+ {
499
+ "type": "object",
500
+ "additionalProperties": false,
501
+ "required": [
502
+ "kind",
503
+ "endpoint",
504
+ "model"
505
+ ],
506
+ "properties": {
507
+ "kind": {
508
+ "enum": [
509
+ "local",
510
+ "remote"
511
+ ]
512
+ },
513
+ "endpoint": {
514
+ "type": "string"
515
+ },
516
+ "model": {
517
+ "type": "string",
518
+ "minLength": 1
519
+ }
520
+ }
521
+ },
522
+ {
523
+ "type": "object",
524
+ "additionalProperties": false,
525
+ "required": [
526
+ "kind",
527
+ "tool"
528
+ ],
529
+ "properties": {
530
+ "kind": {
531
+ "const": "cli"
532
+ },
533
+ "tool": {
534
+ "enum": [
535
+ "codex",
536
+ "claude"
537
+ ]
538
+ },
539
+ "model": {
540
+ "type": "string",
541
+ "minLength": 1
542
+ }
543
+ }
544
+ }
545
+ ]
546
+ },
547
+ "sourceRoot": {
548
+ "type": "string",
549
+ "description": "Relative ancestor of the app project. files are relative to this source snapshot root."
550
+ },
551
+ "githubClientId": {
552
+ "type": "string",
553
+ "pattern": "^[A-Za-z0-9_]+$",
554
+ "description": "GitHub OAuth app client ID with device flow enabled."
555
+ }
556
+ }
557
+ }
558
+ ]
455
559
  }
456
560
  },
457
561
  "allOf": [
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: spark
3
+ description: Create, develop, build, package, diagnose, or upgrade a Legend Spark native desktop app using its installed CLI and tested dependency pins.
4
+ ---
5
+
6
+ # Spark apps
7
+
8
+ Spark adds native macOS/Windows capabilities and desktop build orchestration to React Native and Expo Desktop. This skill covers desktop development. Universal starters also declare mobile/web targets, but Expo owns their runtime and distribution workflows. Do not assume every desktop API works on mobile/web. Windows currently supports development builds; production packaging and native acceptance remain pending. macOS ARM64 is the published preview target; Intel acceptance is pending.
9
+
10
+ ## Create and develop
11
+
12
+ - Require Node 24.19.0 or newer. Create with `npm create @legendapp/spark@next MyApp` (stable releases use `@latest`). Names must be alphanumeric. `npx @legendapp/create-spark@next MyApp` is equivalent; an installed CLI also supports `spark create MyApp`.
13
+ - Creator options follow npm's separator: `npm create @legendapp/spark@next MyApp -- --platform windows --package-manager pnpm`. npm, pnpm, Yarn, and Bun are supported. Keep the app's chosen manager and lockfile.
14
+ - In the app, use its installed CLI through scripts: `npm run dev`, `npm run build`, `npm run package`, or the equivalent manager command. For other commands use `npx --no-install spark <command>` with npm, `pnpm exec spark <command>`, `yarn spark <command>`, or `bun run spark <command>`.
15
+ - `spark dev` starts Expo's terminal and Metro. A compatible Spark Runner needs no native compilation and downloads on first published macOS launch. `d` opens desktop, `g` switches Runner/custom build, `b` builds and opens a custom development runtime. Expo owns reload (`r`), debugger (`j`), dev menu (`m`), editor (`o`), and mobile/web keys. Ctrl+C stops the session and its native app.
16
+ - `spark dev --no-open` waits for a launch key. Expo start flags pass through. `spark dev --go` selects mobile Expo Go, not Spark Runner.
17
+
18
+ ## Configuration and native modules
19
+
20
+ Edit `desktop.config.json` when present; single-target starters generate `app.json` from it. Universal starters use a managed `app.config.js`. Existing Expo apps can use `spark add desktop`; preserve their Expo entry point and compose configuration as the integration guide requires.
21
+
22
+ Install native dependencies with the app's manager and use their documented imports. JavaScript changes Fast Refresh; native code, native configuration, or plugins require a custom build. Press `b`, or run `spark build --dev` then `spark dev`. Use `--force` only when regeneration/compilation must be forced. Put durable native changes in packages/config plugins, not disposable generated native projects.
23
+
24
+ `spark analyze` reports native production selection in `.spark/selection-report.json`. Only SDK modules are pruned automatically; unknown third-party native dependencies stay included. Use package names in `expo.extra.spark.include` for native-only requirements; custom native configuration can require a custom runtime even without extra modules.
25
+
26
+ ## Build and package
27
+
28
+ `spark build` creates a standalone macOS `.app` with bundled JavaScript; `spark open` opens the last standalone build. `spark build --dev` creates the custom Debug runtime. `spark build --preview` uses production module selection in Debug.
29
+
30
+ Native macOS builds need full Xcode (license/first-launch setup and selected developer directory) and CocoaPods on PATH. Command Line Tools alone are insufficient. `spark package` prepares signing/notarization credentials on first use, then signs, notarizes, and creates the distribution archive. Follow the packaging guide for credentials, CI, and pending submissions. Windows uses `spark dev` and `spark build --dev`; do not promise Windows production output.
31
+
32
+ ## Diagnose and upgrade
33
+
34
+ - Run `spark doctor` for dependency pins and native tooling; it exits 1 on issues.
35
+ - Direct `react`, `react-native`, `expo`, and (for macOS apps) `react-native-macos` specs must match the installed CLI's exact template pins. Ranges are drift even when they include the expected version. Check npm/Bun `overrides`, Yarn `resolutions`, and `pnpm.overrides` too. Do not upgrade React/Expo independently of Spark's tested matrix.
36
+ - `catalog:` and `workspace:` baseline specs are left to their owner; validate their resolved versions yourself. Only the app manifest is checked, not workspace-root overrides. Workspace-managed Spark versions need updating at their owner.
37
+ - `spark upgrade --dry-run` previews the newest release on the installed version's channel (`next` or `latest`), target pins, install command, and migrations without modifying the app. `spark upgrade` updates Spark and its release inputs, runs the detected manager's install, then applies versioned migrations and refreshes the AI pointers. Both support `--project <directory>`.
38
+ - `.spark/version` records successful migrations. `dev`, `build`, and `doctor` apply safe idempotent migrations after a manual version change; unsafe pending changes or downgrades stop with `run spark upgrade`. Lifecycle scripts are not required for this check.
39
+ - Keep the generated Spark sections in `AGENTS.md` / `CLAUDE.md` and the `.claude/skills/spark/SKILL.md` pointer thin. Instructions live in this installed package, so updating Spark updates the skill.
40
+
41
+ ## Upgrade an app
42
+
43
+ Read [the packaged upgrade guide](UPGRADING.md). Before updating, retain the old `.spark/version` (or installed package version if unrecorded). Run `spark upgrade --dry-run` through the app's installed CLI, read the dependency pins, install command, ordered migrations, planned file edits and every manual step, then run `spark upgrade`.
44
+
45
+ After installation, read this skill and `UPGRADING.md` from the **new installed package**. Read every release note with `old < version <= new`, including intermediate previews; `.spark/version` advancing does not mean app source or custom native modules have passed validation. Work through `.spark/upgrade-notes.md`, apply the notes' API/config/native changes, and mark each reviewed item complete. Rerun the dry run and doctor, typecheck/test the app, then rebuild and exercise affected native flows. Keep the notes until all manual steps are resolved. If installation fails, fix its error and rerun upgrade; earlier file edits can remain, and migrations are idempotent.
46
+
47
+ ## Common failures
48
+
49
+ - Missing/stale Runner or extra native modules: follow the terminal's compatibility message; build a custom runtime with `b` or `spark build --dev`. A local SDK without release metadata needs a registered local Runner.
50
+ - Expo Desktop config import failures: check the actual Node on PATH; Node 24.12.0 is incompatible with this pinned Expo Desktop setup. Use Node 24.19.0 or newer.
51
+ - Missing `pod` / `xcodebuild`: install the documented native prerequisites, then retry. Spark does not install Xcode or accept licenses.
52
+ - Pin drift, stale Expo terminal patch, or pending migrations: inspect `spark doctor`, preview `spark upgrade --dry-run`, then upgrade. If install fails, fix the manager error and rerun upgrade; the migration version is not advanced by a failed install.
53
+ - Malformed `spark:skill` markers: repair the paired marked section without removing user instructions, then rerun upgrade.
54
+ - Build details live in `.spark/logs/` and `.spark/commands.jsonl`. Keep `.spark/`, generated native outputs, and dependency directories out of version control; commit source/configuration, AI pointer files, vendored release inputs, and the manager lockfile.
55
+
56
+ See the maintained [development guide](https://github.com/LegendApp/legend-spark/blob/main/docs/development.md), [packaging guide](https://github.com/LegendApp/legend-spark/blob/main/docs/packaging.md), and [Expo integration guide](https://github.com/LegendApp/legend-spark/blob/main/docs/add-desktop.md). Use the installed CLI's `--help` and templates for version-specific behavior.
@@ -0,0 +1,254 @@
1
+ # Upgrading Spark apps
2
+
3
+ These notes ship with `@legendapp/spark`. The new package carries the cumulative
4
+ history; do not use a moving main-branch document to decide an installed API.
5
+
6
+ 1. Save the old `.spark/version`. If absent, record the installed
7
+ `node_modules/@legendapp/spark/package.json` version. Keep a source-control
8
+ checkpoint of app source/config and the manager lockfile.
9
+ 2. Run the app's installed `spark upgrade --dry-run` (see SKILL.md for manager
10
+ commands). It selects the current channel, reports pins and install command,
11
+ then evaluates **every** pending migration in semantic-version order without
12
+ writing app files. Read the planned paths and manual steps. Source/config
13
+ conflicts are manual steps, never permission to overwrite customized files.
14
+ 3. Run `spark upgrade`. Migrations update install inputs before the manager runs;
15
+ the receipt advances only after successful installation and finalization.
16
+ An error can leave partial edits: fix the cause and retry. Do not manually
17
+ advance the receipt to suppress a failure.
18
+ 4. From the newly installed package read SKILL.md and **all** sections below with
19
+ `old < version <= new`. For an unrecorded/unknown old version, inspect all
20
+ applicable history and the app's actual code. Version ordering includes
21
+ intermediate `-next.N` previews. Do not stop at the destination release.
22
+ 5. Complete `.spark/upgrade-notes.md`, which links each outstanding step here.
23
+ The receipt tracks applied migrations, not completion of these app decisions.
24
+ Check off completed entries; retain unresolved notes across retries/upgrades.
25
+ Search app source for removed APIs, including namespace/dynamic imports, app
26
+ config functions and custom native modules. Codemods preserve local binding
27
+ names; review call semantics even if a path or imported symbol was changed.
28
+ 6. Run `spark upgrade --dry-run` again and `spark doctor`, then the app's typecheck
29
+ and tests. Rebuild custom runtimes (`spark build --dev`) for native changes and
30
+ exercise affected desktop flows. Commit source/config and the lockfile.
31
+
32
+ ## 0.0.1-next.2
33
+
34
+ Baseline preview for this history. Dependency archives now travel with the app
35
+ under `spark-packages/`; keep those verified inputs available to clones and CI.
36
+ Do not replace patched native package archives with upstream registry versions.
37
+
38
+ ## 0.0.1-next.3
39
+
40
+ Breaking: yes. This release consolidated public contracts and upgraded Expo
41
+ Desktop from beta releases to 1.0.0. Upgrade handles target dependency pins,
42
+ unambiguous JSON window changes, `/message-dialog` → `/dialogs`, and
43
+ `/expo-metro` → `/metro`. The remaining contract decisions are manual.
44
+
45
+ ### Configuration and windows
46
+
47
+ In `desktop.config.json`, or `app.json` under `expo.extra.spark.window`, replace
48
+ flat dimensions and restoration flags. Min/max dimensions become `minSize` and
49
+ `maxSize`; both width and height are required. Incomplete pairs or simultaneous
50
+ old/new values require review. Values describe outer-frame logical units.
51
+
52
+ Before:
53
+ ```json
54
+ { "window": { "width": 1000, "height": 700, "restoreFrame": true, "material": "sidebar", "trafficLights": false } }
55
+ ```
56
+ After:
57
+ ```json
58
+ { "window": { "size": { "width": 1000, "height": 700 }, "restoreBounds": true, "macos": { "backgroundMaterial": "sidebar", "titleBar": { "trafficLights": false } } } }
59
+ ```
60
+
61
+ `openWindow` now requires a registered component and nested size/position.
62
+ `setWindowFrame` became `setWindowBounds`; positions identify their display.
63
+ `WindowInfo.frame` became `bounds`. Do not rename a function without adapting
64
+ arguments. Replace global `onWindowEvent` with per-window typed subscriptions.
65
+
66
+ Before:
67
+ ```ts
68
+ import { openWindow, setWindowFrame } from "@legendapp/spark/windows";
69
+ await openWindow({ id: "editor", width: 900, height: 600 });
70
+ await setWindowFrame("editor", { x: 10, y: 20, width: 900, height: 600 });
71
+ ```
72
+ After (register the `Editor` component with React Native AppRegistry first):
73
+ ```ts
74
+ import { openWindow, getDisplays, setWindowBounds, addWindowListener } from "@legendapp/spark/windows";
75
+ const display = (await getDisplays()).find(d => d.primary)!;
76
+ await openWindow({ id: "editor", component: "Editor", size: { width: 900, height: 600 } });
77
+ await setWindowBounds("editor", { displayId: display.id, x: 10, y: 20, width: 900, height: 600 });
78
+ const subscription = await addWindowListener("editor", "boundsChanged", event => saveBounds(event.bounds));
79
+ // When the owner stops observing:
80
+ await subscription.remove();
81
+ ```
82
+
83
+ Removed `/windows-controls`, `/windows-managed` and `/windows-react` prototype
84
+ surfaces were consolidated into `/windows` and `/windows/macos`. Rework native
85
+ chrome and React registrations using their current types; preserve component
86
+ and window identity, and retry failed asynchronous cleanup.
87
+
88
+ ### Dialogs and file IO
89
+
90
+ Open/save dialogs now return discriminated cancellation results. Options use
91
+ `selection`, `multiple`, `defaultPath`, `filters` with extension lists, and an
92
+ optional `windowId`. Convert directory URLs to absolute paths deliberately.
93
+
94
+ Before:
95
+ ```ts
96
+ const paths = await openFileDialog({ canChooseFiles: true, allowsMultipleSelection: true, allowedFileTypes: ["txt"] });
97
+ if (paths) await load(paths[0]);
98
+ ```
99
+ After:
100
+ ```ts
101
+ const result = await openFileDialog({ selection: "files", multiple: true, filters: [{ name: "Text", extensions: ["txt"] }] });
102
+ if (!result.canceled) await load(result.paths[0]);
103
+ // saveFileDialog likewise returns { canceled: true } or { canceled: false, path }.
104
+ ```
105
+
106
+ Message dialogs live in `/dialogs` and use stable button IDs; update result
107
+ handling from numeric positions to the current result's button ID. File helpers
108
+ left `/dialogs`: use `/files` `readText`, `writeText`, `writeTextIfUnchanged`, and
109
+ `revealInFileManager`. Conditional writes return `{ written }`; reveal now
110
+ returns void and rejects failures. File copy/move use an `overwrite` option
111
+ (default false); make the app's overwrite decision explicit. Validate path and
112
+ IO option keys against the installed types.
113
+
114
+ Before:
115
+ ```ts
116
+ import { readTextFile, writeTextFileIfUnchanged } from "@legendapp/spark/dialogs";
117
+ const previous = await readTextFile(path);
118
+ if (await writeTextFileIfUnchanged(path, previous, next)) markSaved();
119
+ ```
120
+ After:
121
+ ```ts
122
+ import { readText, writeTextIfUnchanged } from "@legendapp/spark/files";
123
+ const previous = await readText(path);
124
+ if ((await writeTextIfUnchanged(path, previous, next)).written) markSaved();
125
+ ```
126
+
127
+ ### Other contract changes to review
128
+
129
+ The API consistency work also affects these app-owned decisions. Compare every
130
+ used export with the installed declarations; these are not safe text renames.
131
+
132
+ - App/window quit and close guards are awaited registrations with owned cleanup;
133
+ return a boolean decision. A rejected quit decision cancels. Events are typed;
134
+ application identity comes from `getAppContext`, not an event snapshot.
135
+ - Menus and context menus share typed items, stable IDs and explicit owners;
136
+ hooks have imperative lifecycle counterparts. Commands/keyboard bindings have
137
+ separate `/shortcuts/commands` and `/shortcuts/keyboard` entry points.
138
+ - Global shortcuts have an options parameter and owned registration/removal.
139
+ Tray, launcher, system and media registrations bind to the owning instance.
140
+ - Settings storage is explicit; observable settings have readiness/persistence
141
+ lifecycles. Settings windows own their page selection. Do not assume an
142
+ immediate read means persisted data has loaded.
143
+ - Links distinguish URL events from `/app/documents` document requests/history.
144
+ Process APIs have explicit process targets, byte IO and termination semantics.
145
+ - Audio readiness/commands/disposal, media session ownership, authentication
146
+ results and retryable session cleanup changed. Notifications separate content,
147
+ scheduling and removal; update events discriminate by state. SQLite query and
148
+ transaction contracts belong to Spark; large out-of-range integers can be text.
149
+ - Clipboard and secure storage use one Expo-shaped surface. WebView owns its
150
+ props/events/refs through Spark. Controlled UI values, explicit pane composition
151
+ and generic drag/drop contracts changed; remove assumptions about old callbacks.
152
+ - Internal transport exports are private. Use the installed public entry paths
153
+ and types instead of importing implementation packages or relying on `export *`.
154
+
155
+ ### Metro and custom native modules
156
+
157
+ `/universal` was removed. Split `nativeConfig` and `metroConfig` imports:
158
+
159
+ Before:
160
+ ```js
161
+ // react-native.config.js
162
+ module.exports = require("@legendapp/spark/universal").nativeConfig(__dirname);
163
+ // metro.config.js
164
+ module.exports = require("@legendapp/spark/universal").metroConfig(__dirname);
165
+ ```
166
+ After:
167
+ ```js
168
+ // react-native.config.js
169
+ module.exports = require("@legendapp/spark/native").nativeConfig(__dirname);
170
+ // metro.config.js
171
+ module.exports = require("@legendapp/spark/metro").metroConfig(__dirname);
172
+ ```
173
+
174
+ Existing Expo integrations keep `getDefaultConfig` + `withSparkMetro` composition,
175
+ now from `/metro`. Preserve custom transforms/resolvers. Package-manager scripts
176
+ continue to invoke `spark`; keep the installed SDK's template pins rather than
177
+ independently upgrading React/Expo.
178
+
179
+ Spark's standard AppDelegate owns React bootstrap and event dispatch. Move custom
180
+ pre-JavaScript native startup work to a linked package implementing
181
+ `SparkStartupPlugin` in `RNDesktopApp/SparkLifecycle.h`, configured under
182
+ `macos.lifecycle.plugins` and retained by native `include`. Do not subclass or
183
+ replace the delegate to override quit/reopen or file dispatch. Configure initial
184
+ window policy under `macos.lifecycle.mainWindow`:
185
+
186
+ ```json
187
+ { "macos": { "lifecycle": { "mainWindow": { "hidden": true, "closeBehavior": "hide", "reopenBehavior": "visibleWindows" }, "plugins": ["EditorStartupPlugin"] } }, "include": ["editor-native"] }
188
+ ```
189
+
190
+ Register native quit decisions with `SparkRegisterQuitHandler`, reply exactly once
191
+ on the main thread, and remove with `SparkRemoveQuitHandler`. Rebuild and validate
192
+ custom runtimes after moving native startup work; preserve application data and
193
+ existing frame autosave identity. See the installed native headers and the
194
+ [native host guide](https://github.com/LegendApp/legend-spark/blob/main/docs/host-migration.md)
195
+ for fuller lifecycle semantics.
196
+
197
+ ## 0.0.1-next.4
198
+
199
+ Breaking: no. Target pins and verified native archives update together. Doctor
200
+ now treats ranges as drift for the tested framework baseline. Required overrides
201
+ use `overrides` (npm/Bun), `resolutions` (Yarn), or `pnpm.overrides`. Keep the
202
+ app's manager and lockfile; workspace/catalog pins must be changed at their owner.
203
+
204
+ Before:
205
+ ```json
206
+ { "dependencies": { "react": "^19.1.0", "expo": "^54.0.0" } }
207
+ ```
208
+ After (for this release):
209
+ ```json
210
+ { "dependencies": { "react": "19.1.4", "react-native": "0.81.6", "expo": "54.0.37" } }
211
+ ```
212
+
213
+ Camera and enriched Markdown native dependency patches are applied by the SDK.
214
+ Use public `/camera` and `/markdown` imports; stop manually patching their bundled
215
+ dependencies. Existing custom runtimes must rebuild to include changed native
216
+ code. Native production builds fail when app source imports an excluded module:
217
+ check `spark analyze` and native-only `include` requirements rather than weakening
218
+ the selection. SidebarSplitView gained a native content-list column and swipe
219
+ actions; review customized pane composition if affected. Windows notification
220
+ actions and Nitro initialization changed; validate custom Windows native modules.
221
+
222
+ AI pointer files now refer to this installed skill. Upgrade preserves user text
223
+ and reports malformed markers. Pointer refresh alone does not migrate application
224
+ call semantics; complete every earlier section in the upgrade interval.
225
+
226
+ ## 0.0.1-next.5
227
+
228
+ Breaking: no. No app source or configuration migration is required from next.4.
229
+
230
+ Create new apps with `npm create @legendapp/spark@next MyApp`. The creator and SDK
231
+ share a version and channel. React peers now accept `^19.1.0`; generated apps keep
232
+ the tested React 19.1.4, React Native 0.81.6, and Expo 54.0.37 pins.
233
+
234
+ Read-only rich text is available alongside the existing editable components:
235
+
236
+ ```tsx
237
+ import { Markdown } from '@legendapp/spark/markdown';
238
+ import { Html } from '@legendapp/spark/html';
239
+
240
+ <Markdown value="# Preview" />;
241
+ <Html value="<p>Preview</p>" />;
242
+ ```
243
+
244
+ Existing `MarkdownInput` and `HtmlInput` imports continue to work. Typecheck your
245
+ app and exercise any rich text views you add; rebuild a custom runtime if its
246
+ native rich text dependencies changed since your previous SDK version.
247
+
248
+ ## 0.0.1-next.6
249
+
250
+ Breaking: no. No app source or configuration migration is required from next.5.
251
+
252
+ This release republishes the creator from the release artifacts. The next.5 creator was a local
253
+ development pack and could not create new apps; create them with
254
+ `npm create @legendapp/spark@next MyApp`.
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@legendapp/spark-ai",
3
- "version": "0.0.1-next.4",
3
+ "version": "0.0.1-next.6",
4
4
  "private": true,
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
7
7
  "dependencies": {
8
- "@legendapp/spark-desktop-app": "0.0.1-next.4",
9
- "@legendapp/spark-processes": "0.0.1-next.4"
8
+ "@legendapp/spark-desktop-app": "0.0.1-next.6",
9
+ "@legendapp/spark-processes": "0.0.1-next.6"
10
10
  },
11
11
  "peerDependencies": {
12
- "react": "19.1.4",
12
+ "react": "^19.1.0",
13
13
  "react-native": "0.81.6"
14
14
  },
15
15
  "license": "MIT",
@@ -0,0 +1,11 @@
1
+ // Shared by the runtime AI API and the standalone customize toolkit.
2
+ function buildInvocationCommand(tool, prompt, options = {}) {
3
+ if (tool === 'codex') {
4
+ const args = ['exec', '--ephemeral', '--ignore-user-config', '--ignore-rules', '--skip-git-repo-check'];
5
+ if (options.codex?.model) args.push('--model', options.codex.model);
6
+ args.push('--config', `model_reasoning_effort=${options.codex?.reasoningEffort ?? 'low'}`, '-');
7
+ return { command: 'codex', args, input: prompt };
8
+ }
9
+ return { command: 'claude', args: ['-p', prompt] };
10
+ }
11
+ module.exports = { buildInvocationCommand };
@@ -0,0 +1,2 @@
1
+ import type { AIInvocation, AIInvocationOptions, AIToolId } from "./types";
2
+ export function buildInvocationCommand(tool: AIToolId, prompt: string, options?: AIInvocationOptions): AIInvocation;
@@ -1,8 +1,7 @@
1
1
  import { SparkError } from "@legendapp/spark-desktop-app/src/contracts";
2
+ import { buildInvocationCommand } from "./invocation-command.cjs";
2
3
  import type { AIInvocation, AIInvocationOptions, AIToolId } from "./types";
3
4
 
4
- const defaultCodexReasoningEffort = "low";
5
-
6
5
  export function buildAIInvocation(tool: AIToolId, prompt: string, options: AIInvocationOptions = {}): AIInvocation {
7
6
  if (!["claude", "codex"].includes(tool) || typeof prompt !== "string" || !prompt.trim() || prompt.includes("\0")) throw new SparkError("E_INVALID_ARGUMENT", "Expected an AI tool and nonempty prompt");
8
7
  if (!options || typeof options !== "object" || Array.isArray(options)) throw new SparkError("E_INVALID_ARGUMENT", "Expected invocation options");
@@ -14,21 +13,5 @@ export function buildAIInvocation(tool: AIToolId, prompt: string, options: AIInv
14
13
  if (options.codex.reasoningEffort !== undefined && !["minimal", "low", "medium", "high", "xhigh"].includes(options.codex.reasoningEffort)) throw new SparkError("E_INVALID_ARGUMENT", "Unknown reasoning effort");
15
14
  if (tool !== "codex") throw new SparkError("E_UNSUPPORTED_OPTION", "Codex options require the Codex tool");
16
15
  }
17
- if (tool === "codex") {
18
- const model = options.codex?.model;
19
- const reasoningEffort = options.codex?.reasoningEffort ?? defaultCodexReasoningEffort;
20
- const args: string[] = ["exec", "--ephemeral", "--ignore-user-config", "--ignore-rules", "--skip-git-repo-check"];
21
- if (model) {
22
- args.push("--model", model);
23
- }
24
- args.push("--config", `model_reasoning_effort=${reasoningEffort}`, "-");
25
-
26
- return {
27
- command: "codex",
28
- args,
29
- input: prompt,
30
- };
31
- }
32
-
33
- return { command: "claude", args: ["-p", prompt] };
16
+ return buildInvocationCommand(tool, prompt, options);
34
17
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-audio",
3
- "version": "0.0.1-next.4",
3
+ "version": "0.0.1-next.6",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -11,7 +11,7 @@
11
11
  "*.podspec"
12
12
  ],
13
13
  "peerDependencies": {
14
- "react": "19.1.4",
14
+ "react": "^19.1.0",
15
15
  "react-native": "0.81.6",
16
16
  "expo-audio": "1.1.1"
17
17
  },
@@ -47,6 +47,6 @@
47
47
  },
48
48
  "private": true,
49
49
  "dependencies": {
50
- "@legendapp/spark-desktop-app": "0.0.1-next.4"
50
+ "@legendapp/spark-desktop-app": "0.0.1-next.6"
51
51
  }
52
52
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-auth-session",
3
- "version": "0.0.1-next.4",
3
+ "version": "0.0.1-next.6",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -8,9 +8,9 @@
8
8
  "src"
9
9
  ],
10
10
  "dependencies": {
11
- "@legendapp/spark-desktop-links": "0.0.1-next.4",
11
+ "@legendapp/spark-desktop-links": "0.0.1-next.6",
12
12
  "base64-js": "1.5.1",
13
- "@legendapp/spark-desktop-app": "0.0.1-next.4"
13
+ "@legendapp/spark-desktop-app": "0.0.1-next.6"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "react-native": "0.81.6",
@@ -1,10 +1,10 @@
1
+ import { installWithEnrichedHtmlPins } from "./enriched-html-pins.js";
1
2
  import { installedRelease, materializeReleasePackages, packageSources, verifyMaterializedReleasePackages } from "./release.js";
2
- import { packageManager, managerCommand, localArchive } from "./package-manager.js";
3
+ import { packageManager, localArchive } from "./package-manager.js";
3
4
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
4
5
  import path from "node:path";
5
6
  import { createRequire } from "node:module";
6
7
  import ts from "typescript";
7
- import { run } from "./commands.js";
8
8
  import { readJson, writeJson } from "./project.js";
9
9
  export const integrationMarker = "// spark: existing Expo project";
10
10
  /** Wrap an existing export without reprinting or moving the application's code. */
@@ -110,7 +110,7 @@ export async function addDesktop(root, manifestFile) {
110
110
  writeFileSync(ignoreFile, `${ignore}${ignore.endsWith("\n") || !ignore ? "" : "\n"}\n# Spark verified release package inputs\n!/spark-packages/\n!/spark-packages/**\n`);
111
111
  }
112
112
  }
113
- await run(root, managerCommand(manager, ["install"]));
113
+ await installWithEnrichedHtmlPins(root, manager);
114
114
  console.log("Desktop integration already exists; dependencies installed. Existing configuration preserved.");
115
115
  return;
116
116
  }
@@ -202,6 +202,6 @@ export async function addDesktop(root, manifestFile) {
202
202
  writeFileSync(path.join(root, file), content);
203
203
  if (release)
204
204
  verifyMaterializedReleasePackages(release, root);
205
- await run(root, managerCommand(manager, ["install"]));
205
+ await installWithEnrichedHtmlPins(root, manager);
206
206
  console.log(`Added desktop support to ${root}. Existing entry point and mobile/web scripts are unchanged.\nRun spark build --dev --platform macos, then spark dev --platform macos. Windows native builds run on Windows.`);
207
207
  }
@@ -1,6 +1,7 @@
1
1
  import { restoreNativeMetadata } from "./native-metadata.js";
2
2
  import { assertNativePatchPreflight } from "./native-patch-preflight.js";
3
3
  import { missingNativeFrameworks, preparationChanges, preserveMacOSPods } from "./native-preparation.js";
4
+ import { prepareCustomizeArtifacts } from "./customize-artifacts.js";
4
5
  import { macOSReleaseSettings } from "./macos-release.js";
5
6
  import { macOSXcodeArchitecture, projectPlatform } from "./platform.js";
6
7
  import { isUniversal, isExpoProject } from "@legendapp/spark-desktop-config/config.cjs";
@@ -348,6 +349,8 @@ async function buildUnlocked(root, mode, force) {
348
349
  result.runtime.fingerprint = digest(result.runtime.fingerprint + productionHash);
349
350
  // prebuild can update package/config fields; cache the actual post-generation inputs.
350
351
  writeJson(path.join(destination, "Contents/Resources/spark-runtime.json"), result.runtime);
352
+ if (mode === "release")
353
+ await prepareCustomizeArtifacts(root, result.runtime, destination);
351
354
  copyHelpers(root, destination, readAppConfig(root).expo?.extra?.spark?.helpers);
352
355
  if (mode === "release") {
353
356
  // Hermes is prebuilt, so Xcode's app/Pod compiler settings cannot strip it.