CONTRIBUTING.org

2b4bbb38252d0a3d7b97adde900413f734f0506b
orgstar/CONTRIBUTING.org

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