Shared/ScriptWidgetRuntime/: core Swift runtime (JavaScriptCore host, JSX → SwiftUI rendering, helper APIs).iOS/ScriptWidget*: iOS app, widget, and share extension sources (SwiftUI views underView/, managers underManager/).macOS/ScriptWidgetMac*: macOS app + widget targets reusing the shared runtime.Editor/editorfe/: React 17 + CodeMirror 6 editor frontend (CRA).Resource/: marketing assets, screenshots, icons.Scripts/<PackageName>/main.jsx: runtime widget packages (synced via iCloud/app group); build artifacts land in__Build/.
open iOS/ScriptWidget.xcodeprojandopen macOS/ScriptWidgetMac.xcodeproj: build/run in Xcode (schemes:ScriptWidget,ScriptWidgetWidget,ScriptWidgetShare,ScriptWidgetMac,ScriptWidgetMacWidget).cd Editor/editorfe && npm install: install editor dependencies.npm start: run the editor dev server athttp://localhost:3000.npm test: run editor tests (react-scripts).npm run build: produce static editor assets inEditor/editorfe/build.- When running iOS/macOS targets, enable the
iCloud.ScriptWidgetcontainer andgroup.everettjf.scriptwidgetapp group so script storage works.
- Swift: 4-space indentation, Xcode defaults,
UpperCamelCasefor types,lowerCamelCasefor methods/vars. Keep SwiftUI views inView/and managers inManager/. - JavaScript/React: 2-space indentation (match existing files),
UpperCamelCasefor components,lowerCamelCasefor functions. Prettier is available but not wired; avoid broad reformatting. - Runtime scripts: packages live under
Scripts/<PackageName>/withmain.jsxentrypoint.
- Editor:
npm test(Jest via react-scripts + Testing Library). Add tests next to related components when feasible. - Swift: no dedicated unit-test target yet; validate by running the iOS/macOS app and widget schemes. Smoke-test Live Activity/Dynamic Island rendering and iCloud migration paths when touching runtime or storage.
- History shows short, informal summaries (often lowercase) and merge commits; no strict convention. Use concise, action-oriented summaries and add a short body when context helps.
- PRs should include: a clear description, linked issue (if applicable), and screenshots for UI changes. Note which schemes/commands you ran (e.g.,
ScriptWidgetWidget,npm test).