This is fascinating, thanks for posting. I’ve been trying to find the right solution for syncing as iCloud can be really unstable, especially when syncing the same file between 2 devices (I made a time tracker that uses a txt file as datastore, and have accidentally wiped the day’s data when using on iPad & iPhone). I’ll think about your GitHub download option and see if it makes sense for me.
On the main topic, I recently completed a setup similar to @schl3ck:
- TypeScript repo w/ a custom Scriptable .d.ts file for proper typing of Scriptable APIs
- Rollup.js to compile TS to JS directly into Scriptable documents folder.
- I also use this to combine and minify files – this was a big improvement in my setup, as I used to use
importModule
extensively and found that often the imported files weren’t yet downloaded, causing the script to fail. Now everything’s compiled into a single package, so it’s either all there or none of it is.
- Another cool side effect of rollup is the graph plugin – every time I compile, it updates a
.dot
file with a dependency graph of all my files.
This new setup has seriously been a game changer for my workflow – files don’t compile if there are type errors, so it’s much rare for me to get broken scripts now. Having typings for all the Scriptable APIs is really convenient, and I’m able to really break down my files into granular components without worrying about the iCloud issues.
I’d like to write a post about this at some point, it’s just tough to find the time. Happy to share more details/my config & type files if requested.
Edit: lol nvm, your typing is waaay cleaner than mine, nice work getting all the text documentation in as comments as well. In reading through I saw the up-to-date JSON version of docs that Simon shared, bookmarked that for later.