Skip to content

Commit badd2f9

Browse files
authored
refactor: manifest imports (#144)
1 parent e7a1486 commit badd2f9

36 files changed

Lines changed: 1277 additions & 444 deletions

apps/dev-playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@types/react-syntax-highlighter": "^15.5.13",
3838
"@vitejs/plugin-react": "^5.0.4",
3939
"dotenv": "^16.0.0",
40-
"tsdown": "^0.15.7",
40+
"tsdown": "^0.20.3",
4141
"tsx": "^4.20.6",
4242
"vite": "npm:rolldown-vite@7.1.14"
4343
},

docs/docs/development/project-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The AppKit `server()` plugin automatically serves:
6363
"@types/react": "^19.0.0",
6464
"@types/react-dom": "^19.0.0",
6565
"@vitejs/plugin-react": "^5.1.1",
66-
"tsdown": "^0.15.7",
66+
"tsdown": "^0.20.3",
6767
"tsx": "^4.19.0",
6868
"typescript": "~5.6.0",
6969
"vite": "^7.2.4"

docs/docs/plugins/plugin-management.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ sidebar_position: 6
66

77
AppKit includes a CLI for managing plugins. All commands are available under `npx @databricks/appkit plugin`.
88

9+
**Manifest convention:** `manifest.json` is the default and recommended format for CLI commands (`sync`, `list`, `validate`). For zero-trust safety, JS manifests (`manifest.js`/`manifest.cjs`) are ignored unless you pass `--allow-js-manifest`, which executes plugin code and should be used only with trusted sources. The **add-resource** command only edits `manifest.json` in place.
10+
911
## Create a plugin
1012

1113
Scaffold a new plugin interactively:
@@ -20,7 +22,7 @@ The wizard walks you through:
2022
- **Resources**: Which Databricks resources the plugin needs (SQL Warehouse, Secret, etc.) and whether each is required or optional
2123
- **Optional fields**: Author, version, license
2224

23-
The command generates a complete plugin scaffold with `manifest.json`, TypeScript class, and barrel exports — ready to register in your app.
25+
The command generates a complete plugin scaffold with `manifest.json` and a TypeScript plugin class that imports the manifest directly — ready to register in your app.
2426

2527
## Sync plugin manifests
2628

@@ -32,6 +34,12 @@ npx @databricks/appkit plugin sync --write
3234

3335
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.
3436

37+
Trusted installed Databricks packages (for example `@databricks/appkit`) are allowed to load bundled JS manifests during `plugin sync`. For other sources, if you intentionally rely on JS manifests, opt in explicitly:
38+
39+
```bash
40+
npx @databricks/appkit plugin sync --write --allow-js-manifest
41+
```
42+
3543
Use the `--silent` flag in build hooks to suppress output:
3644

3745
```json
@@ -58,6 +66,8 @@ npx @databricks/appkit plugin validate plugins/my-plugin appkit.plugins.json
5866

5967
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.
6068

69+
To include JS manifests in validation, pass `--allow-js-manifest`.
70+
6171
## List plugins
6272

6373
View registered plugins from `appkit.plugins.json` or scan a directory:
@@ -69,13 +79,16 @@ npx @databricks/appkit plugin list
6979
# Scan a directory for plugin folders
7080
npx @databricks/appkit plugin list --dir plugins/
7181

82+
# Scan a directory and include JS manifests (trusted code only)
83+
npx @databricks/appkit plugin list --dir plugins/ --allow-js-manifest
84+
7285
# JSON output for scripting
7386
npx @databricks/appkit plugin list --json
7487
```
7588

7689
## Add a resource to a plugin
7790

78-
Interactively add a new resource requirement to an existing plugin manifest:
91+
Interactively add a new resource requirement to an existing plugin manifest. **Requires `manifest.json`** in the plugin directory (the command edits it in place; it does not modify `manifest.js`):
7992

8093
```bash
8194
npx @databricks/appkit plugin add-resource

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"plop": "^4.0.4",
6363
"publint": "^0.3.15",
6464
"release-it": "^19.1.0",
65-
"tsdown": "^0.15.7",
65+
"tsdown": "^0.20.3",
6666
"tsx": "^4.20.6",
6767
"turbo": "^2.6.1",
6868
"typescript": "^5.6.0",

packages/appkit-ui/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@databricks/appkit-ui",
33
"type": "module",
44
"version": "0.15.0",
5+
"license": "Apache-2.0",
56
"repository": {
67
"type": "git",
78
"url": "git+https://github.com/databricks/appkit.git"
@@ -14,6 +15,7 @@
1415
"docs",
1516
"docs.md",
1617
"CLAUDE.md",
18+
"LICENSE",
1719
"llms.txt",
1820
"README.md",
1921
"DCO",

packages/appkit-ui/tsdown.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ export default defineConfig([
99
platform: "browser",
1010
minify: false,
1111
dts: {
12-
resolve: true,
12+
resolver: "oxc",
1313
},
1414
copy: [
1515
{
1616
from: "src/react/styles/globals.css",
17-
to: "dist/styles.css",
17+
to: "dist",
18+
rename: "styles.css",
1819
},
1920
],
2021
clean: false,

packages/appkit/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
77
"packageManager": "pnpm@10.21.0",
8+
"license": "Apache-2.0",
89
"repository": {
910
"type": "git",
1011
"url": "git+https://github.com/databricks/appkit.git"
@@ -16,6 +17,7 @@
1617
"docs",
1718
"docs.md",
1819
"CLAUDE.md",
20+
"LICENSE",
1921
"llms.txt",
2022
"README.md",
2123
"DCO",

packages/appkit/src/connectors/lakebase/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
createLakebasePool as createLakebasePoolBase,
33
type LakebasePoolConfig,
44
} from "@databricks/lakebase";
5-
import type pg from "pg";
5+
import type { Pool } from "pg";
66
import { createLogger } from "@/logging/logger";
77

88
/**
@@ -12,9 +12,7 @@ import { createLogger } from "@/logging/logger";
1212
* @param config - Lakebase pool configuration
1313
* @returns PostgreSQL pool with appkit integration
1414
*/
15-
export function createLakebasePool(
16-
config?: Partial<LakebasePoolConfig>,
17-
): pg.Pool {
15+
export function createLakebasePool(config?: Partial<LakebasePoolConfig>): Pool {
1816
const logger = createLogger("connectors:lakebase");
1917

2018
return createLakebasePoolBase({

packages/appkit/src/plugins/analytics/analytics.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ import {
1414
} from "../../context";
1515
import { createLogger } from "../../logging/logger";
1616
import { Plugin, toPlugin } from "../../plugin";
17+
import type { PluginManifest } from "../../registry";
1718
import { queryDefaults } from "./defaults";
18-
import { analyticsManifest } from "./manifest";
19+
import manifest from "./manifest.json";
1920
import { QueryProcessor } from "./query";
2021
import type {
2122
AnalyticsQueryResponse,
@@ -29,7 +30,7 @@ export class AnalyticsPlugin extends Plugin {
2930
name = "analytics";
3031

3132
/** Plugin manifest declaring metadata and resource requirements */
32-
static manifest = analyticsManifest;
33+
static manifest = manifest as PluginManifest;
3334

3435
protected static description = "Analytics plugin for data analysis";
3536
protected declare config: IAnalyticsConfig;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export * from "./analytics";
2-
export * from "./manifest";
32
export * from "./types";

0 commit comments

Comments
 (0)