Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Then load it in the app:
| `manifest.json` | id, permissions, and a `contributes.configuration` setting the host renders |
| `src/index.tsx` | the `register` entry point and its cleanup function |
| `src/Panel.tsx` | the right-panel component |
| `types/index.d.ts` | generated `PluginAPI` types — see below |
| `scripts/check-externals.mjs` | fails the build if you import something the host can't provide |

## The build flags are not optional
Expand All @@ -53,10 +52,16 @@ trusting a copy here, so it also catches the host changing the contract.

## Types

`types/index.d.ts` is generated from `src/plugins/api.ts` in the Voltius repo by
`scripts/gen-plugin-types.mjs` there. To refresh it against a newer release, re-run that script
and replace the file. `tsconfig.json` maps it to the `@voltius/plugin-types` specifier the docs
use.
`PluginAPI` comes from the [`@voltius/plugin-types`](https://www.npmjs.com/package/@voltius/plugin-types)
dev dependency:

```sh
npm install --save-dev @voltius/plugin-types
```

Its version tracks the app, so `@voltius/plugin-types@0.15.0` is the API Voltius 0.15.0 exposes —
install the one matching the oldest release you support, and keep `minAppVersion` in
`manifest.json` in step. One install also covers the `@voltius/ui` types.

## Docs

Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
"check": "node scripts/check-externals.mjs"
},
"devDependencies": {
"@types/react": "^19.0.0",
"@voltius/plugin-types": "^0.15.0",
"esbuild": "^0.25.0",
"typescript": "^5.6.0",
"@types/react": "^19.0.0"
"typescript": "^5.6.0"
}
}
9 changes: 2 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@
"jsx": "react-jsx",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@voltius/plugin-types": ["./types/index.d.ts"],
"@voltius/ui": ["./types/voltius-ui.d.ts"]
}
"skipLibCheck": true
},
"include": ["src", "types"]
"include": ["src"]
}
Loading
Loading