@legendapp/spark 0.0.1-next.3 → 0.0.1-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/camera.ts +13 -0
- package/customize.ts +2 -0
- package/html.ts +1 -0
- package/markdown.ts +1 -0
- package/package.json +34 -15
- package/patches/camera/react-native-nitro-image.patch +320 -0
- package/patches/camera/react-native-nitro-modules.patch +50 -0
- package/patches/camera/react-native-vision-camera.patch +2662 -0
- package/patches/camera/upstream.json +22 -0
- package/patches/dependencies.json +14 -0
- package/patches/react-native-enriched-html@1.1.1.patch +854 -0
- package/patches/react-native-enriched-markdown@1.1.1.patch +9261 -0
- package/postinstall.cjs +1 -0
- package/schema.json +104 -0
- package/skills/spark/SKILL.md +56 -0
- package/skills/spark/UPGRADING.md +246 -0
- package/ui-swipe.ts +1 -0
- package/vendor/node_modules/@legendapp/spark-ai/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.cjs +11 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.d.cts +2 -0
- package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +2 -19
- package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +4 -4
- package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +65 -11
- package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +2 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +3 -2
- package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +36 -13
- package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +41 -26
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-ai.cjs +108 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-artifacts.js +315 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-cli.cjs +75 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-github.cjs +133 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-policy.cjs +102 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-provider.cjs +2 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/customize-worker.cjs +273 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +157 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +3 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +128 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +100 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +30 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/expo-native.cjs +5 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/helpers.js +1 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +52 -7
- package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/js-runtime.cjs +96 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/json.js +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +152 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +184 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.d.cts +16 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +5 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager-config.js +41 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +13 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/process.js +7 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +66 -30
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +2 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.ps1 +87 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.sh +107 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-downloads.tsv +13 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-install.js +8 -3
- package/vendor/node_modules/@legendapp/spark-cli/dist/universal.cjs +2 -1
- package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +102 -0
- package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -8
- package/vendor/node_modules/@legendapp/spark-cli/package.json +6 -4
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +47 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +46 -3
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/.claude/skills/spark/SKILL.md +9 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/AGENTS.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/CLAUDE.md +4 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/README.md +15 -0
- package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +47 -3
- package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-commands/package.json +6 -6
- package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +14 -1
- package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/menu.ts +6 -4
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize-hooks.ts +17 -0
- package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize.ts +117 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +20 -1
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +5 -2
- package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +14 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/customize-provider.cjs +16 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/customize.cjs +16 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/expo.cjs +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +106 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +1 -0
- package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +5 -4
- package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +104 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/SparkCustomize.mm +517 -0
- package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +3 -1
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +3 -0
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +1 -1
- package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +44 -4
- package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -4
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +65 -26
- package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +8 -6
- package/vendor/node_modules/@legendapp/spark-documents/package.json +8 -8
- package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +1 -0
- package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +11 -10
- package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-html/package.json +24 -0
- package/vendor/node_modules/@legendapp/spark-html/src/Html.tsx +22 -0
- package/vendor/node_modules/@legendapp/spark-html/src/HtmlInput.tsx +102 -0
- package/vendor/node_modules/@legendapp/spark-html/src/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-html/src/types.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-markdown/package.json +24 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/Markdown.tsx +24 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/MarkdownInput.tsx +111 -0
- package/vendor/node_modules/@legendapp/spark-markdown/src/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.h +16 -11
- package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-rich-text/package.json +18 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/components.tsx +52 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/index.ts +4 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/types.ts +24 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.macos.ts +55 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.ts +13 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputValue.ts +14 -0
- package/vendor/node_modules/@legendapp/spark-rich-text/src/value.ts +16 -0
- package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +5 -5
- package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-system/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +360 -35
- package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.h +10 -0
- package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.mm +422 -0
- package/vendor/node_modules/@legendapp/spark-ui/package.json +4 -3
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +30 -13
- package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/SwipeActionsNativeComponent.ts +11 -0
- package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/index.tsx +41 -0
- package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -3
- package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
- package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[Parameter(Mandatory = $true, Position = 0)][string]$Entry,
|
|
3
|
+
[Parameter(ValueFromRemainingArguments = $true)][string[]]$ScriptArgs
|
|
4
|
+
)
|
|
5
|
+
$ErrorActionPreference = 'Stop'
|
|
6
|
+
$platform = 'win32'
|
|
7
|
+
$arch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString().ToLowerInvariant()
|
|
8
|
+
if ($arch -notin @('arm64', 'x64')) { throw "Unsupported runtime architecture: $arch" }
|
|
9
|
+
$sparkHome = if ($env:SPARK_HOME) { $env:SPARK_HOME } else { Join-Path $env:USERPROFILE '.spark' }
|
|
10
|
+
$cache = Join-Path $sparkHome 'tooling/runtimes'
|
|
11
|
+
$assets = Import-Csv (Join-Path $PSScriptRoot 'runtime-downloads.tsv') -Delimiter "`t"
|
|
12
|
+
|
|
13
|
+
function Test-Compatible([string]$Executable, [string]$Kind = '') {
|
|
14
|
+
if (-not (Test-Path -LiteralPath $Executable -PathType Leaf)) { return $false }
|
|
15
|
+
try {
|
|
16
|
+
& $Executable (Join-Path $PSScriptRoot 'js-runtime.cjs') $Kind 2>$null | Out-Null
|
|
17
|
+
return $LASTEXITCODE -eq 0
|
|
18
|
+
} catch { return $false }
|
|
19
|
+
}
|
|
20
|
+
function Start-Runtime([string]$Executable) {
|
|
21
|
+
$env:SPARK_JS_RUNTIME = $Executable
|
|
22
|
+
$env:PATH = "$(Split-Path -Parent $Executable);$env:PATH"
|
|
23
|
+
& $Executable $Entry @ScriptArgs
|
|
24
|
+
exit $LASTEXITCODE
|
|
25
|
+
}
|
|
26
|
+
function Get-Asset([string]$Kind) {
|
|
27
|
+
return $assets | Where-Object { $_.runtime -eq $Kind -and $_.platform -eq $platform -and $_.arch -eq $arch } | Select-Object -First 1
|
|
28
|
+
}
|
|
29
|
+
function Get-Destination($Asset) {
|
|
30
|
+
return Join-Path $cache "$($Asset.runtime)-$($Asset.version)-$platform-$arch-$($Asset.sha256)"
|
|
31
|
+
}
|
|
32
|
+
function Test-Cached($Asset) {
|
|
33
|
+
$destination = Get-Destination $Asset
|
|
34
|
+
$executable = Join-Path $destination $Asset.executable
|
|
35
|
+
$marker = Join-Path $destination '.binary-sha256'
|
|
36
|
+
return (Test-Path -LiteralPath $executable -PathType Leaf) -and (Test-Path -LiteralPath $marker -PathType Leaf) -and
|
|
37
|
+
((Get-FileHash -LiteralPath $executable -Algorithm SHA256).Hash -eq (Get-Content -LiteralPath $marker -Raw).Trim()) -and (Test-Compatible $executable)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
$requested = $env:SPARK_JS_RUNTIME
|
|
41
|
+
if ($requested -and $requested -notin @('node', 'bun')) {
|
|
42
|
+
if (-not (Test-Compatible $requested)) { throw "Unsupported or missing runtime: $requested" }
|
|
43
|
+
Start-Runtime $requested
|
|
44
|
+
}
|
|
45
|
+
$choices = if ($requested) { @($requested) } else { @('bun', 'node') }
|
|
46
|
+
foreach ($kind in $choices) {
|
|
47
|
+
$command = Get-Command "$kind.exe" -CommandType Application -ErrorAction SilentlyContinue | Select-Object -First 1
|
|
48
|
+
if ($command -and (Test-Compatible $command.Source $requested)) { Start-Runtime $command.Source }
|
|
49
|
+
$asset = Get-Asset $kind
|
|
50
|
+
if ($asset -and (Test-Cached $asset)) { Start-Runtime (Join-Path (Get-Destination $asset) $asset.executable) }
|
|
51
|
+
}
|
|
52
|
+
$download = if ($requested) { $requested } elseif ($env:SPARK_RUNTIME_DOWNLOAD) { $env:SPARK_RUNTIME_DOWNLOAD } else { 'bun' }
|
|
53
|
+
if ($download -notin @('node', 'bun')) { throw 'SPARK_RUNTIME_DOWNLOAD must be node or bun.' }
|
|
54
|
+
$asset = Get-Asset $download
|
|
55
|
+
if (-not $asset) { throw "No pinned $download download for $platform/$arch. Install a compatible runtime manually." }
|
|
56
|
+
$destination = Get-Destination $asset
|
|
57
|
+
New-Item -ItemType Directory -Path $cache -Force | Out-Null
|
|
58
|
+
$lock = $null
|
|
59
|
+
$staging = $null
|
|
60
|
+
try {
|
|
61
|
+
# An OS file lock is released even when installation is interrupted or crashes.
|
|
62
|
+
for ($attempt = 0; $attempt -lt 60 -and -not $lock; $attempt++) {
|
|
63
|
+
try { $lock = [IO.File]::Open("$destination.lock", [IO.FileMode]::OpenOrCreate, [IO.FileAccess]::ReadWrite, [IO.FileShare]::None) }
|
|
64
|
+
catch [IO.IOException] { Start-Sleep -Seconds 1 }
|
|
65
|
+
}
|
|
66
|
+
if (-not $lock) { throw "Another process is installing $download; retry shortly." }
|
|
67
|
+
if (-not (Test-Cached $asset)) {
|
|
68
|
+
$staging = Join-Path $cache ".install-$download-$([Guid]::NewGuid())"
|
|
69
|
+
New-Item -ItemType Directory -Path $staging | Out-Null
|
|
70
|
+
$archive = Join-Path $staging 'archive.zip'
|
|
71
|
+
Write-Host "Downloading Spark's private $download $($asset.version) runtime..."
|
|
72
|
+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
|
|
73
|
+
Invoke-WebRequest -Uri $asset.url -OutFile $archive -UseBasicParsing -TimeoutSec 300
|
|
74
|
+
if ((Get-Item -LiteralPath $archive).Length -gt 134217728 -or (Get-FileHash -LiteralPath $archive -Algorithm SHA256).Hash -ne $asset.sha256) { throw 'Runtime download checksum or size mismatch.' }
|
|
75
|
+
$unpacked = Join-Path $staging 'unpacked'
|
|
76
|
+
Expand-Archive -LiteralPath $archive -DestinationPath $unpacked
|
|
77
|
+
$executable = Join-Path $unpacked $asset.executable
|
|
78
|
+
if (-not (Test-Compatible $executable)) { throw 'Downloaded runtime cannot run on this machine.' }
|
|
79
|
+
(Get-FileHash -LiteralPath $executable -Algorithm SHA256).Hash | Set-Content -LiteralPath (Join-Path $unpacked '.binary-sha256')
|
|
80
|
+
if (Test-Path -LiteralPath $destination) { Remove-Item -LiteralPath $destination -Recurse -Force }
|
|
81
|
+
Move-Item -LiteralPath $unpacked -Destination $destination
|
|
82
|
+
}
|
|
83
|
+
} finally {
|
|
84
|
+
if ($staging -and (Test-Path -LiteralPath $staging)) { Remove-Item -LiteralPath $staging -Recurse -Force }
|
|
85
|
+
if ($lock) { $lock.Dispose() }
|
|
86
|
+
}
|
|
87
|
+
Start-Runtime (Join-Path $destination $asset.executable)
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# This entry point intentionally needs no JavaScript runtime or package manager.
|
|
3
|
+
set -eu
|
|
4
|
+
here=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
5
|
+
[ "$#" -gt 0 ] || { echo 'Usage: runtime-bootstrap.sh <JavaScript entry> [arguments...]' >&2; exit 2; }
|
|
6
|
+
entry=$1
|
|
7
|
+
shift
|
|
8
|
+
case $(uname -s) in Darwin) platform=darwin ;; Linux) platform=linux ;; *) echo 'Use runtime-bootstrap.ps1 on Windows.' >&2; exit 1 ;; esac
|
|
9
|
+
case $(uname -m) in arm64|aarch64) arch=arm64 ;; x86_64|amd64) arch=x64 ;; *) echo 'Unsupported runtime architecture.' >&2; exit 1 ;; esac
|
|
10
|
+
cache=${SPARK_HOME:-"$HOME/.spark"}/tooling/runtimes
|
|
11
|
+
|
|
12
|
+
compatible() {
|
|
13
|
+
[ -f "$1" ] && [ -x "$1" ] && "$1" "$here/js-runtime.cjs" "${2:-}" >/dev/null 2>&1
|
|
14
|
+
}
|
|
15
|
+
launch() {
|
|
16
|
+
runtime_path=$1
|
|
17
|
+
shift
|
|
18
|
+
SPARK_JS_RUNTIME=$runtime_path
|
|
19
|
+
export SPARK_JS_RUNTIME
|
|
20
|
+
PATH="$(dirname -- "$runtime_path"):$PATH"
|
|
21
|
+
export PATH
|
|
22
|
+
exec "$runtime_path" "$entry" "$@"
|
|
23
|
+
}
|
|
24
|
+
asset() {
|
|
25
|
+
row=$(awk -F '\t' -v kind="$1" -v platform="$platform" -v arch="$arch" '$1 == kind && $3 == platform && $4 == arch { print }' "$here/runtime-downloads.tsv")
|
|
26
|
+
[ -n "$row" ] || return 1
|
|
27
|
+
read -r kind version target cpu url checksum relative <<EOF
|
|
28
|
+
$row
|
|
29
|
+
EOF
|
|
30
|
+
destination="$cache/$kind-$version-$target-$cpu-$checksum"
|
|
31
|
+
runtime_path="$destination/$relative"
|
|
32
|
+
}
|
|
33
|
+
sha256() {
|
|
34
|
+
if command -v shasum >/dev/null 2>&1; then shasum -a 256 "$1" | awk '{print $1}'
|
|
35
|
+
else sha256sum "$1" | awk '{print $1}'; fi
|
|
36
|
+
}
|
|
37
|
+
cached() {
|
|
38
|
+
[ -f "$runtime_path" ] && [ -f "$destination/.binary-sha256" ] &&
|
|
39
|
+
[ "$(sha256 "$runtime_path")" = "$(cat "$destination/.binary-sha256")" ] && compatible "$runtime_path"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
requested=${SPARK_JS_RUNTIME:-}
|
|
43
|
+
case "$requested" in
|
|
44
|
+
'') choices='bun node' ;;
|
|
45
|
+
node|bun) choices=$requested ;;
|
|
46
|
+
*) compatible "$requested" || { echo "Unsupported or missing runtime: $requested" >&2; exit 1; }
|
|
47
|
+
launch "$requested" "$@" ;;
|
|
48
|
+
esac
|
|
49
|
+
for kind in $choices; do
|
|
50
|
+
candidate=$(command -v "$kind" || true)
|
|
51
|
+
if [ -n "$candidate" ] && compatible "$candidate" "$requested"; then launch "$candidate" "$@"; fi
|
|
52
|
+
if asset "$kind" && cached; then launch "$runtime_path" "$@"; fi
|
|
53
|
+
done
|
|
54
|
+
download=${requested:-${SPARK_RUNTIME_DOWNLOAD:-bun}}
|
|
55
|
+
case "$download" in node|bun) ;; *) echo 'SPARK_RUNTIME_DOWNLOAD must be node or bun.' >&2; exit 2 ;; esac
|
|
56
|
+
asset "$download" || { echo "No pinned $download download for $platform/$arch. Install a compatible runtime manually." >&2; exit 1; }
|
|
57
|
+
mkdir -p "$cache"
|
|
58
|
+
lock="$destination.lock"
|
|
59
|
+
owned=0
|
|
60
|
+
staging=''
|
|
61
|
+
cleanup() {
|
|
62
|
+
[ -z "$staging" ] || rm -rf -- "$staging"
|
|
63
|
+
[ "$owned" = 0 ] || rm -rf -- "$lock"
|
|
64
|
+
}
|
|
65
|
+
trap cleanup EXIT
|
|
66
|
+
trap 'exit 130' INT
|
|
67
|
+
trap 'exit 143' TERM
|
|
68
|
+
attempt=0
|
|
69
|
+
until mkdir "$lock" 2>/dev/null; do
|
|
70
|
+
attempt=$((attempt + 1))
|
|
71
|
+
[ "$attempt" -lt 60 ] || { echo "Another process is installing $download; retry shortly." >&2; exit 1; }
|
|
72
|
+
if [ -f "$lock/pid" ]; then
|
|
73
|
+
pid=$(cat "$lock/pid" 2>/dev/null || true)
|
|
74
|
+
# Do not reap here: another waiter could acquire a new lock between a
|
|
75
|
+
# stale-owner check and removal. Normal failures/signals use the trap above.
|
|
76
|
+
case "$pid" in ''|*[!0-9]*) ;; *) if ! kill -0 "$pid" 2>/dev/null; then
|
|
77
|
+
echo "Interrupted runtime installation. Remove $lock and retry." >&2
|
|
78
|
+
exit 1
|
|
79
|
+
fi ;; esac
|
|
80
|
+
fi
|
|
81
|
+
sleep 1
|
|
82
|
+
done
|
|
83
|
+
owned=1
|
|
84
|
+
echo "$$" > "$lock/pid"
|
|
85
|
+
if ! cached; then
|
|
86
|
+
staging=$(mktemp -d "$cache/.install-$download-XXXXXX")
|
|
87
|
+
archive="$staging/archive"
|
|
88
|
+
echo "Downloading Spark's private $kind $version runtime…" >&2
|
|
89
|
+
curl --fail --location --proto '=https' --tlsv1.2 --retry 2 --connect-timeout 20 --max-time 300 --max-filesize 134217728 --output "$archive" "$url"
|
|
90
|
+
[ "$(sha256 "$archive")" = "$checksum" ] || { echo 'Runtime download checksum mismatch.' >&2; exit 1; }
|
|
91
|
+
mkdir "$staging/unpacked"
|
|
92
|
+
case "$url" in
|
|
93
|
+
*.zip) unzip -q "$archive" -d "$staging/unpacked" ;;
|
|
94
|
+
*.tar.gz) tar -xzf "$archive" -C "$staging/unpacked" ;;
|
|
95
|
+
*) echo 'Unsupported runtime archive.' >&2; exit 1 ;;
|
|
96
|
+
esac
|
|
97
|
+
compatible "$staging/unpacked/$relative" || { echo 'Downloaded runtime cannot run on this machine.' >&2; exit 1; }
|
|
98
|
+
sha256 "$staging/unpacked/$relative" > "$staging/unpacked/.binary-sha256"
|
|
99
|
+
# The lock owns this versioned cache entry. Publish only verified complete files.
|
|
100
|
+
[ ! -e "$destination" ] || rm -rf -- "$destination"
|
|
101
|
+
mv "$staging/unpacked" "$destination"
|
|
102
|
+
fi
|
|
103
|
+
cleanup
|
|
104
|
+
owned=0
|
|
105
|
+
staging=''
|
|
106
|
+
trap - EXIT INT TERM
|
|
107
|
+
launch "$runtime_path" "$@"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
runtime version platform arch url sha256 executable
|
|
2
|
+
node 24.19.0 darwin arm64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-darwin-arm64.tar.gz 8294b7aa9b03997481c06babf1e8b270c859358f27da57a11509afe537ac381d node-v24.19.0-darwin-arm64/bin/node
|
|
3
|
+
node 24.19.0 darwin x64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-darwin-x64.tar.gz d1b5e999db158c62fe8f7267a4476b035d8bd93b1a605bac24a3f0dd166e3316 node-v24.19.0-darwin-x64/bin/node
|
|
4
|
+
node 24.19.0 win32 arm64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-win-arm64.zip 8502f4a50b458d4cc38ed8f2001556c2cd239d464920f74017926ccb1e1c157f node-v24.19.0-win-arm64/node.exe
|
|
5
|
+
node 24.19.0 win32 x64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-win-x64.zip 57f71ab3652e797d84acddc79c81cc9ff1c6ddb2a1974cdb83f00fee9bff4c73 node-v24.19.0-win-x64/node.exe
|
|
6
|
+
node 24.19.0 linux arm64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-linux-arm64.tar.gz d28c8a5bf0a808f0ed434a1dce8c54ae98f0371c0bd86ac58abc613f73e6643f node-v24.19.0-linux-arm64/bin/node
|
|
7
|
+
node 24.19.0 linux x64 https://nodejs.org/dist/v24.19.0/node-v24.19.0-linux-x64.tar.gz f625d97cd707df4ff96254916fbc5ff014f09c09effe5a1e0ca8f6d41a8789d4 node-v24.19.0-linux-x64/bin/node
|
|
8
|
+
bun 1.3.14 darwin arm64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-darwin-aarch64.zip d8b96221828ad6f97ac7ac0ab7e95872341af763001e8803e8267652c2652620 bun-darwin-aarch64/bun
|
|
9
|
+
bun 1.3.14 darwin x64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-darwin-x64.zip 4183df3374623e5bab315c547cfa0974533cd457d86b73b639f7a87974cd6633 bun-darwin-x64/bun
|
|
10
|
+
bun 1.3.14 win32 arm64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-windows-aarch64.zip 89841f5a57f2348b67ec0839b718f4bf4ea7d07c371c9ba4b77b6c790f918953 bun-windows-aarch64/bun.exe
|
|
11
|
+
bun 1.3.14 win32 x64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-windows-x64.zip 0a0620930b6675d7ba440e81f4e0e00d3cfbe096c4b140d3fff02205e9e18922 bun-windows-x64/bun.exe
|
|
12
|
+
bun 1.3.14 linux arm64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-aarch64.zip a27ffb63a8310375836e0d6f668ae17fa8d8d18b88c37c821c65331973a19a3b bun-linux-aarch64/bun
|
|
13
|
+
bun 1.3.14 linux x64 https://github.com/oven-sh/bun/releases/download/bun-v1.3.14/bun-linux-x64.zip 951ee2aee855f08595aeec6225226a298d3fea83a3dcd6465c09cbccdf7e848f bun-linux-x64/bun
|
|
@@ -46,13 +46,18 @@ const tooling = path.join(root, ".cli");
|
|
|
46
46
|
mkdirSync(tooling, { recursive: true });
|
|
47
47
|
const { values } = parseArgs({ options: { "package-manager": { type: "string" } } });
|
|
48
48
|
const manager = packageManager(root, values["package-manager"]);
|
|
49
|
-
const
|
|
49
|
+
const builds = ["@legendapp/spark", "react-native-enriched-markdown", "fsevents"];
|
|
50
|
+
const pkg = { name: "spark-sdk-tools", private: true, pnpm: { onlyBuiltDependencies: builds }, dependencies: { ...metadata.tooling?.dependencies, "@legendapp/spark": overrides["@legendapp/spark"] } };
|
|
50
51
|
applyOverrides(pkg, { ...metadata.tooling?.overrides, ...overrides }, manager);
|
|
52
|
+
if (manager === "pnpm")
|
|
53
|
+
builds.push(`@legendapp/spark@file:${path.relative(tooling, overrides["@legendapp/spark"].slice(5)).replaceAll("\\", "/")}`);
|
|
51
54
|
writeFileSync(path.join(tooling, "package.json"), JSON.stringify(pkg, null, 2));
|
|
52
55
|
if (manager === "yarn")
|
|
53
56
|
writeFileSync(path.join(tooling, ".yarnrc.yml"), "nodeLinker: node-modules\n");
|
|
54
|
-
if (manager === "pnpm")
|
|
55
|
-
|
|
57
|
+
if (manager === "pnpm") {
|
|
58
|
+
const allowBuilds = Object.fromEntries(builds.map(name => [name, true]));
|
|
59
|
+
writeFileSync(path.join(tooling, "pnpm-workspace.yaml"), JSON.stringify({ nodeLinker: "hoisted", overrides: pkg.pnpm.overrides, allowBuilds }));
|
|
60
|
+
}
|
|
56
61
|
const [executable, ...args] = managerCommand(manager, ["install"]);
|
|
57
62
|
// Only fixed manager names + 'install' use a Windows shell; paths/CLI arguments
|
|
58
63
|
// are always passed directly to Node without shell interpolation.
|
|
@@ -2,13 +2,14 @@ const fs = require("node:fs");
|
|
|
2
2
|
const { readConfig, statePath, supportedPlatforms } = require("@legendapp/spark-desktop-config/config.cjs");
|
|
3
3
|
|
|
4
4
|
exports.nativeConfig = root => {
|
|
5
|
+
const patched = require("@legendapp/spark-desktop-config/native-patches.cjs").prepareNativePatches(root);
|
|
5
6
|
const { expo } = readConfig(root);
|
|
6
7
|
const platform = expo.platforms[0];
|
|
7
8
|
const platforms = process.platform === "win32" ? {} : { windows: { npmPackageName: "react-native-windows" } };
|
|
8
9
|
// Expo autolinking and React Native codegen have separate exclusion inputs.
|
|
9
10
|
// An excluded desktop provider must not enter an iOS module registry either.
|
|
10
11
|
const excluded = (expo.autolinking?.exclude ?? []).map(name => [name, { platforms: { ios: null, macos: null, android: null, windows: null } }]);
|
|
11
|
-
if (!["macos", "windows"].includes(platform)) return { platforms, dependencies: Object.fromEntries(excluded) };
|
|
12
|
+
if (!["macos", "windows"].includes(platform)) return { platforms, dependencies: { ...patched, ...Object.fromEntries(excluded) } };
|
|
12
13
|
const file = statePath(root, "native-selection.json");
|
|
13
14
|
const selection = fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, "utf8")) : { included: [], excluded: [] };
|
|
14
15
|
return { platforms, dependencies: Object.fromEntries([
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
import { enrichedHtmlPinPolicy, installWithEnrichedHtmlPins, repairEnrichedHtmlPins } from "./enriched-html-pins.js";
|
|
10
|
+
import { writePackageConfig } from "./package-manager-config.js";
|
|
11
|
+
import { createRequire } from "node:module";
|
|
12
|
+
import { mkdtempSync, rmSync } from "node:fs";
|
|
13
|
+
import { pathToFileURL } from "node:url";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import os from "node:os";
|
|
16
|
+
import { supportedPlatforms } from "@legendapp/spark-desktop-config/config.cjs";
|
|
17
|
+
import { readJson } from "./json.js";
|
|
18
|
+
import { installedSparkVersion } from "./migrations.cjs";
|
|
19
|
+
import { upgradeDependencyPins, printDependencyPins } from "./dependency-pins.js";
|
|
20
|
+
import { packageManager } from "./package-manager.js";
|
|
21
|
+
function cliRoot(spark) {
|
|
22
|
+
const pkg = readJson(path.join(spark, "package.json"));
|
|
23
|
+
const req = createRequire(path.join(spark, pkg.spark?.bundledModuleRoot ?? ".", "package.json"));
|
|
24
|
+
return path.dirname(req.resolve("@legendapp/spark-cli/package.json"));
|
|
25
|
+
}
|
|
26
|
+
export async function upgrade(root, dryRun = false) {
|
|
27
|
+
const pkg = readJson(path.join(root, "package.json"));
|
|
28
|
+
if ([pkg.dependencies?.["@legendapp/spark"], pkg.devDependencies?.["@legendapp/spark"]].some(spec => typeof spec === "string" && /^(catalog|workspace):/.test(spec)))
|
|
29
|
+
throw new Error("Spark is managed by a workspace or catalog. Update its owning manifest, then run spark upgrade.");
|
|
30
|
+
const current = installedSparkVersion(root);
|
|
31
|
+
const tooling = createRequire(createRequire(import.meta.url).resolve("npm/package.json"));
|
|
32
|
+
const pacote = tooling("pacote");
|
|
33
|
+
const { prerelease, valid, lt } = tooling("semver");
|
|
34
|
+
const preview = prerelease(current);
|
|
35
|
+
if (!valid(current) || (preview && preview[0] !== "next"))
|
|
36
|
+
throw new Error(`Unsupported Spark release channel: ${current}. Use a next or stable release.`);
|
|
37
|
+
const channel = preview ? "next" : "latest";
|
|
38
|
+
const manager = packageManager(root);
|
|
39
|
+
const temporary = mkdtempSync(path.join(os.tmpdir(), "spark-upgrade-"));
|
|
40
|
+
try {
|
|
41
|
+
// npm's shipped registry client verifies tarball integrity independently of
|
|
42
|
+
// the app's installer. Use its public registry unless explicitly configured.
|
|
43
|
+
const options = { cache: path.join(temporary, "cache"), registry: process.env.npm_config_registry };
|
|
44
|
+
const release = await pacote.manifest(`@legendapp/spark@${channel}`, options);
|
|
45
|
+
const version = release.version;
|
|
46
|
+
if (!valid(version) || lt(version, current) || (prerelease(version)?.[0] ?? "latest") !== channel)
|
|
47
|
+
throw new Error(`The ${channel} tag does not identify a compatible Spark update (${version}).`);
|
|
48
|
+
const target = path.join(temporary, "spark");
|
|
49
|
+
await pacote.extract(`@legendapp/spark@${version}`, target, { ...options, integrity: release.dist.integrity });
|
|
50
|
+
if (readJson(path.join(target, "package.json")).version !== version)
|
|
51
|
+
throw new Error("Downloaded Spark version does not match the registry.");
|
|
52
|
+
const cli = cliRoot(target);
|
|
53
|
+
const platforms = supportedPlatforms(root);
|
|
54
|
+
const template = platforms.length > 1 ? "universal" : platforms.includes("windows") ? "windows" : "blank-typescript";
|
|
55
|
+
const defaults = readJson(path.join(cli, "templates", template, "package.json"));
|
|
56
|
+
const webPins = enrichedHtmlPinPolicy(defaults.overrides);
|
|
57
|
+
const releaseTools = await import(__rewriteRelativeImportExtension(pathToFileURL(path.join(cli, "dist/release.js")).href, true));
|
|
58
|
+
const manifest = releaseTools.installedRelease();
|
|
59
|
+
const sources = releaseTools.packageSources(undefined, manifest);
|
|
60
|
+
const webPin = (name) => name in webPins || name === "react-dom";
|
|
61
|
+
const pins = Object.fromEntries(Object.entries({ ...defaults.overrides, ...defaults.dependencies, ...sources, "@legendapp/spark": version }).filter(([name]) => !webPin(name)));
|
|
62
|
+
const requiredOverrides = {
|
|
63
|
+
where: manager === "pnpm" ? ["pnpm", "overrides"] : [manager === "yarn" ? "resolutions" : "overrides"],
|
|
64
|
+
pins: Object.fromEntries(Object.entries({ ...defaults.overrides, ...sources }).filter(([name]) => !webPin(name) && (name !== "react-native-macos" || platforms.includes("macos")) && (name !== "react-native-windows" || platforms.includes("windows")))),
|
|
65
|
+
};
|
|
66
|
+
const issues = [...upgradeDependencyPins(root, true, pins, requiredOverrides), ...repairEnrichedHtmlPins(root, manager, true, webPins)];
|
|
67
|
+
console.log(`Spark ${current} → ${version} (${channel})${dryRun ? " — dry run" : ""}`);
|
|
68
|
+
printDependencyPins(issues);
|
|
69
|
+
const targetMigrations = createRequire(path.join(cli, "package.json"))("./dist/migrations.cjs");
|
|
70
|
+
const plan = targetMigrations.planMigrations(root, version, { fromVersion: current });
|
|
71
|
+
console.log(`Install: ${manager} install`);
|
|
72
|
+
targetMigrations.printMigrationPlan(plan);
|
|
73
|
+
if (dryRun) {
|
|
74
|
+
console.log("No app files changed.");
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
// Verified patched packages must be present before changing their file: pins.
|
|
78
|
+
await releaseTools.materializeReleasePackages(manifest, root);
|
|
79
|
+
releaseTools.verifyMaterializedReleasePackages(manifest, root);
|
|
80
|
+
// Scripts and native dependency declarations must reach the installer too.
|
|
81
|
+
// Keep the old receipt until installation and finalization both succeed.
|
|
82
|
+
targetMigrations.applyMigrationPlan(root, plan, false);
|
|
83
|
+
upgradeDependencyPins(root, false, pins, requiredOverrides);
|
|
84
|
+
writePackageConfig(root, readJson(path.join(root, "package.json")), manager, root, [...Object.keys(webPins), "react-dom"]);
|
|
85
|
+
await installWithEnrichedHtmlPins(root, manager, webPins);
|
|
86
|
+
const req = createRequire(path.join(root, "package.json"));
|
|
87
|
+
// Read fresh bytes: the running process may have cached the old manifest.
|
|
88
|
+
const installed = path.dirname(req.resolve("@legendapp/spark/package.json"));
|
|
89
|
+
if (readJson(path.join(installed, "package.json")).version !== version)
|
|
90
|
+
throw new Error(`Installation did not select Spark ${version}. Fix package-manager overrides and run spark upgrade again.`);
|
|
91
|
+
const updatedCLI = cliRoot(installed);
|
|
92
|
+
const { initializeTemplate } = createRequire(path.join(updatedCLI, "package.json"))("./dist/init-template.cjs");
|
|
93
|
+
const { recordProjectVersion, refreshPointers } = createRequire(path.join(updatedCLI, "package.json"))("./dist/migrations.cjs");
|
|
94
|
+
initializeTemplate(root);
|
|
95
|
+
refreshPointers(root);
|
|
96
|
+
recordProjectVersion(root, version);
|
|
97
|
+
console.log(`Updated Spark to ${version}.`);
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
rmSync(temporary, { recursive: true, force: true });
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { which } from "./process.js";
|
|
1
|
+
import { which, nodeCommand } from "./process.js";
|
|
2
2
|
import { prepareWindowsGeometry } from "./windows-geometry.js";
|
|
3
3
|
import { copyHelpers } from "./helpers.js";
|
|
4
4
|
import { registerWindowsAssociations } from "./windows-associations.js";
|
|
5
5
|
import { checkExpoDesktopNode } from "./expo-node.js";
|
|
6
6
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readdirSync, renameSync, rmSync, readFileSync, writeFileSync } from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import { createRequire } from "node:module";
|
|
9
8
|
import { run } from "./commands.js";
|
|
10
9
|
import { prepareConfig, nativePackages, runtimeFor, stateFile, readJson, writeJson, validateBuildModules, goConfigurationIssues, readAppConfig } from "./project.js";
|
|
11
10
|
import { assertNativePatchPreflight } from "./native-patch-preflight.js";
|
|
12
|
-
// Windows .cmd shims are shell programs; run the package's actual JS entry.
|
|
13
|
-
export function nodeCommand(root, name, bin, args = []) {
|
|
14
|
-
const req = createRequire(path.join(root, "package.json"));
|
|
15
|
-
const file = req.resolve(`${name}/package.json`), pkg = readJson(file);
|
|
16
|
-
return ["node", path.resolve(path.dirname(file), typeof pkg.bin === "string" ? pkg.bin : pkg.bin[bin]), ...args];
|
|
17
|
-
}
|
|
18
11
|
export async function preserveWindowsBuildOutputs(root, prepare) {
|
|
19
12
|
const windows = path.join(root, "windows");
|
|
20
13
|
const outputs = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@legendapp/spark-cli",
|
|
3
|
-
"version": "0.0.1-next.
|
|
3
|
+
"version": "0.0.1-next.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
"node": ">=24.19.0"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@legendapp/spark-desktop-config": "0.0.1-next.
|
|
14
|
+
"@legendapp/spark-desktop-config": "0.0.1-next.5",
|
|
15
15
|
"ws": "8.21.0",
|
|
16
16
|
"expo-desktop": "1.0.0",
|
|
17
|
-
"npm": "11.21.
|
|
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.1-next.
|
|
20
|
+
"@legendapp/spark-window-options": "0.0.1-next.5",
|
|
21
|
+
"diff": "8.0.4",
|
|
22
|
+
"yaml": "2.9.1"
|
|
21
23
|
},
|
|
22
24
|
"private": true
|
|
23
25
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spark
|
|
3
|
+
description: Develop, build, diagnose, or upgrade a Legend Spark desktop app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- spark:skill:start -->
|
|
7
|
+
From the app root, read [Spark's app development skill](node_modules/@legendapp/spark/skills/spark/SKILL.md) before working on this app.
|
|
8
|
+
The installed Spark version owns these instructions; do not copy them here.
|
|
9
|
+
<!-- spark:skill:end -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Spark app
|
|
2
|
+
|
|
3
|
+
Run the app with `macos` using your chosen package manager:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm run macos
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
macOS opens in Spark Runner. Windows requires a custom development build and is
|
|
10
|
+
an unverified preview. JavaScript edits use Fast Refresh. Use `npm run build` for
|
|
11
|
+
a standalone macOS app; native builds require Xcode and CocoaPods.
|
|
12
|
+
|
|
13
|
+
Use the equivalent `bun run`, `pnpm run`, or `yarn` commands for those managers.
|
|
14
|
+
See [Spark documentation](https://legend.so/spark) for configuration, upgrades,
|
|
15
|
+
platform prerequisites, and distribution.
|
|
@@ -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.1-next.
|
|
16
|
+
"@legendapp/spark": "0.0.1-next.5",
|
|
17
17
|
"expo": "54.0.37",
|
|
18
18
|
"expo-desktop": "1.0.0",
|
|
19
19
|
"expo-desktop-prebuild-config": "1.1.0",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"expo-desktop-metro-config": "54.81.0",
|
|
22
22
|
"expo-desktop-template-bare-minimum": "54.81.1",
|
|
23
23
|
"react": "19.1.4",
|
|
24
|
+
"react-dom": "19.1.4",
|
|
24
25
|
"react-native": "0.81.6",
|
|
25
26
|
"react-native-macos": "0.81.7",
|
|
26
27
|
"@react-native-community/cli": "20.1.3",
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
},
|
|
31
32
|
"overrides": {
|
|
32
33
|
"@expo/cli": "54.0.27",
|
|
33
|
-
"react-native-nitro-modules": "0.
|
|
34
|
+
"react-native-nitro-modules": "0.37.0",
|
|
34
35
|
"react-native-webview": "16.0.0",
|
|
35
36
|
"@op-engineering/op-sqlite": "18.2.1",
|
|
36
37
|
"expo-asset": "12.0.13",
|
|
@@ -44,14 +45,57 @@
|
|
|
44
45
|
"react": "19.1.4",
|
|
45
46
|
"react-native": "0.81.6",
|
|
46
47
|
"react-native-macos": "0.81.7",
|
|
47
|
-
"react-native-windows": "0.81.35"
|
|
48
|
+
"react-native-windows": "0.81.35",
|
|
49
|
+
"postcss": "8.5.31",
|
|
50
|
+
"dompurify": "3.4.17",
|
|
51
|
+
"@tiptap/core": "3.32.0",
|
|
52
|
+
"@tiptap/extension-blockquote": "3.32.0",
|
|
53
|
+
"@tiptap/extension-bold": "3.32.0",
|
|
54
|
+
"@tiptap/extension-code": "3.32.0",
|
|
55
|
+
"@tiptap/extension-document": "3.32.0",
|
|
56
|
+
"@tiptap/extension-heading": "3.32.0",
|
|
57
|
+
"@tiptap/extension-history": "3.32.0",
|
|
58
|
+
"@tiptap/extension-image": "3.32.0",
|
|
59
|
+
"@tiptap/extension-italic": "3.32.0",
|
|
60
|
+
"@tiptap/extension-link": "3.32.0",
|
|
61
|
+
"@tiptap/extension-list": "3.32.0",
|
|
62
|
+
"@tiptap/extension-paragraph": "3.32.0",
|
|
63
|
+
"@tiptap/extension-strike": "3.32.0",
|
|
64
|
+
"@tiptap/extension-text": "3.32.0",
|
|
65
|
+
"@tiptap/extension-text-align": "3.32.0",
|
|
66
|
+
"@tiptap/extension-underline": "3.32.0",
|
|
67
|
+
"@tiptap/extensions": "3.32.0",
|
|
68
|
+
"@tiptap/pm": "3.32.0",
|
|
69
|
+
"@tiptap/react": "3.32.0",
|
|
70
|
+
"@tiptap/extension-bubble-menu": "3.32.0",
|
|
71
|
+
"@tiptap/extension-floating-menu": "3.32.0",
|
|
72
|
+
"fast-xml-parser": "5.11.2",
|
|
73
|
+
"react-dom": "19.1.4"
|
|
48
74
|
},
|
|
49
75
|
"expo": {
|
|
50
76
|
"install": {
|
|
51
77
|
"exclude": [
|
|
52
78
|
"react",
|
|
79
|
+
"react-dom",
|
|
53
80
|
"react-native"
|
|
54
81
|
]
|
|
55
82
|
}
|
|
83
|
+
},
|
|
84
|
+
"allowScripts": {
|
|
85
|
+
"@legendapp/spark": true,
|
|
86
|
+
"react-native-enriched-markdown": true,
|
|
87
|
+
"fsevents": true
|
|
88
|
+
},
|
|
89
|
+
"trustedDependencies": [
|
|
90
|
+
"@legendapp/spark",
|
|
91
|
+
"react-native-enriched-markdown",
|
|
92
|
+
"fsevents"
|
|
93
|
+
],
|
|
94
|
+
"pnpm": {
|
|
95
|
+
"onlyBuiltDependencies": [
|
|
96
|
+
"@legendapp/spark",
|
|
97
|
+
"react-native-enriched-markdown",
|
|
98
|
+
"fsevents"
|
|
99
|
+
]
|
|
56
100
|
}
|
|
57
101
|
}
|
package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spark
|
|
3
|
+
description: Develop, build, diagnose, or upgrade a Legend Spark desktop app.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- spark:skill:start -->
|
|
7
|
+
From the app root, read [Spark's app development skill](node_modules/@legendapp/spark/skills/spark/SKILL.md) before working on this app.
|
|
8
|
+
The installed Spark version owns these instructions; do not copy them here.
|
|
9
|
+
<!-- spark:skill:end -->
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Spark app
|
|
2
|
+
|
|
3
|
+
Run the app with `macos` using your chosen package manager:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm run macos
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
macOS opens in Spark Runner. Windows requires a custom development build and is
|
|
10
|
+
an unverified preview. JavaScript edits use Fast Refresh. Use `npm run build` for
|
|
11
|
+
a standalone macOS app; native builds require Xcode and CocoaPods.
|
|
12
|
+
|
|
13
|
+
Use the equivalent `bun run`, `pnpm run`, or `yarn` commands for those managers.
|
|
14
|
+
See [Spark documentation](https://legend.so/spark) for configuration, upgrades,
|
|
15
|
+
platform prerequisites, and distribution.
|
|
@@ -41,11 +41,11 @@
|
|
|
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.1-next.
|
|
44
|
+
"@legendapp/spark": "0.0.1-next.5"
|
|
45
45
|
},
|
|
46
46
|
"overrides": {
|
|
47
47
|
"@expo/cli": "54.0.27",
|
|
48
|
-
"react-native-nitro-modules": "0.
|
|
48
|
+
"react-native-nitro-modules": "0.37.0",
|
|
49
49
|
"react-native-webview": "16.0.0",
|
|
50
50
|
"@op-engineering/op-sqlite": "18.2.1",
|
|
51
51
|
"expo-asset": "12.0.13",
|
|
@@ -59,14 +59,57 @@
|
|
|
59
59
|
"react": "19.1.4",
|
|
60
60
|
"react-native": "0.81.6",
|
|
61
61
|
"react-native-macos": "0.81.7",
|
|
62
|
-
"react-native-windows": "0.81.35"
|
|
62
|
+
"react-native-windows": "0.81.35",
|
|
63
|
+
"postcss": "8.5.31",
|
|
64
|
+
"dompurify": "3.4.17",
|
|
65
|
+
"@tiptap/core": "3.32.0",
|
|
66
|
+
"@tiptap/extension-blockquote": "3.32.0",
|
|
67
|
+
"@tiptap/extension-bold": "3.32.0",
|
|
68
|
+
"@tiptap/extension-code": "3.32.0",
|
|
69
|
+
"@tiptap/extension-document": "3.32.0",
|
|
70
|
+
"@tiptap/extension-heading": "3.32.0",
|
|
71
|
+
"@tiptap/extension-history": "3.32.0",
|
|
72
|
+
"@tiptap/extension-image": "3.32.0",
|
|
73
|
+
"@tiptap/extension-italic": "3.32.0",
|
|
74
|
+
"@tiptap/extension-link": "3.32.0",
|
|
75
|
+
"@tiptap/extension-list": "3.32.0",
|
|
76
|
+
"@tiptap/extension-paragraph": "3.32.0",
|
|
77
|
+
"@tiptap/extension-strike": "3.32.0",
|
|
78
|
+
"@tiptap/extension-text": "3.32.0",
|
|
79
|
+
"@tiptap/extension-text-align": "3.32.0",
|
|
80
|
+
"@tiptap/extension-underline": "3.32.0",
|
|
81
|
+
"@tiptap/extensions": "3.32.0",
|
|
82
|
+
"@tiptap/pm": "3.32.0",
|
|
83
|
+
"@tiptap/react": "3.32.0",
|
|
84
|
+
"@tiptap/extension-bubble-menu": "3.32.0",
|
|
85
|
+
"@tiptap/extension-floating-menu": "3.32.0",
|
|
86
|
+
"fast-xml-parser": "5.11.2",
|
|
87
|
+
"react-dom": "19.1.4"
|
|
63
88
|
},
|
|
64
89
|
"expo": {
|
|
65
90
|
"install": {
|
|
66
91
|
"exclude": [
|
|
67
92
|
"react",
|
|
93
|
+
"react-dom",
|
|
68
94
|
"react-native"
|
|
69
95
|
]
|
|
70
96
|
}
|
|
97
|
+
},
|
|
98
|
+
"allowScripts": {
|
|
99
|
+
"@legendapp/spark": true,
|
|
100
|
+
"react-native-enriched-markdown": true,
|
|
101
|
+
"fsevents": true
|
|
102
|
+
},
|
|
103
|
+
"trustedDependencies": [
|
|
104
|
+
"@legendapp/spark",
|
|
105
|
+
"react-native-enriched-markdown",
|
|
106
|
+
"fsevents"
|
|
107
|
+
],
|
|
108
|
+
"pnpm": {
|
|
109
|
+
"onlyBuiltDependencies": [
|
|
110
|
+
"@legendapp/spark",
|
|
111
|
+
"react-native-enriched-markdown",
|
|
112
|
+
"fsevents"
|
|
113
|
+
]
|
|
71
114
|
}
|
|
72
115
|
}
|