You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,3 +112,24 @@ pnpm docs:serve # Serve built docs
112
112
```
113
113
114
114
See [docs/README.md](./docs/README.md) for more details.
115
+
116
+
## Adding or changing a resource type
117
+
118
+
Resource types and their permissions are defined once in the plugin-manifest schema; the CLI (create, add-resource, validate) and the appkit registry types are derived from it.
119
+
120
+
To add or change a resource type:
121
+
122
+
1.**Edit the schema** – `packages/shared/src/schemas/plugin-manifest.schema.json`:
123
+
- Add the value to `$defs.resourceType.enum`.
124
+
- Add a permission definition (e.g. `$defs.myResourcePermission`) with an `enum` array; list permissions **weakest to strongest** (this order is used for merge/escalation).
125
+
- In `$defs.resourceRequirement.allOf`, add a branch with `if.properties.type.const` set to the new type and `then.properties.permission.$ref` pointing at that permission def (e.g. `#/$defs/myResourcePermission`).
126
+
127
+
2.**Regenerate registry types** – from the repo root:
128
+
```bash
129
+
pnpm exec tsx tools/generate-registry-types.ts
130
+
```
131
+
This updates `packages/appkit/src/registry/types.generated.ts`. The appkit build runs this automatically before compiling.
132
+
133
+
3.**Optional:** Add default fields for the new type in `packages/shared/src/cli/commands/plugin/create/resource-defaults.ts` (`DEFAULT_FIELDS_BY_TYPE`) so the plugin create/add-resource prompts suggest env vars.
134
+
135
+
For more context and alternative approaches, see [Registry types from schema](./docs/docs/development/registry-types-from-schema.md).
Copy file name to clipboardExpand all lines: docs/docs/api/appkit/index.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ plugin architecture, and React integration.
8
8
| Enumeration | Description |
9
9
| ------ | ------ |
10
10
|[RequestedClaimsPermissionSet](Enumeration.RequestedClaimsPermissionSet.md)| Permission set for Unity Catalog table access |
11
-
|[ResourceType](Enumeration.ResourceType.md)|Supported resource types that plugins can depend on. Each type has its own set of valid permissions.|
11
+
|[ResourceType](Enumeration.ResourceType.md)|Resource types from schema $defs.resourceType.enum|
12
12
13
13
## Classes
14
14
@@ -53,6 +53,7 @@ plugin architecture, and React integration.
53
53
|[ConfigSchema](TypeAlias.ConfigSchema.md)| Configuration schema definition for plugin config. Re-exported from the standard JSON Schema Draft 7 types. |
54
54
|[IAppRouter](TypeAlias.IAppRouter.md)| Express router type for plugin route registration |
55
55
|[ResourcePermission](TypeAlias.ResourcePermission.md)| Union of all possible permission levels across all resource types. |
For complete configuration options, see [`createApp`](api/appkit/Function.createApp.md).
207
207
208
+
## Plugin management
209
+
210
+
AppKit includes a CLI for managing plugins. All commands are available under `npx @databricks/appkit plugin`.
211
+
212
+
### Create a plugin
213
+
214
+
Scaffold a new plugin interactively:
215
+
216
+
```bash
217
+
npx @databricks/appkit plugin create
218
+
```
219
+
220
+
The wizard walks you through:
221
+
-**Placement**: In your repository (e.g. `plugins/my-plugin`) or as a standalone package
222
+
-**Metadata**: Name, display name, description
223
+
-**Resources**: Which Databricks resources the plugin needs (SQL Warehouse, Secret, etc.) and whether each is required or optional
224
+
-**Optional fields**: Author, version, license
225
+
226
+
The command generates a complete plugin scaffold with `manifest.json`, TypeScript class, and barrel exports — ready to register in your app.
227
+
228
+
### Sync plugin manifests
229
+
230
+
Scan your project for plugins and generate `appkit.plugins.json`:
231
+
232
+
```bash
233
+
npx @databricks/appkit plugin sync --write
234
+
```
235
+
236
+
This discovers plugin manifests from installed packages and local imports, then writes a consolidated manifest used by deployment tooling. Plugins referenced in your `createApp({ plugins: [...] })` call are automatically marked as required.
237
+
238
+
Use the `--silent` flag in build hooks to suppress output:
The validator auto-detects whether a file is a plugin manifest or a template manifest (from `$schema`) and reports errors with humanized paths and expected values.
263
+
264
+
### List plugins
265
+
266
+
View registered plugins from `appkit.plugins.json` or scan a directory:
267
+
268
+
```bash
269
+
# From appkit.plugins.json (default)
270
+
npx @databricks/appkit plugin list
271
+
272
+
# Scan a directory for plugin folders
273
+
npx @databricks/appkit plugin list --dir plugins/
274
+
275
+
# JSON output for scripting
276
+
npx @databricks/appkit plugin list --json
277
+
```
278
+
279
+
### Add a resource to a plugin
280
+
281
+
Interactively add a new resource requirement to an existing plugin manifest:
0 commit comments