CONTRIBUTING.org

3aa264c947476955d58c5cccc70e97072bb47877
orgstar/CONTRIBUTING.org

226 lines · 12222 bytes

  1#+TITLE: Contributing
  2
  3* Status
  4
  5Design phases 1–7 are built. The Mac app is released as a notarized DMG and a Homebrew
  6cask, with Sparkle updates; a second, sandboxed build is on the Mac App Store (see /Mac
  7App Store build/). The iOS and watchOS apps build from the Xcode project
  8for the Simulator and for a device signed with your own team, and go to TestFlight and the
  9[[https://apps.apple.com/us/app/orgstar-org-mode-agenda/id6821552018][App Store]] with =scripts/release-ios.sh=. Owed: the M1 Air gate run (issue 2) and the VoiceOver
 10passes on the Mac and iOS (issues 3 and 4).
 11
 12=docs/design.md= is the design; =docs/plans/= has one plan per piece of work.
 13
 14* Build and run
 15
 16Requires macOS 26 and Xcode 27 (Swift 6.2 tools).
 17
 18#+BEGIN_SRC sh
 19scripts/build-app.sh          # builds .build/app/orgstar.app, signed ad hoc
 20open .build/app/orgstar.app
 21#+END_SRC
 22
 23Add a folder with File > Add Folder… (⇧⌘O). ⌘P opens a file by name, ⇧⌘F searches,
 24⇧⌘A shows the agenda. In the editor, TAB on a heading cycles its folding and Shift-TAB
 25cycles the whole file. orgstar opens =.org= files from Finder once the app has been
 26launched.
 27
 28C-c C-v t tangles the file's source blocks into the files their =:tangle= header
 29names, as =org-babel-tangle= does.
 30
 31=org-protocol://capture?template=…&url=…&title=…&body=…= and
 32=org-protocol://store-link?url=…&title=…= links work as in Emacs, so browser
 33bookmarklets written for org-protocol work unchanged. Shortcuts has a "Capture to
 34orgstar" action that files text with a capture template.
 35
 36Settings live in =~/.config/orgstar/config.toml= (orgstar ▸ Edit Config File), with
 37keys in =keymap.toml= and capture templates in =capture.toml= beside it. Settings ▸
 38General ▸ Import from Emacs reads an existing Emacs or Doom configuration.
 39
 40* iOS
 41
 42The iOS app (iOS 26) is the "Orgstar iOS" scheme in =ios/Orgstar.xcodeproj=, with the
 43share and Quick Look extensions. It builds from the package's sources and signs
 44automatically with the team set in the project; choose a device or Simulator and Run.
 45For the Simulator without Xcode:
 46
 47#+BEGIN_SRC sh
 48scripts/build-ios-app.sh      # builds .build/ios-app/orgstar.app
 49xcrun simctl install booted .build/ios-app/orgstar.app
 50#+END_SRC
 51
 52On iOS, orgstar in the share sheet takes a page or text with a template; the app opens
 53its capture sheet with it when it's next active. Shortcuts has the same "Capture to
 54orgstar" action as on the Mac.
 55
 56** In-app purchases
 57
 58=ios/Orgstar.storekit= is the StoreKit configuration the "Orgstar iOS" and "Orgstar macOS"
 59schemes run with, so purchases work in Xcode without App Store Connect. It holds orgstar+
 60(=sh.krz.orgstar.pro.monthly=, =.yearly=, =.lifetime=) and the consumable tips
 61(=sh.krz.orgstar.tip.small=, =.medium=, =.large=, at 0.99, 2.99 and 4.99). Tips unlock
 62nothing. On iOS they are in Settings ▸ About orgstar ▸ Support Development, and in the Mac App
 63Store build in Settings ▸ orgstar+, below the plans. The Developer ID Mac app has no StoreKit
 64and no tips; orgstar+ there comes with a license key (see /Mac licenses/).
 65
 66The Mac App Store build has the iOS app's bundle ID, =sh.krz.orgstar=, as a Universal
 67Purchase, so it sells the same products at the same prices and a purchase on one platform
 68unlocks the other. Nobody is grandfathered in the Mac App Store build: =ProStore.grandfathers=
 69is true only on iOS.
 70
 71In App Store Connect, create each tip as a Consumable with the exact product ID, a display
 72name and description in every localization the app has (de, fr, ja, es-ES, pt-BR), a price
 73and availability, and a review screenshot of the About screen's Support Development section.
 74Submit new in-app purchases with an app version. Changes take up to an hour to reach the
 75sandbox; test there with a Sandbox Apple Account (Settings ▸ Developer on the device).
 76
 77* Mac App Store build
 78
 79The "Orgstar macOS" scheme in =ios/Orgstar.xcodeproj= builds the Mac app for the Mac App
 80Store: the same =Sources/Orgstar= with the =APPSTORE= compilation condition, sandboxed, with
 81the widgets, Quick Look and Spotlight extensions, and without Sparkle or the =OrgPrograms=
 82target. =ios/OrgstarMac= has its =Info.plist=, entitlements and privacy manifest. Choose My Mac
 83and Run; it signs with the team set in the project.
 84
 85=APPSTORE= is set only by the Xcode targets, so =swift build= and =scripts/build-app.sh= build
 86the Developer ID app exactly as before. Within the shared packages, the sandbox is detected at
 87run time (=Sandbox.isActive=). The manual's Install page lists what the App Store build does
 88differently.
 89
 90The sandboxed app keeps its data in =~/Library/Containers/sh.krz.orgstar/=, and the widgets'
 91data in =~/Library/Group Containers/group.sh.krz.orgstar/=. A development build and a Mac App
 92Store install share them, as they share the bundle ID. Keep the Developer ID app out of the way
 93while testing, since Finder, Quick Look, Spotlight and URL handlers bind to one copy.
 94
 95** Mac screenshots
 96
 97App Store Connect takes Mac screenshots at 1280x800, 1440x900, 2560x1600 or 2880x1800 pixels.
 98The set lives in =ios/AppStore/screenshots/mac/=, at 2880x1800: window captures centred on a
 99radial gradient. To take one on a Retina display:
100
1011. Run the "Orgstar macOS" scheme. Remove other folders from its sidebar and add
102   =ios/AppStore/demo= with File ▸ Add Folder….
1032. Set up each shot, then run =screencapture -o -w raw.png= and click the window.
1043. Put it on the background, scaled to fit 2640x1640, with no alpha channel:
105   #+BEGIN_SRC sh
106   magick -size 2880x1800 radial-gradient:'#56722c-#182109' bg.png
107   magick raw.png -resize '2640x1640>' win.png
108   magick bg.png win.png -gravity center -composite -background '#182109' -alpha remove -alpha off \
109       ios/AppStore/screenshots/mac/NN-name.png
110   #+END_SRC
111
112The demo's dates are around Friday 16 October 2026; in the agenda, Go to Date shows that week.
113The set has four shots: =01-editor= (=work.org=, with the sidebar showing), =02-agenda= (the
114week), =03-table= (=home.org= and its table) and =04-capture= (the capture window with a
115template). Show nothing the App Store build leaves out: no code block results from languages
116other than Emacs Lisp, no Emacs exports, no license key form and no update settings.
117
118The Developer ID app can render each window itself instead: =ORGSTAR_SNAPSHOT= (see
119=Sources/Orgstar/DevelopmentHooks.swift=) writes the window as the window server draws it, so
120=raw.png= needs no screen-recording permission. Run a copy with its own bundle ID and
121=ORGSTAR_DATA_DIR=, =ORGSTAR_CONFIG_DIR= and =ORGSTAR_ROOT= pointing at throwaway folders.
122
123** Screenshot languages
124
125Shots are light, with the clock at Friday 16 October 2026 09:41 and =body-font = "system"=
126in =config.toml=. English sets are in
127=ios/AppStore/screenshots/<device>/=; German sets are in =ios/AppStore/screenshots/de/<device>/=,
128at the same sizes, taken from =ios/AppStore/demo-de= with the app in German. Nothing uploads
129them: in App Store Connect, open the version's German localization and drop each set into its
130device's media slot. The 6.9" iPhone sets are the 6.3" shots scaled to 1320x2868.
131
132* Mac licenses
133
134orgstar+ for Mac comes with GitHub Sponsors: $60 once for a key that doesn't expire, or $5 a
135month for a key that expires after 40 days and that the app renews daily from 30 days before.
136=packaging/license-issuer= is the Cloudflare Worker that serves =krz.sh/apps/orgstar/buy=,
137=/license= (Sign in with GitHub, then the key) and =/renew=; its header describes the key
138format.
139
140Setup, once:
141- In GitHub Sponsors, publish a $60 one-time tier and a $5 monthly tier.
142- Create a GitHub OAuth app with the callback URL =https://krz.sh/apps/orgstar/license= and
143  put its client ID in =GITHUB_CLIENT_ID= in =wrangler.toml=.
144- =npx wrangler secret put GITHUB_CLIENT_SECRET= with the OAuth app's secret, and
145  =GITHUB_TOKEN= with a classic token of an owner of the krz-labs organization (=read:org=,
146  =read:user=), which renewals use to list its sponsors.
147- =packaging/license-issuer/keygen.sh= set =LICENSE_PRIVATE_KEY= and the app's public key.
148  Running it again invalidates every key issued so far.
149
150=node --test packaging/license-issuer= runs the Worker's tests; =npx wrangler deploy= from
151that folder publishes it.
152
153* Tests
154
155#+BEGIN_SRC sh
156swift test                                                 # all tests
157ORGSTAR_GATES=1 swift test -c release --filter GateTests   # performance gates
158#+END_SRC
159
160Randomised tests use a fixed seed and print it when they fail. =ORGSTAR_SEED=<n> swift test=
161runs them with another; the incremental-parse and restyle fuzz tests read =ORGSTAR_FUZZ_SEED= instead.
162
163=swift test= covers the Developer ID build. =APPSTORE= is set only in the Xcode targets, so
164also check that the App Store build and the iOS app compile:
165
166#+BEGIN_SRC sh
167xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar macOS' -destination 'generic/platform=macOS' \
168    -derivedDataPath .build/xcode CODE_SIGNING_ALLOWED=NO build
169xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar iOS' -destination 'generic/platform=iOS Simulator' \
170    -derivedDataPath .build/xcode build
171#+END_SRC
172
173There is no CI; run these before committing.
174
175* Release
176
177=scripts/release-mac.sh <version>= builds a universal app, signs it with the
178keychain's Developer ID, notarizes a DMG, tags =v<version>=, uploads the DMG to the
179gitbay release and updates the cask in krz/homebrew-tap.
180
181=scripts/build-app.sh= strips the executables and copies their dSYMs to =.build/app/dSYMs=;
182the release zips them to =.build/release/orgstar-<version>-dSYMs.zip= and doesn't upload
183them. Keep the zip to symbolicate that release's crash reports.
184
185Set =ORGSTAR_NOTES= to an HTML file of release notes for the appcast, which Sparkle's
186update window shows, and =ORGSTAR_RELEASE_NOTES= to a Markdown file for the gitbay
187release. Without them both get the one-line platform note.
188
189Each release goes out on three channels, in this order, from the same commit:
190
1911. =scripts/release-mac.sh <version>=, the Developer ID app.
1922. =scripts/release-ios.sh=, the iOS app.
1933. =scripts/release-macos.sh=, the Mac App Store app.
194
195Each of them runs the performance gates (=ORGSTAR_GATES=1 swift test -c release --filter GateTests=)
196before it builds anything for signing, and stops if one misses. Run releases on a Mac that is
197otherwise idle, since the gates measure time.
198
199The App Store builds take their version from =MARKETING_VERSION= in =ios/Orgstar.xcodeproj=,
200which every target shares and appstore-kit requires to be the same across them. Set it to
201=<version>= before the release.
202
203=scripts/release-ios.sh= archives the =Orgstar iOS= scheme, with its extensions and the
204watch app, and uploads it to App Store Connect for TestFlight. It signs automatically with the
205team's distribution certificate through the Apple ID signed in to Xcode (Xcode ▸ Settings ▸
206Accounts), so it needs no key of its own. The version is the project's =MARKETING_VERSION=;
207the build number is the commit count, as the Mac's is, so each upload needs a new commit.
208=ORGSTAR_PUBLISH=0= archives and exports the =.ipa= to =.build/ios-release= without uploading.
209The script sources =release-ios.sh= from appstore-kit, checked out beside this repository or
210at =$APPSTORE_KIT=.
211
212=scripts/release-macos.sh= does the same for the =Orgstar macOS= scheme, with appstore-kit's
213=platform=macos=, and uploads a =.pkg=. Before archiving it checks that the scheme has
214=APPSTORE= and the bundle ID =sh.krz.orgstar= and that no entitlements file has a temporary
215exception. Before exporting it checks the archive: no Sparkle, no =SU*= keys in =Info.plist=, no
216=NSTask= or =posix_spawn= in any executable, and no temporary-exception entitlements.
217It doesn't check provisioning profiles: the archive is signed for development, which gives
218extensions without capabilities none, and the export signs every bundle again.
219=ORGSTAR_PUBLISH=0= exports the =.pkg= to =.build/macos-release= without uploading.
220
221The macOS listing, review notes and TestFlight information are in =ios/AppStore/metadata.md=.
222
223* App Store header
224
225=ios/AppStore/header.conf= sets the product page header's background and screenshots;
226appstore-kit's =render-header.sh ios/AppStore= renders it.
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form