CONTRIBUTING.org

v1.1.1
orgstar/CONTRIBUTING.org rendered · source · history · blame · raw

212 lines · 11496 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 for the Mac App Store is not yet
  7released (see /Mac App 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
 95Not yet done before the first submission:
 96- A smoke test of a signed, sandboxed build: Grant Access… for includes, setup files, tangle
 97  and export targets, images, capture, archive and dailies outside the folders (including a
 98  picked folder that doesn't contain the one asked for); Can't Open and regranting a folder;
 99  files opened from Finder coming back after a relaunch and after a force quit; the
100  configuration folder after a relaunch; =:shebang= tangling setting the mode; Save Elsewhere…
101  for exports; the Import from Emacs pickers; the welcome sheet's iCloud Drive folder.
102- The Mac screenshots (below).
103- The TestFlight group for the Mac app, in App Store Connect.
104- Installing each Mac version over the other, with the results in the manual's Install page.
105
106** Mac screenshots
107
108App Store Connect takes Mac screenshots at 1280x800, 1440x900, 2560x1600 or 2880x1800 pixels.
109The set lives in =ios/AppStore/screenshots/mac/=; the =01-editor.png= there now is 2560x1720
110and is not accepted, so replace it. To take a 2880x1800 set on a Retina display:
111
1121. Run the "Orgstar macOS" scheme. Remove other folders from its sidebar and add
113   =ios/AppStore/demo= with File ▸ Add Folder….
1142. Size the main window to 1440 by 900 points (Terminal needs Accessibility access in System
115   Settings ▸ Privacy & Security):
116   #+BEGIN_SRC sh
117   osascript -e 'tell application "System Events" to tell process "orgstar" to set size of front window to {1440, 900}'
118   #+END_SRC
1193. Set up each shot, then run =screencapture -i -w -o ios/AppStore/screenshots/mac/NN-name.png=
120   and click the window. =-o= leaves out the shadow.
1214. Check the size with =sips -g pixelWidth -g pixelHeight ios/AppStore/screenshots/mac/*.png=.
122
123The demo's dates are around Friday 16 October 2026; in the agenda, Go to Date shows that week.
124Take five shots: =01-editor= (=work.org=, with the sidebar showing), =02-agenda= (the week),
125=03-board= (the agenda's board as kanban columns), =04-tables= (=home.org= and its table) and
126=05-capture= (the capture window with a template). Show nothing the App Store
127build leaves out: no code block results from languages other than Emacs Lisp, no Emacs exports,
128no license key form and no update settings.
129
130* Mac licenses
131
132orgstar+ for Mac comes with GitHub Sponsors: $60 once for a key that doesn't expire, or $5 a
133month for a key that expires after 40 days and that the app renews daily from 30 days before.
134=packaging/license-issuer= is the Cloudflare Worker that serves =krz.sh/apps/orgstar/buy=,
135=/license= (Sign in with GitHub, then the key) and =/renew=; its header describes the key
136format.
137
138Setup, once:
139- In GitHub Sponsors, publish a $60 one-time tier and a $5 monthly tier.
140- Create a GitHub OAuth app with the callback URL =https://krz.sh/apps/orgstar/license= and
141  put its client ID in =GITHUB_CLIENT_ID= in =wrangler.toml=.
142- =npx wrangler secret put GITHUB_CLIENT_SECRET= with the OAuth app's secret, and
143  =GITHUB_TOKEN= with a classic token of an owner of the krazywarez organization (=read:org=,
144  =read:user=), which renewals use to list its sponsors.
145- =packaging/license-issuer/keygen.sh= set =LICENSE_PRIVATE_KEY= and the app's public key.
146  Running it again invalidates every key issued so far.
147
148=node --test packaging/license-issuer= runs the Worker's tests; =npx wrangler deploy= from
149that folder publishes it.
150
151* Tests
152
153#+BEGIN_SRC sh
154swift test                                                 # all tests
155ORGSTAR_GATES=1 swift test -c release --filter GateTests   # performance gates
156#+END_SRC
157
158=swift test= covers the Developer ID build. =APPSTORE= is set only in the Xcode targets, so
159also check that the App Store build and the iOS app compile:
160
161#+BEGIN_SRC sh
162xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar macOS' -destination 'generic/platform=macOS' \
163    -derivedDataPath .build/xcode CODE_SIGNING_ALLOWED=NO build
164xcodebuild -project ios/Orgstar.xcodeproj -scheme 'Orgstar iOS' -destination 'generic/platform=iOS Simulator' \
165    -derivedDataPath .build/xcode build
166#+END_SRC
167
168There is no CI; run these before committing.
169
170* Release
171
172=scripts/release-mac.sh <version>= builds a universal app, signs it with the
173keychain's Developer ID, notarizes a DMG, tags =v<version>=, uploads the DMG to the
174gitbay release and updates the cask in krz/homebrew-tap.
175
176Set =ORGSTAR_NOTES= to an HTML file of release notes for the appcast, which Sparkle's
177update window shows, and =ORGSTAR_RELEASE_NOTES= to a Markdown file for the gitbay
178release. Without them both get the one-line platform note.
179
180Each release goes out on three channels, in this order, from the same commit:
181
1821. =scripts/release-mac.sh <version>=, the Developer ID app.
1832. =scripts/release-ios.sh=, the iOS app.
1843. =scripts/release-macos.sh=, the Mac App Store app.
185
186The App Store builds take their version from =MARKETING_VERSION= in =ios/Orgstar.xcodeproj=,
187which every target shares and appstore-kit requires to be the same across them. Set it to
188=<version>= before the release.
189
190=scripts/release-ios.sh= archives the =Orgstar iOS= scheme, with its extensions and the
191watch app, and uploads it to App Store Connect for TestFlight. It signs automatically with the
192team's distribution certificate through the Apple ID signed in to Xcode (Xcode ▸ Settings ▸
193Accounts), so it needs no key of its own. The version is the project's =MARKETING_VERSION=;
194the build number is the commit count, as the Mac's is, so each upload needs a new commit.
195=ORGSTAR_PUBLISH=0= archives and exports the =.ipa= to =.build/ios-release= without uploading.
196The script sources =release-ios.sh= from appstore-kit, checked out beside this repository or
197at =$APPSTORE_KIT=.
198
199=scripts/release-macos.sh= does the same for the =Orgstar macOS= scheme, with appstore-kit's
200=platform=macos=, and uploads a =.pkg=. Before archiving it checks that the scheme has
201=APPSTORE= and the bundle ID =sh.krz.orgstar= and that no entitlements file has a temporary
202exception. Before exporting it checks the archive: no Sparkle, no =SU*= keys in =Info.plist=, no
203=NSTask= or =posix_spawn= in any executable, no temporary-exception entitlements, and an
204=embedded.provisionprofile= in the app and each extension. =ORGSTAR_PUBLISH=0= exports the
205=.pkg= to =.build/macos-release= without uploading.
206
207The macOS listing, review notes and TestFlight information are in =ios/AppStore/metadata.md=.
208
209* App Store header
210
211=ios/AppStore/header.conf= sets the product page header's background and screenshots;
212appstore-kit's =render-header.sh ios/AppStore= renders it.