Installing and sharing
lint, build, installing, updating, and automation with Shortcuts.
Check
npm run lint # adanotch lintadanotch lint looks at:
- Whether
manifest.jsonmatches the schema and themainfile exists. - Bundle size (an error over 4 MB, a warning when it's large).
- Whether the bundle calls
AdanotchKit.activity. - APIs your code seems to use without asking for their permission.
- Domains in your code without a
network:permission. - Permissions you ask for but don't use.
- Whether
adanotch/matches your installed Adanotch.
Package
npm run build && npm run package # adanotch buildThe result is a <name>-<version>.adanotchext file in the extension folder (e.g. weather-0.1.0.adanotchext). Choose where it goes with --out:
adanotch build . --out ~/Desktop/weather.adanotchextPackaging runs lint first; with errors, no package is made.
Install
Choose the folder or the .adanotchext file in Settings › Extensions › Install extension….
- Adanotch copies the extension into its own library; it keeps working if you delete the source folder.
- Installing shows the list of permissions and asks for your approval.
- Installing a new version with the same
idreplaces the old one; storage and secrets are kept. If the new version asks for new permissions, you're asked again. - Removing it (Settings › Extensions › the extension › Remove…) also deletes its storage and its secrets in the Keychain.
Only install extensions you trust
Extensions run in a sandboxed process and can only use the permissions you approve; still, they can send data to the domains you approve. Don't install .adanotchext files from people you don't know.
While developing
adanotch dev loads your folder directly, instead of an installed copy, and reloads it on every save. Details: CLI.
Automation with Shortcuts
To send a command to an installed extension:
adanotch ext local.you.pomodoro start 25In the Shortcuts app, the Open URLs action does the same:
adanotch://ext/local.you.pomodoro/start?data=25Your extension gets it as a command event. Events and timers
When Adanotch updates
The three parts of an extension take an update differently:
| Part | What happens |
|---|---|
| The runtime that runs the extension | Lives inside Adanotch; when Adanotch updates, installed extensions run on the new runtime. No rebuild needed. |
The adanotch/ folder (types, schema, test kit, the runtime tests use) | Refreshed with adanotch init --types. |
Your own files (src/, test/, manifest.json, package.json, tsconfig.json) | Never touched. To take a change from the template, apply it by hand from the release notes. |
To see new APIs in your editor and tests, in the extension folder:
adanotch init --typesThis only writes the adanotch/ folder, and records the Adanotch version it came from in adanotch/VERSION.
When adanotch/ doesn't match your installed Adanotch, adanotch dev and adanotch lint tell you:
⚠ adanotch/ (types, test kit, runtime) is from Adanotch 0.6.0; this is 0.7.0. Update it: adanotch init --typesGetting a type error? Check this first
If an example from these docs gives a type error in your folder, adanotch/ is most likely from an older version. Run adanotch init --types, then npm run typecheck.