Getting started
Turn on developer mode, create an extension from the template and see it update in the island as you save.
Requirements
- Adanotch (the version these docs describe or newer)
- Node.js 22.18 or later (tests run
.tsfiles directly) and npm - An editor; VS Code picks up completions from
adanotch/adanotch.d.ts
Turn on developer mode
In Adanotch › Settings › Developer, turn on Developer mode. The Terminal command › Install button on the same page installs the adanotch command into /usr/local/bin.
adanotch --helpCreate the extension
adanotch init weather --name "Weather"
cd weather
npm installinit writes a working example extension, its tests, the type definitions and the manifest schema. It picks an ID (local.<you>.weather) for you; pass --id to choose your own.
Start the development loop
Open two terminals:
npm run watch # rebuilds dist/index.js as src/ changesadanotch dev # loads the extension into Adanotch, reloads it on every save, prints its consoleChange src/index.ts and save; the island updates within a few hundred milliseconds. Errors show their source line, like src/index.ts:12:5.
Install it
When you're done, choose the folder, or the .adanotchext file adanotch build makes, in Settings › Extensions › Install extension…. Adanotch copies the extension into its own library, asks you to approve its permissions, and loads it on every launch.
The folder
| File | What it's for |
|---|---|
manifest.json | ID, permissions, refresh rate, settings. Manifest |
src/index.ts | Your extension's code |
test/index.test.ts | Tests that run in Node. Testing |
dist/index.js | The built script; this is what Adanotch runs |
adanotch/ | API types, manifest schema, test kit and runtime |
icon.png | Optional icon |
Don't edit the adanotch/ folder
This folder belongs to your Adanotch version. When you update Adanotch, refresh it with adanotch init --types; your own code isn't touched.
npm scripts
| Script | What it does |
|---|---|
npm run build | Builds dist/index.js with esbuild (with a source map) |
npm run watch | Rebuilds as you save |
npm test | Runs the tests on Adanotch's own runtime |
npm run typecheck | Type-checks the source and the tests |
npm run lint | adanotch lint: manifest, permissions, missing network: domains |
npm run package | adanotch build: a shareable .adanotchext |
Next: read Lifecycle to see when your code runs.