@databricks/appkit 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1154 -0
- package/CLAUDE.md +1153 -2
- package/bin/setup-claude.js +1 -1
- package/dist/_virtual/rolldown_runtime.js +2 -2
- package/dist/appkit/package.js +1 -1
- package/dist/utils/index.js +2 -2
- package/llms.txt +123 -46
- package/package.json +3 -2
package/bin/setup-claude.js
CHANGED
|
@@ -33,7 +33,7 @@ function findInstalledPackages() {
|
|
|
33
33
|
const installed = [];
|
|
34
34
|
|
|
35
35
|
for (const pkg of PACKAGES) {
|
|
36
|
-
const claudePath = path.join(cwd, "node_modules", pkg.name, "
|
|
36
|
+
const claudePath = path.join(cwd, "node_modules", pkg.name, "package.json");
|
|
37
37
|
if (fs.existsSync(claudePath)) {
|
|
38
38
|
installed.push(pkg);
|
|
39
39
|
}
|
|
@@ -6,7 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
9
|
-
var
|
|
9
|
+
var __exportAll = (all, symbols) => {
|
|
10
10
|
let target = {};
|
|
11
11
|
for (var name in all) {
|
|
12
12
|
__defProp(target, name, {
|
|
@@ -36,4 +36,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
36
36
|
var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
37
|
|
|
38
38
|
//#endregion
|
|
39
|
-
export { __esmMin,
|
|
39
|
+
export { __esmMin, __exportAll, __toCommonJS };
|
package/dist/appkit/package.js
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { __esmMin,
|
|
1
|
+
import { __esmMin, __exportAll } from "../_virtual/rolldown_runtime.js";
|
|
2
2
|
import { databricksClientMiddleware, getRequestContext, getWorkspaceClient, init_databricks_client_middleware } from "./databricks-client-middleware.js";
|
|
3
3
|
import { init_env_validator, validateEnv } from "./env-validator.js";
|
|
4
4
|
import { deepMerge, init_merge } from "./merge.js";
|
|
5
5
|
import { init_vite_config_merge, mergeConfigDedup } from "./vite-config-merge.js";
|
|
6
6
|
|
|
7
7
|
//#region src/utils/index.ts
|
|
8
|
-
var utils_exports = /* @__PURE__ */
|
|
8
|
+
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
9
9
|
databricksClientMiddleware: () => databricksClientMiddleware,
|
|
10
10
|
deepMerge: () => deepMerge,
|
|
11
11
|
getRequestContext: () => getRequestContext,
|
package/llms.txt
CHANGED
|
@@ -75,46 +75,24 @@ Why this layout:
|
|
|
75
75
|
"dev": "NODE_ENV=development tsx watch server/index.ts",
|
|
76
76
|
"build": "npm run build:server && npm run build:client",
|
|
77
77
|
"build:server": "tsdown --out-dir build server/index.ts",
|
|
78
|
-
"build:client": "
|
|
78
|
+
"build:client": "tsc -b && vite build --config client/vite.config.ts",
|
|
79
79
|
"start": "node build/index.mjs"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@databricks/appkit": "^0.
|
|
82
|
+
"@databricks/appkit": "^0.1.2"
|
|
83
|
+
"@databricks/appkit-ui": "^0.1.2",
|
|
84
|
+
"react": "^19.2.3",
|
|
85
|
+
"react-dom": "^19.2.3"
|
|
83
86
|
},
|
|
84
87
|
"devDependencies": {
|
|
85
88
|
"@types/node": "^20.0.0",
|
|
89
|
+
"@types/react": "^19.0.0",
|
|
90
|
+
"@types/react-dom": "^19.0.0",
|
|
91
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
86
92
|
"tsdown": "^0.15.7",
|
|
87
93
|
"tsx": "^4.19.0",
|
|
88
|
-
"typescript": "~5.6.0"
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
### `client/package.json`
|
|
94
|
-
|
|
95
|
-
```json
|
|
96
|
-
{
|
|
97
|
-
"name": "client",
|
|
98
|
-
"private": true,
|
|
99
|
-
"version": "0.0.0",
|
|
100
|
-
"type": "module",
|
|
101
|
-
"scripts": {
|
|
102
|
-
"dev": "vite",
|
|
103
|
-
"build": "vite build",
|
|
104
|
-
"preview": "vite preview"
|
|
105
|
-
},
|
|
106
|
-
"dependencies": {
|
|
107
|
-
"@databricks/appkit-ui": "^0.0.2",
|
|
108
|
-
"react": "^18.0.0",
|
|
109
|
-
"react-dom": "^18.0.0",
|
|
110
|
-
"recharts": "^3.0.0"
|
|
111
|
-
},
|
|
112
|
-
"devDependencies": {
|
|
113
|
-
"@types/react": "^18.0.0",
|
|
114
|
-
"@types/react-dom": "^18.0.0",
|
|
115
|
-
"@vitejs/plugin-react": "^5.0.0",
|
|
116
94
|
"typescript": "~5.6.0",
|
|
117
|
-
"vite": "^
|
|
95
|
+
"vite": "^7.2.4"
|
|
118
96
|
}
|
|
119
97
|
}
|
|
120
98
|
```
|
|
@@ -208,7 +186,6 @@ await createApp({
|
|
|
208
186
|
```bash
|
|
209
187
|
# Install dependencies
|
|
210
188
|
npm install
|
|
211
|
-
cd client && npm install && cd ..
|
|
212
189
|
|
|
213
190
|
# Development (starts backend + Vite dev server)
|
|
214
191
|
npm run dev
|
|
@@ -225,19 +202,14 @@ If you already have a React/Vite app and want to add AppKit:
|
|
|
225
202
|
### 1. Install dependencies
|
|
226
203
|
|
|
227
204
|
```bash
|
|
228
|
-
npm install @databricks/appkit
|
|
229
|
-
npm install -D tsx tsdown
|
|
205
|
+
npm install @databricks/appkit @databricks/appkit-ui react react-dom
|
|
206
|
+
npm install -D tsx tsdown vite @vitejs/plugin-react typescript
|
|
230
207
|
|
|
231
208
|
# If you don't already have a client/ folder, create one and move your Vite app into it:
|
|
232
209
|
# - move index.html -> client/index.html
|
|
233
210
|
# - move vite.config.ts -> client/vite.config.ts
|
|
234
211
|
# - move src/ -> client/src/
|
|
235
212
|
#
|
|
236
|
-
# Then install client deps:
|
|
237
|
-
cd client
|
|
238
|
-
npm install @databricks/appkit-ui react react-dom recharts
|
|
239
|
-
npm install -D vite @vitejs/plugin-react typescript
|
|
240
|
-
cd ..
|
|
241
213
|
```
|
|
242
214
|
|
|
243
215
|
### 2. Create `server/index.ts` (new file)
|
|
@@ -258,7 +230,7 @@ await createApp({
|
|
|
258
230
|
"dev": "NODE_ENV=development tsx watch server/index.ts",
|
|
259
231
|
"build": "npm run build:server && npm run build:client",
|
|
260
232
|
"build:server": "tsdown --out-dir build server/index.ts",
|
|
261
|
-
"build:client": "
|
|
233
|
+
"build:client": "tsc -b && vite build --config client/vite.config.ts",
|
|
262
234
|
"start": "node build/index.mjs"
|
|
263
235
|
}
|
|
264
236
|
}
|
|
@@ -276,7 +248,7 @@ await createApp({
|
|
|
276
248
|
import { createApp, server, analytics } from "@databricks/appkit";
|
|
277
249
|
|
|
278
250
|
await createApp({
|
|
279
|
-
plugins: [server(), analytics(
|
|
251
|
+
plugins: [server(), analytics()],
|
|
280
252
|
});
|
|
281
253
|
```
|
|
282
254
|
|
|
@@ -312,13 +284,17 @@ These are typically **provided by Databricks Apps runtime** (exact set can vary
|
|
|
312
284
|
|
|
313
285
|
For local development, you need to authenticate with Databricks. Options:
|
|
314
286
|
|
|
315
|
-
**Option 1: Databricks CLI
|
|
287
|
+
**Option 1: Databricks CLI Auth (recommended)**
|
|
316
288
|
|
|
317
289
|
```bash
|
|
318
290
|
# Configure once
|
|
319
|
-
databricks
|
|
291
|
+
databricks auth login --host [host] --profile [profile-name]
|
|
292
|
+
|
|
293
|
+
# If you used `DEFAULT` as the profile name then you can just run
|
|
320
294
|
|
|
321
|
-
|
|
295
|
+
`npm run dev`
|
|
296
|
+
|
|
297
|
+
# To run with a specific profile
|
|
322
298
|
DATABRICKS_CONFIG_PROFILE=my-profile npm run dev
|
|
323
299
|
# If your Databricks SDK expects a different variable name, try:
|
|
324
300
|
# DATABRICKS_PROFILE=my-profile npm run dev
|
|
@@ -462,7 +438,7 @@ HTTP endpoints exposed (mounted under `/api/analytics`):
|
|
|
462
438
|
Formats:
|
|
463
439
|
|
|
464
440
|
- `format: "JSON"` (default) returns JSON rows
|
|
465
|
-
- `format: "ARROW"` returns an Arrow “
|
|
441
|
+
- `format: "ARROW"` returns an Arrow “statement_id” payload over SSE, then the client fetches binary Arrow from `/api/analytics/arrow-result/:jobId`
|
|
466
442
|
|
|
467
443
|
### Request context (`getRequestContext()`)
|
|
468
444
|
|
|
@@ -980,6 +956,108 @@ function LoadingCard() {
|
|
|
980
956
|
}
|
|
981
957
|
```
|
|
982
958
|
|
|
959
|
+
## Stylesheet
|
|
960
|
+
|
|
961
|
+
In the main css file import the following
|
|
962
|
+
|
|
963
|
+
```css
|
|
964
|
+
@import "@databricks/appkit-ui/styles.css";
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
That will provide a default theme for the app using css variables.
|
|
968
|
+
|
|
969
|
+
### Customizing theme (light/dark mode)
|
|
970
|
+
|
|
971
|
+
- Full list of variables to customize the theme.
|
|
972
|
+
|
|
973
|
+
```css
|
|
974
|
+
@import "@databricks/appkit-ui/styles.css";
|
|
975
|
+
|
|
976
|
+
:root {
|
|
977
|
+
--radius: 0.625rem;
|
|
978
|
+
--background: oklch(1 0 0);
|
|
979
|
+
--foreground: oklch(0.141 0.005 285.823);
|
|
980
|
+
--card: oklch(1 0 0);
|
|
981
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
|
982
|
+
--popover: oklch(1 0 0);
|
|
983
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
|
984
|
+
--primary: oklch(0.21 0.006 285.885);
|
|
985
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
986
|
+
--secondary: oklch(0.967 0.001 286.375);
|
|
987
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
988
|
+
--muted: oklch(0.967 0.001 286.375);
|
|
989
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
|
990
|
+
--accent: oklch(0.967 0.001 286.375);
|
|
991
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
|
992
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
993
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
994
|
+
--success: oklch(0.603 0.135 166.892);
|
|
995
|
+
--success-foreground: oklch(1 0 0);
|
|
996
|
+
--warning: oklch(0.795 0.157 78.748);
|
|
997
|
+
--warning-foreground: oklch(0.199 0.027 238.732);
|
|
998
|
+
--border: oklch(0.92 0.004 286.32);
|
|
999
|
+
--input: oklch(0.92 0.004 286.32);
|
|
1000
|
+
--ring: oklch(0.705 0.015 286.067);
|
|
1001
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
|
1002
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
|
1003
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
|
1004
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
|
1005
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
|
1006
|
+
--sidebar: oklch(0.985 0 0);
|
|
1007
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
|
1008
|
+
--sidebar-primary: oklch(0.21 0.006 285.885);
|
|
1009
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
1010
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
|
1011
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
|
1012
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
|
1013
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
@media (prefers-color-scheme: dark) {
|
|
1017
|
+
:root {
|
|
1018
|
+
--background: oklch(0.141 0.005 285.823);
|
|
1019
|
+
--foreground: oklch(0.985 0 0);
|
|
1020
|
+
--card: oklch(0.21 0.006 285.885);
|
|
1021
|
+
--card-foreground: oklch(0.985 0 0);
|
|
1022
|
+
--popover: oklch(0.21 0.006 285.885);
|
|
1023
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
1024
|
+
--primary: oklch(0.92 0.004 286.32);
|
|
1025
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
|
1026
|
+
--secondary: oklch(0.274 0.006 286.033);
|
|
1027
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
1028
|
+
--muted: oklch(0.274 0.006 286.033);
|
|
1029
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
|
1030
|
+
--accent: oklch(0.274 0.006 286.033);
|
|
1031
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
1032
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
1033
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
1034
|
+
--success: oklch(0.67 0.12 167);
|
|
1035
|
+
--success-foreground: oklch(1 0 0);
|
|
1036
|
+
--warning: oklch(0.83 0.165 85);
|
|
1037
|
+
--warning-foreground: oklch(0.199 0.027 238.732);
|
|
1038
|
+
--border: oklch(1 0 0 / 10%);
|
|
1039
|
+
--input: oklch(1 0 0 / 15%);
|
|
1040
|
+
--ring: oklch(0.552 0.016 285.938);
|
|
1041
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
|
1042
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
|
1043
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
|
1044
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
|
1045
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
|
1046
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
|
1047
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
|
1048
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
|
1049
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
|
1050
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
|
1051
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
|
1052
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
|
1053
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
```
|
|
1058
|
+
|
|
1059
|
+
- If any variable is changed, it must be changed for both light and dark mode.
|
|
1060
|
+
|
|
983
1061
|
## Type generation (QueryRegistry + IntelliSense)
|
|
984
1062
|
|
|
985
1063
|
Goal: generate `client/src/appKitTypes.d.ts` so query keys, params, and result rows are type-safe.
|
|
@@ -1054,7 +1132,6 @@ env:
|
|
|
1054
1132
|
- `tsx` is in devDependencies for dev server
|
|
1055
1133
|
- `dev` script uses `NODE_ENV=development tsx watch server/index.ts`
|
|
1056
1134
|
- `client/index.html` exists with `<div id="root"></div>` and script pointing to `client/src/main.tsx`
|
|
1057
|
-
- `client/package.json` exists and includes `@databricks/appkit-ui`
|
|
1058
1135
|
|
|
1059
1136
|
- **Backend**
|
|
1060
1137
|
- `await createApp({ plugins: [...] })` is used (or `void createApp` with intent)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/appkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.4",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"packageManager": "pnpm@10.21.0",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"scripts",
|
|
16
16
|
"CLAUDE.md",
|
|
17
17
|
"llms.txt",
|
|
18
|
+
"AGENTS.md",
|
|
18
19
|
"README.md",
|
|
19
20
|
"DCO",
|
|
20
21
|
"NOTICE.md"
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"clean:full": "rm -rf dist node_modules tmp",
|
|
34
35
|
"clean": "rm -rf dist tmp",
|
|
35
36
|
"dist": "tsx ../../tools/dist.ts",
|
|
36
|
-
"tarball": "tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
|
|
37
|
+
"tarball": "rm -rf tmp && tsx ../../tools/dist.ts && npm pack ./tmp --pack-destination ./tmp",
|
|
37
38
|
"typecheck": "tsc --noEmit",
|
|
38
39
|
"postinstall": "node scripts/postinstall.js"
|
|
39
40
|
},
|