Skip to content

Commit ebbc3fb

Browse files
committed
docs: expand custom add-on authoring guide
1 parent 7095f4a commit ebbc3fb

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

docs/creating-add-ons.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ title: Creating Add-ons
55

66
Add-ons add files, dependencies, and code hooks to generated projects.
77

8+
Use this guide when you want to build and maintain your own add-on outside the built-in catalog.
9+
810
## Quick Start
911

1012
```bash
@@ -41,6 +43,12 @@ tanstack create test --add-ons http://localhost:9080/info.json
4143
└── routes/demo/my-feature.tsx
4244
```
4345

46+
Generated source of truth files in your project root:
47+
48+
- `.add-on/info.json` - add-on metadata and integration config
49+
- `.add-on/package.json` - dependency/script additions merged into generated apps
50+
- `.add-on/assets/**` - template files copied into target apps
51+
4452
## info.json
4553

4654
Required fields:
@@ -169,3 +177,40 @@ Host on GitHub, npm, or any URL:
169177
```bash
170178
tanstack create my-app --add-ons https://example.com/my-addon/info.json
171179
```
180+
181+
### Local Iteration Loop
182+
183+
Fastest way to iterate on a custom add-on:
184+
185+
```bash
186+
# in your add-on project
187+
tanstack add-on compile
188+
npx serve .add-on -l 9080
189+
190+
# in another terminal
191+
tanstack create test-app --add-ons http://localhost:9080/info.json
192+
```
193+
194+
### Publishing Tips
195+
196+
- Keep add-on source in git (not just compiled output).
197+
- Re-run `tanstack add-on compile` after each metadata/template change.
198+
- Publish `.add-on` contents to a stable URL.
199+
- Prefer immutable/versioned URLs for production use.
200+
201+
## Maintenance Checklist
202+
203+
When you update a custom add-on:
204+
205+
1. Update templates or metadata in your source project.
206+
2. Re-run `tanstack add-on compile`.
207+
3. Test with a clean scaffold (`tanstack create ... --add-ons <url>`).
208+
4. Verify install/build/lint in the generated app.
209+
5. Publish updated `.add-on` assets.
210+
211+
## Troubleshooting
212+
213+
- **Add-on not found**: Verify URL points directly to `info.json`.
214+
- **Template not applied**: Ensure file is in `.add-on/assets` and ends with `.ejs` if templated.
215+
- **Option not taking effect**: Confirm option key matches `addOnOption['<id>']` usage in template.
216+
- **Integration code not injected**: Check `integrations[].type`, `jsName`, and `path` in `.add-on/info.json`.

0 commit comments

Comments
 (0)