Repository navigation
Add opt-in iCloud JSON API for widget records - #72
Merged
Merged
Conversation
Keep existing local storage unchanged. Require native per-installation grants, bind caches to the iCloud account, retain offline conflicts, and provide isolated Web Studio mocks. Include bounded service tests, API docs and an example package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Widgets can opt into
$icloudto keep JSON records in ScriptWidget’s iCloud Drive container. This adds native read/write, explicit sync, cache-first reads and conflict resolution without a server or third-party SDK. Existing$storageand Habit Heatmap records stay local and unchanged.icloudand Runtime 1.5 in Package 2.0, then connect a store from the native widget context menu. Another device explicitly connects the same store ID. Disconnect revokes access without deleting records.Contract and setup: iCloud JSON API.
Validation
Passed locally:
node Scripts/test-icloud-json.mjs: 11 native fixture tests, including two-device offline forks, explicit resolution, account/installation isolation, shared-store locking, cache recovery, disconnect, symlinks/hardlinks, harmless Finder metadata and deleted-store preservation. Uses production service/helpers with disposable directories; no real iCloud account.SCRIPTWIDGET_SKIP_XCODE=1 ./Scripts/release-readiness.sh(editor tests/build/docs, 180 preview tests, 101 Studio tests, production builds and all browser smoke checks). The focused iCloud suite includes 6 cases.build-for-testing, native CLI Release build, all three Xcode project lints, release/doc validators.Outstanding before release:
This PR does not migrate existing user data, merge to main, deploy Web Studio or submit an App Store build.